Bug report #5641

Empty query does not get processed in query builder

Added by Leyan Ouyang over 7 years ago. Updated over 7 years ago.

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

Description

If the query text box is empty when clicking the OK button, the empty string is not used and evaluated. This means that if there was already a query existing, it is kept, instead of the expected result of clearing it. Validating an empty query should be equivalent to clearing the query.

This is due to a test made in QgsQueryBuilder::accept(), skipping the validation for an empty query. I do not see the point of this test, so I propose simply to remove it. If it is useful to avoid validation of an empty query for another reason, we should still validate it with mLayer->setSubsetString( "" );

Patch attached.

empty_query.txt Magnifier (775 Bytes) Leyan Ouyang, 2012-05-25 10:09 PM

History

#1 Updated by Jürgen Fischer over 7 years ago

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

Also available in: Atom PDF