Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#5472 closed defect (fixed)

GPKG: Layers with dashes in the name cause sqlite errors

Reported by: ryanl Owned by: Even Rouault
Priority: normal Milestone: 2.0.0
Component: OGR_SF Version: 1.11.0
Severity: normal Keywords: geopackage, gpkg


Layers with a dash '-' causes the gpkg driver to exit with:

$ ogr2ogr -f gpkg hyphen.gpkg some-layer.shp
ERROR 1: sqlite3_exec(CREATE TABLE some-layer ( fid INTEGER PRIMARY KEY AUTOINCREMENT, geom LINESTRING )) failed: near "-": syntax error
ERROR 1: Terminating translation prematurely after failed

I was unable to find anything preventing dashes in the geopackage spec, so this could be fixed by quoting the name at ogrgeopackagedatasource.cpp:797, alternatively the check at ogrgeopackagedatasource.cpp:753 could be improved as strspn will only check for illegal prefixes.

Change History (2)

comment:1 Changed 7 years ago by Even Rouault

Milestone: 2.0
Resolution: fixed
Status: newclosed

trunk r27343 "GPKG: allow table names with dash character (#5472)"

comment:2 Changed 6 years ago by Even Rouault


Milestone renamed

Note: See TracTickets for help on using tickets.