Skip to content

Commit 582d009

Browse files
committed
oracle provider: consider srid when looking trying spatial index (followup 991f94d; fixes #12230)
1 parent eb6910e commit 582d009

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/providers/oracle/qgsoracleprovider.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,9 +694,10 @@ bool QgsOracleProvider::loadFields()
694694

695695
if ( !mHasSpatialIndex )
696696
{
697-
mHasSpatialIndex = qry.exec( QString( "SELECT %2 FROM %1 WHERE sdo_filter(%2,mdsys.sdo_geometry(2003,NULL,NULL,mdsys.sdo_elem_info_array(1,1003,3),mdsys.sdo_ordinate_array(1,1,-1,-1)))='TRUE'" )
697+
mHasSpatialIndex = qry.exec( QString( "SELECT %2 FROM %1 WHERE sdo_filter(%2,mdsys.sdo_geometry(2003,%3,NULL,mdsys.sdo_elem_info_array(1,1003,3),mdsys.sdo_ordinate_array(1,1,-1,-1)))='TRUE'" )
698698
.arg( mQuery )
699-
.arg( quotedIdentifier( mGeometryColumn ) ) );
699+
.arg( quotedIdentifier( mGeometryColumn ) )
700+
.arg( mSrid < 1 ? "NULL" : QString::number( mSrid ) ) );
700701
if ( !mHasSpatialIndex )
701702
{
702703
QgsMessageLog::logMessage( tr( "No spatial index on column %1.%2.%3 found - expect poor performance." )

0 commit comments

Comments
 (0)