Bug report #9071

Filter queries ignore ""

Added by Noone Noone almost 6 years ago. Updated about 3 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Expressions
Affected QGIS version:2.0.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:wontfix
Crashes QGIS or corrupts data:No Copied to github as #:17717

Description

When you define a filter and add a field it's inserted with encapsulated as "fieldname". This causes the user to think that "" is the marker for strings. But if you query like "fieldname"="value", you just get a useless stringname error warning in the logs. You need then to find out, that instead the query has to be formed like "fiedname"='value' that is inconsistent.

So please also support "" or make it easier for the user to understand how to form a valid query.


Related issues

Related to QGIS Application - Feature request #8893: raise warning if an expression cannot be evaluated. Open 2013-10-17

History

#1 Updated by Nathan Woodrow almost 6 years ago

  • Operating System deleted (ubuntu)
  • OS version deleted (12.04)

Are you talking about Layer -> Filter.. or the expression you use for labels, actions, attribute table?

#2 Updated by Jürgen Fischer almost 6 years ago

That's usual SQL syntax. IMHO we should stick to that.

#3 Updated by Noone Noone almost 6 years ago

@Nathan yes Layer -Filter

@Jürgen If you do that please explain people what you expect them todo. Maybe adding an grayed out explame as default for the syntax box, that disappears if the user sets the focus to the edit box.

#4 Updated by Matthias Kuhn almost 6 years ago

  • Target version changed from Version 2.0.0 to Future Release - Nice to have

Related #8893 which is about more prominent warnings for expression errors. This should be the way to go.

#5 Updated by Jürgen Fischer almost 6 years ago

noone noone wrote:

If you do that please explain people what you expect them todo. Maybe ad"ing an grayed out explame as default for the syntax box, that disappears if the user sets the focus to the edit box.

'' quotes string values and "" quotes identifiers (ie. fieldname; optionally - fieldnames w/o whitespaces and other special characters in them don't require quoting).

#6 Updated by Jürgen Fischer about 3 years ago

  • Resolution set to wontfix
  • Status changed from Open to Closed

Also available in: Atom PDF