Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Over-stringent SQLite validation #9093

Closed
fvankrieken opened this issue Jan 17, 2024 · 0 comments
Closed

Over-stringent SQLite validation #9093

fvankrieken opened this issue Jan 17, 2024 · 0 comments
Assignees

Comments

@fvankrieken
Copy link

fvankrieken commented Jan 17, 2024

Expected behavior and actual behavior.

As part of resolution to #8430, validation was added to ensure that sql commands being used are valid for sqlite (and prompt user to use OGR SQL dialect rather than SQLite in cases where appropriate). However, these cases check that sql statements start with "{command} ", the final character there being a space. However, other whitespace characters are not considered valid, even though "SELECT\n" is a valid beginning to a SQLite select clause. This issue arose for us because of sql queries defined in yml files that get fed into a gdal.VectorTranslate call in python, and it's helpful to format the queries with newlines.

Steps to reproduce the problem.

Perform any call to ogr2ogr with sqlite dialect and sql statement starting with "SELECT\n". If more details/example data are needed, happy to provide, but from the code hope that this issue is self-evident.

Operating system

Debian bookworm

GDAL version and provenance

I was using a built-from-source install of 3.8.3

@rouault rouault self-assigned this Jan 17, 2024
rouault added a commit that referenced this issue Jan 25, 2024
ExecuteSQL(dialect=SQLite): support 'SELECT\n' for example (fixes #9093)
rouault added a commit that referenced this issue Jan 29, 2024
[Backport release/3.8] ExecuteSQL(dialect=SQLite): support 'SELECT\n' for example (fixes #9093)
ralphraul pushed a commit to 1SpatialGroupLtd/gdal that referenced this issue Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants