Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#5520 closed defect (fixed)

GPKG: Quote field names

Reported by: Robert Coup Owned by: Even Rouault
Priority: normal Milestone:
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords: gpkg geopackage
Cc: ryanl, Kyle Shannon

Description

Currently no escaping happens on column names in the Geopackage driver, which means field names with spaces/dashes/etc will cause SQL errors.

Attached patch quotes column names.

Attachments (2)

5520.1.patch (3.4 KB) - added by Robert Coup 7 years ago.
Patch v1
gpkg_escap_col.diff (5.8 KB) - added by Kyle Shannon 7 years ago.
missed a few escapes

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by Robert Coup

Attachment: 5520.1.patch added

Patch v1

comment:1 Changed 7 years ago by Robert Coup

Cc: ryanl added

comment:2 Changed 7 years ago by Even Rouault

Looks good to me. I let you apply ?

comment:3 Changed 7 years ago by Robert Coup

Resolution: fixed
Status: newclosed

Fixed in [27462]

comment:4 Changed 7 years ago by Kyle Shannon

Cc: Kyle Shannon added

comment:5 Changed 7 years ago by Kyle Shannon

It looks like there was a little refactoring in between the trunk and 1.11 in gpkg. I've attempted to catch up on escaping column names in the patch, but have to add tests to ensure I don't break it. I will test on 1.11 tonight, and attach tests then.

Changed 7 years ago by Kyle Shannon

Attachment: gpkg_escap_col.diff added

missed a few escapes

comment:6 Changed 7 years ago by Even Rouault

Backport in 1.11 was done in #5879

Note: See TracTickets for help on using tickets.