Bug report #18680

[Processing]"Contains" and "Does not contain" operators do no work with not string fields

Added by Harrissou Santanna over 5 years ago. Updated over 5 years ago.

Affected QGIS version:3.1(master) Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:26568


In select by attribute algorithm, trying to select features where "gid" contains 1 result in an error stating that these are string-only operators.
If this is the case, we should not list them if the selected field is not of a string type imho.

Then I guess this algorithm does not help me to select subset of features based on this kind of information on numeric field. (I can see that the "select by value" tool neither proposes these operators for numeric field but i can run a "like" selection on numeric field in "select by expression" tool with no problem.)


#1 Updated by Alexander Bruy over 5 years ago

  • Resolution set to invalid
  • Status changed from Open to Rejected

Please read how "contains" and "does not contain" operators work. They can not be applied to numeric data.

#2 Updated by Harrissou Santanna over 5 years ago

Please read again my message; i'm aware of that and as i wrote, if the predicates do not match the type of field, they should not be in the list (which is actually the bug reported here). Now, if this still sounds invalid, feel free to keep that behavior...

Also available in: Atom PDF