Opened 11 years ago
Last modified 6 years ago
#2322 new defect
v.db.addtable: add sanity check to avoid unreadable column types with SQLite
Reported by: | neteler | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.6.2 |
Component: | Database | Version: | svn-releasebranch70 |
Keywords: | v.db.addtable, SQLite | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
Given that SQLite accepts "whatever" type which is eventially unreadable:
# Example: GRASS 7.1.svn (nc_spm_08_grass7):~ > echo "527500.0|165000.0|1" | v.in.ascii input=- output=testpoint # nonsense type is accepted as being passed on to SQLite: v.db.addtable testpoint layer=2 columns="name something" DB settings already defined, nothing to do Reading features... 100% Updating database... 100% 0 categories read from vector map (layer 2) 0 records updated/inserted (layer 2) # re-opening fails since "something" cannot be remapped # to GRASS DB types: v.info -c testpoint layer=2 Displaying column types/names for database connection of layer <2>: WARNING: SQLite driver: unable to parse decltype: something WARNING: SQLite driver: unable to parse decltype: something WARNING: SQLite driver: column 'name', SQLite type 2 is not supported INTEGER|cat
Ouch. The issue came up while creating "mycol doubleprecision" instead of "mycol double precision".
A solution might be to re-open the table immediately in v.db.addtable and delete it right away if not readable to avoid that the user gets stuck with a broken table.
Ideas?
Change History (5)
comment:1 by , 9 years ago
Milestone: | 7.0.0 → 7.0.5 |
---|
comment:2 by , 8 years ago
Milestone: | 7.0.5 → 7.0.6 |
---|
comment:3 by , 7 years ago
Milestone: | 7.0.6 → 7.0.7 |
---|
comment:4 by , 6 years ago
Milestone: | 7.0.7 → 7.6.1 |
---|
comment:5 by , 6 years ago
Milestone: | 7.6.1 → 7.6.2 |
---|
Note:
See TracTickets
for help on using tickets.
Ticket retargeted after milestone closed