[QGIS-Developer] "Filter on joined fields" and Virtual layers not working as expected

andreaerdna andreaerdna at libero.it
Tue Aug 28 04:42:31 PDT 2018


andreaerdna wrote
> - the virtual layers show no feature when no filter string is set in the
> Query builder, instead of showing all the features

Better looking at the code, it seems to me that the bug is in
QgsVirtualLayerFeatureIterator::QgsVirtualLayerFeatureIterator where
"subset" is tested for Null instead that for Empty

    QString subset = mSource->mSubset;
    if ( !subset.isNull() )
    {
      wheres << subset;
    }

This leads to the insertion of an empty string in the "wheres" list, thus to
the incorrect preparation of an SQL query with the WHERE clause without
condition or the unneeded AND operator.



-----
Andrea Giudiceandrea
--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html


More information about the QGIS-Developer mailing list