Bug report #2407

Quick search behaviour in attributes tables has changed

Added by GuZzO - over 10 years ago. Updated over 10 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Vectors
Affected QGIS version: Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:12467

Description

When i start a search within attribute tables with Mimas (1.0.3), searches return results as if it was a SQL request -> SELECT * FROM table WHERE column like '%word_to_search%'

When i start a search within attribute tables with Enceladus (1.0.4), searches return results as if it was an exact match SQL request -> SELECT * FROM table WHERE column = 'word_to_search'

I don't know if it's referenced as bug but I prefer the previous behaviour. The new one is too rigid...

History

#1 Updated by Giovanni Manghi over 10 years ago

Did you tried adding the wildcards?

#2 Updated by GuZzO - over 10 years ago

I tried adding % and * before and/or after the word I searched but nothing changes....
I only got results when i search the exact word (including capitals letters)

I use PostGIS as vectors provider.

#3 Updated by marisn - over 10 years ago

Unfortunately "Quick search" is not an "find" anymore. Wildcards are not accepted, unescaped SQL also gives errors.
I.e. try to find "ab'c" ->

syntax error, unexpected Unknown_CHARACTER, expecting $end

Also it allows to inject SQL. I.e. select all records:

text' or 1=1 or COLUMN like 'text

Tested on QGIS trunk r12951M with Shapefile (DBF).

#4 Updated by Martin Dobias over 10 years ago

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

Fixed in c39ef3de (SVN r13180) (and escaping quotes in )

Also available in: Atom PDF