Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7189 closed enhancement (fixed)

Trim semicolon in SQL queries?

Reported by: TobWen Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: svn-trunk
Severity: normal Keywords:
Cc:

Description (last modified by TobWen)

Would it be possible to RTRIM a trailing semicolon? It might introduce some trouble when:

$ echo '{ "type": "Point", "coordinates": [0, 0] }' | ogr2ogr -f GPKG test.gpkg /vsistdin/ -nln oldName
$ ogrinfo test.gpkg -sql "ALTER TABLE oldName RENAME TO newName;"
INFO: Open of `test.gpkg'
      using driver `GPKG' successful.

This creates a layer named newName; (including trailing semicolon) which might not be expected by the user.

Change History (3)

comment:1 by TobWen, 6 years ago

Description: modified (diff)

comment:2 by Even Rouault, 6 years ago

Resolution: fixed
Status: newclosed

In 41139:

GPKG: trim trailing semicolon in ExecuteSQL() (fixes #7189)

comment:3 by TobWen, 6 years ago

Might this not also affect other SQL based queries, like SQLite?

Note: See TracTickets for help on using tickets.