Bug report #5641
Empty query does not get processed in query builder
|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( "" );