Bug report #2170

spatialite problems with reserved word column name

Added by barryrowlingson - about 15 years ago. Updated about 15 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Data Provider
Affected QGIS version: Regression?:No
Operating System:Linux Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:12230

Description

I have a spatialite table with a column called 'UPDATE'. Loading into Qgis causes problems accessing the attributes. The attribute table comes up all 'ERROR', and querying points on the map cause error messages and the map layer points to all disappear. Pretty reproducible.

Streams of these appear:

SQL: near "UPDATE": syntax error
Critical: SQLite error: SELECT ROWID, TYPE, SITECODE, DATE, UPDATE, [etc]

which looks like column names are unquoted and so reserved words for column names will break stuff.

[This database was full of tricksy names, such as tables called "region-code" and "stuff with spaces" that needed quoting and munging as I converted it from mdb to spatialite. Thought I'd got 'em all!]

crazydb.zip (102 KB) Sandro Furieri, 2009-12-03 06:39 AM

Associated revisions

Revision bb918db7
Added by Sandro Furieri about 15 years ago

fix #2170: (double-quoting any SQL table or column name)

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12324 c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision 6c3c441b
Added by Sandro Furieri about 15 years ago

fix #2170: (double-quoting any SQL table or column name)

git-svn-id: http://svn.osgeo.org/qgis/trunk@12324 c8812cc2-4d05-0410-92ff-de0c093fc19c

History

#1 Updated by Sandro Furieri about 15 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

fixed in rev.12324

I've attached the sample DB I used for actual testing

Also available in: Atom PDF