Bug report #16943
Create virtual layer from OSM import fails on field names with : in them
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | DB Manager | ||
Affected QGIS version: | 2.18.11 | Regression?: | No |
Operating System: | Ubuntu | Easy fix?: | No |
Pull Request or Patch supplied: | No | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 24842 |
Description
Some OSM layers created in spatialite (using built in Vector/OSM menu) have colons in the field name. When trying to create virtual layers either with or without effected fields, an error is returned as such:
Query execution error on DROP TABLE IF EXISTS "rottnest_workshop_polygons"; CREATE VIRTUAL TABLE "rottnest_workshop_polygons" USING QgsVLayer(rottnest_workshop_polygons20170729144756312);: 1 - near ":disposal": syntax error
In this case, where ":disposal" is the remainder of the column name "toilets:disposal".
It is possible to change the column name as a temporary work around, but I'm trying to create a repeatable process where we can update with a fresh copy of the underlying OSM data and have all existing styling/layers etc "just work".
Has been checked on 2.14, 2.18.10 & 2.18.11.
Attached osm data file has tags that create such fields.
Associated revisions
Fix virtual layers fail if table field names have special characters
Fixes #16943
Fix virtual layers fail if table field names have special characters
Fixes #16943
Cherry-picked from 6c392124
History
#1 Updated by Nyall Dawson almost 7 years ago
- % Done changed from 0 to 100
- Status changed from Open to Closed
Applied in changeset qgis|6c392124ca4684c433518a40b81e34200672c77c.
#2 Updated by Giovanni Manghi over 6 years ago
- Resolution set to fixed/implemented