Skip to content

Commit 1050174

Browse files
committed
spatialite provider: prefer rowid as primary key where available (and some cleanups)
fixes #14575, fixes #14626
1 parent 2897764 commit 1050174

File tree

4 files changed

+377
-385
lines changed

4 files changed

+377
-385
lines changed

src/providers/spatialite/qgsspatialitefeatureiterator.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ QString QgsSpatiaLiteFeatureIterator::whereClauseRect()
378378
}
379379
else if ( rect.isFinite() )
380380
{
381-
if ( mSource->spatialIndexRTree )
381+
if ( mSource->mSpatialIndexRTree )
382382
{
383383
// using the RTree spatial index
384384
QString mbrFilter = QString( "xmin <= %1 AND " ).arg( qgsDoubleToString( rect.xMaximum() ) );
@@ -391,7 +391,7 @@ QString QgsSpatiaLiteFeatureIterator::whereClauseRect()
391391
QgsSpatiaLiteProvider::quotedIdentifier( idxName ),
392392
mbrFilter );
393393
}
394-
else if ( mSource->spatialIndexMbrCache )
394+
else if ( mSource->mSpatialIndexMbrCache )
395395
{
396396
// using the MbrCache spatial index
397397
QString idxName = QString( "cache_%1_%2" ).arg( mSource->mIndexTable, mSource->mIndexGeometry );
@@ -578,16 +578,16 @@ bool QgsSpatiaLiteFeatureIterator::prepareOrderBy( const QList<QgsFeatureRequest
578578
QgsSpatiaLiteFeatureSource::QgsSpatiaLiteFeatureSource( const QgsSpatiaLiteProvider* p )
579579
: mGeometryColumn( p->mGeometryColumn )
580580
, mSubsetString( p->mSubsetString )
581-
, mFields( p->attributeFields )
581+
, mFields( p->mAttributeFields )
582582
, mQuery( p->mQuery )
583-
, isQuery( p->isQuery )
583+
, mIsQuery( p->mIsQuery )
584584
, mViewBased( p->mViewBased )
585585
, mVShapeBased( p->mVShapeBased )
586586
, mIndexTable( p->mIndexTable )
587587
, mIndexGeometry( p->mIndexGeometry )
588588
, mPrimaryKey( p->mPrimaryKey )
589-
, spatialIndexRTree( p->spatialIndexRTree )
590-
, spatialIndexMbrCache( p->spatialIndexMbrCache )
589+
, mSpatialIndexRTree( p->mSpatialIndexRTree )
590+
, mSpatialIndexMbrCache( p->mSpatialIndexMbrCache )
591591
, mSqlitePath( p->mSqlitePath )
592592
{
593593
}

src/providers/spatialite/qgsspatialitefeatureiterator.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ class QgsSpatiaLiteFeatureSource : public QgsAbstractFeatureSource
3939
QString mSubsetString;
4040
QgsFields mFields;
4141
QString mQuery;
42-
bool isQuery;
42+
bool mIsQuery;
4343
bool mViewBased;
4444
bool mVShapeBased;
4545
QString mIndexTable;
4646
QString mIndexGeometry;
4747
QString mPrimaryKey;
48-
bool spatialIndexRTree;
49-
bool spatialIndexMbrCache;
48+
bool mSpatialIndexRTree;
49+
bool mSpatialIndexMbrCache;
5050
QString mSqlitePath;
5151

5252
friend class QgsSpatiaLiteFeatureIterator;

0 commit comments

Comments
 (0)