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

ORDER BY clause in filter does not accept quoted field names #20753

Closed
qgib opened this issue Apr 23, 2015 · 2 comments
Closed

ORDER BY clause in filter does not accept quoted field names #20753

qgib opened this issue Apr 23, 2015 · 2 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers

Comments

@qgib
Copy link
Contributor

qgib commented Apr 23, 2015

Author Name: mlennert - (mlennert -)
Original Redmine Issue: 12638
Affected QGIS version: master
Redmine category:data_provider


Trying to order my shapefile point data in QGIS 2.4 (Debian testing version) for proportionate symbol mapping in order to have the largest symbols below the smallest, I use the following clause in the layer's filter:

1=1 ORDER BY "pop_2001" desc

This however gives me

OGR [3] error 1: SQL Expression Parsing Error: syntax error

When I leave out the quotation marks (inserted automatically by the GUI):

1=1 ORDER BY pop_2001 desc

everything works as expected.

I don't have this problem when I access a postgis table via the OGR provider, i.e. I can use quoted field names there.

However, when I access the same table via the postgis provider, the result of the query is empty !

So the whole thing seems to be provider specific...

@qgib
Copy link
Contributor Author

qgib commented Apr 24, 2015

Author Name: Giovanni Manghi (@gioman)


It happens also on 2.8.1/master.


  • version was changed from 2.4.0 to master

@qgib
Copy link
Contributor Author

qgib commented Apr 24, 2015

Author Name: Jürgen Fischer (@jef-n)


The subset strings are indeed provider specific, but they are generally supposed to be where clauses only - using "ORDER BY" isn't supported.


  • resolution was changed from to wontfix
  • status_id was changed from Open to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers labels May 25, 2019
@qgib qgib closed this as completed May 25, 2019
lbartoletti added a commit to lbartoletti/QGIS that referenced this issue Jun 27, 2019
lbartoletti added a commit to lbartoletti/QGIS that referenced this issue Jun 27, 2019
mhugo pushed a commit that referenced this issue Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers
Projects
None yet
Development

No branches or pull requests

1 participant