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

Nyall Dawson nyall.dawson at gmail.com
Tue Aug 28 21:20:10 PDT 2018


On Tue, 28 Aug 2018 at 21:42, andreaerdna <andreaerdna at libero.it> wrote:
>
> 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.

Great catch, fix merged.

Keep these coming -- they are very valuable fixes!

Nyall


More information about the QGIS-Developer mailing list