Bug report #13657

default leading and trailing spaces when wildcard character used in 'Select by expression'

Added by Michael Shin over 8 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Expressions
Affected QGIS version:master 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 #:21692

Description

Unless deleted, the single spaces that both precede and follow the wildcard character (i.e., %) when inserted (e.g., via a double-click of mouse) from the list of Operators in the 'Select by expression...' dialog alters the pattern search of operators such as LIKE and ILIKE. Having the default wildcard without leading and trailing spaces will resolve this issue.

History

#1 Updated by Giovanni Manghi over 8 years ago

  • Affected QGIS version changed from 2.10.0 to master
  • Operating System deleted (Windows 7)
  • Category set to Expressions

#2 Updated by Sebastian Dietrich over 8 years ago

According to the documentation the % is not supposed to be the wildcard character but the modulo operator. It therefore comes with the same leading and trailing spaces as any other operator, e.g. + or -.

I don't think the behaviour should be changed.

But maybe a '% (wildcard)' can be added that only inserts the % character with no spaces around?

#3 Updated by Nyall Dawson over 8 years ago

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

According to the documentation the % is not supposed to be the wildcard character but the modulo operator. It therefore comes with the same leading and trailing spaces as any other operator, e.g. + or -.

I don't think the behaviour should be changed.

Agreed. I can't see many users using the list to add a "%" sign to a like clause enough times for this to be a big issue anyway, and as noted the % symbol is listed as a modulo operator in the tree.

Also available in: Atom PDF