Opened 10 years ago

Closed 10 years ago

Last modified 9 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
Cc:

Description

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 by Even Rouault, 10 years ago

Milestone: 2.0
Resolution: fixed
Status: newclosed

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

comment:2 by Even Rouault, 9 years ago

Milestone: 2.02.0.0

Milestone renamed

Note: See TracTickets for help on using tickets.