Bug report #5641

Empty query does not get processed in query builder

Added by Leyan Ouyang almost 12 years ago. Updated almost 12 years ago.

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


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


#1 Updated by Jürgen Fischer almost 12 years ago

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

Also available in: Atom PDF