Opened 16 years ago
Closed 16 years ago
#400 closed defect (fixed)
Bogus SQL error message handling in db_execute_immediate
Reported by: | marisn | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | 6.4.0 |
Component: | Database | Version: | svn-develbranch6 |
Keywords: | Cc: | ||
CPU: | Unspecified | Platform: | Unspecified |
Description
I was trying to import shapefile with v.in.ogr and it failed while trying to create database. Only problem - there was no meaningfull error message displayed. Using same SQL expression with db.execute also failed to produce readable error message. After subsequent runs I once got some wired character as error message most likely coming from bogous printf statement argument. Still I was not able to identify origin of that error message to check printf arguments.
Revision: 34900 make distclean && make
$ echo "create table gps_pents_osl (cat integer, SHAPEID integer, ELE double precision, NAME varchar ( 80 ), DESC varchar ( 80 ), AUGST double precision)" | db.execute DBMI-DBF driver error: SQL parser error: �۷ in statement: create table gps_pents_osl (cat integer, SHAPEID integer, ELE double precision, NAME varchar ( 80 ), DESC varchar ( 80 ), AUGST double precision) Error in db_execute_immediate()
Change History (3)
comment:1 by , 16 years ago
Summary: | Bogous SQL error message handling in db_execute_immediate → Bogus SQL error message handling in db_execute_immediate |
---|
comment:2 by , 16 years ago
the "SQL parser error: �۷" indicates e.g. %s of an uninitialized variable.
Hamish
comment:3 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Error message was used after freeing it. Fixed in r36326.
AFAIK "DESC" is a reserved SQL word which cannot be a column name.
See "ERROR MESSAGES" in the v.in.ogr manual. Apparently the vector modules catch the error while the db.* modules don't.
Markus