Opened 12 years ago
Last modified 6 years ago
#1755 new enhancement
Need error message to indicate reserved words in SQLite
Reported by: | cmbarton | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.6.2 |
Component: | Vector | Version: | unspecified |
Keywords: | v.net.centrality, SQL | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
I just tried v.net.centrality so I could present it to class tomorrow. Apparently it is broken.
I got the error:
v.net.centrality input=roads_nodes@spatialtech2012 alayer=1 nlayer=2 output=roads_cent degree=degree closeness=close betweenness=between eigenvector=eigenvect DBMI-SQLite driver error: Error in sqlite3_prepare(): near "between": syntax error ERROR: Unable to create table: 'create table roads_cent(cat integer, degree double precision, close double precision, between double precision, eigenvect double precision)' (Thu Oct 4 22:10:04 2012) Command finished (0 sec)
Change History (14)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
There is an old request to quote column names that would allow to use SQL reserved words as column names. See more: #578
Second option would be to enhance parser to discard SQL reserved words as valid column parameters. AFAIK SQL-92 reserved word list isn't so long. Yes, I know, somebody will scream that PG, MySQL etc. have extra reserved words etc., still even blocking only the most common ones would make day for a user like Michal much better as he would be able to finish his task instantly instead of writing a bug report.
comment:3 by , 12 years ago
Summary: | cannot create sqlite table for v.net.centrality → Need error message to indicate reserved words in SQLite |
---|---|
Type: | defect → enhancement |
I relooked at the error and I'm not as unobservant as I initially assumed. There is nothing to say that "between" is an SQLite reserved word. So thanks for the clue about what is wrong.
This is not a bug. But maybe an enhancement request for better error messages here. Changing the field name to "betw" makes it work fine. I've changed the summary too. I don't know if the component should stay vector or shift to something else.
Michael
comment:5 by , 9 years ago
Milestone: | 7.0.0 → 7.0.5 |
---|
comment:6 by , 8 years ago
Milestone: | 7.0.5 → 7.3.0 |
---|
comment:9 by , 6 years ago
Milestone: | 7.4.1 → 7.4.2 |
---|
comment:10 by , 6 years ago
Milestone: | 7.4.2 → 7.6.0 |
---|
All enhancement tickets should be assigned to 7.6 milestone.
comment:12 by , 6 years ago
Not sure where this is at (maybe nowhere yet). I very much like the idea suggested in #3563 to add an underscore and give a warning. This seems the least disruptive and provides information for future table design.
Replying to cmbarton:
'between' is a reserved word for SQLite and other DB backends.
ps: please could you use preformatted text in your reports, otherwise it's hard to read - WikiFormatting