Skip to content

Commit 5ba6e68

Browse files
committed
Revert oracle server-side simplication
(reverts 6f70953 and 772dc1d)
1 parent 87887e4 commit 5ba6e68

File tree

5 files changed

+1
-74
lines changed

5 files changed

+1
-74
lines changed

src/providers/oracle/qgsoracleconn.cpp

-16
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ QgsOracleConn::QgsOracleConn( QgsDataSourceURI uri )
5959
: mRef( 1 )
6060
, mCurrentUser( QString::null )
6161
, mHasSpatial( -1 )
62-
, mMajorVersion( -1 )
6362
{
6463
QgsDebugMsg( QString( "New Oracle connection for " ) + uri.connectionInfo() );
6564

@@ -774,21 +773,6 @@ QString QgsOracleConn::databaseName( QString database, QString host, QString por
774773
return db;
775774
}
776775

777-
int QgsOracleConn::majorVersion()
778-
{
779-
if ( mMajorVersion == -1 )
780-
{
781-
QSqlQuery qry( mDatabase );
782-
if ( exec( qry, "SELECT banner FROM v$version WHERE banner LIKE 'Oracle Database%'" ) && qry.next() )
783-
{
784-
QRegExp vers( "([0-9]+)\\.[0-9\\.]+[0-9]" );
785-
if ( vers.indexIn( qry.value( 0 ).toString() ) >= 0 )
786-
mMajorVersion = vers.cap( 1 ).toInt();
787-
}
788-
}
789-
return mMajorVersion;
790-
}
791-
792776
bool QgsOracleConn::hasSpatial()
793777
{
794778
if ( mHasSpatial == -1 )

src/providers/oracle/qgsoracleconn.h

-4
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ class QgsOracleConn : public QObject
139139
QString currentUser();
140140

141141
bool hasSpatial();
142-
int majorVersion();
143142

144143
static const int sGeomTypeSelectLimit;
145144

@@ -178,9 +177,6 @@ class QgsOracleConn : public QObject
178177
//! has spatial
179178
int mHasSpatial;
180179

181-
//! major database version
182-
int mMajorVersion;
183-
184180
QSqlDatabase mDatabase;
185181
QSqlQuery mQuery;
186182

src/providers/oracle/qgsoraclefeatureiterator.cpp

+1-40
Original file line numberDiff line numberDiff line change
@@ -148,27 +148,6 @@ bool QgsOracleFeatureIterator::nextFeatureFilterExpression( QgsFeature& f )
148148
return fetchFeature( f );
149149
}
150150

151-
bool QgsOracleFeatureIterator::prepareSimplification( const QgsSimplifyMethod& simplifyMethod )
152-
{
153-
// setup simplification of geometries to fetch
154-
if ( !( mRequest.flags() & QgsFeatureRequest::NoGeometry ) &&
155-
simplifyMethod.methodType() != QgsSimplifyMethod::NoSimplification &&
156-
!simplifyMethod.forceLocalOptimization() )
157-
{
158-
QgsSimplifyMethod::MethodType methodType = simplifyMethod.methodType();
159-
160-
if ( methodType == QgsSimplifyMethod::OptimizeForRendering )
161-
{
162-
return true;
163-
}
164-
else
165-
{
166-
QgsDebugMsg( QString( "Simplification method type (%1) is not recognised by OracleFeatureIterator" ).arg( methodType ) );
167-
}
168-
}
169-
return QgsAbstractFeatureIterator::prepareSimplification( simplifyMethod );
170-
}
171-
172151
bool QgsOracleFeatureIterator::fetchFeature( QgsFeature& feature )
173152
{
174153
feature.setValid( false );
@@ -337,20 +316,7 @@ bool QgsOracleFeatureIterator::openQuery( QString whereClause )
337316

338317
if (( mRequest.flags() & QgsFeatureRequest::NoGeometry ) == 0 && !mSource->mGeometryColumn.isNull() )
339318
{
340-
if ( !mRequest.simplifyMethod().forceLocalOptimization() &&
341-
mRequest.simplifyMethod().methodType() == QgsSimplifyMethod::OptimizeForRendering &&
342-
QGis::flatType( QGis::singleType( mSource->mRequestedGeomType != QGis::WKBUnknown
343-
? mSource->mRequestedGeomType
344-
: mSource->mDetectedGeomType ) ) != QGis::WKBPoint )
345-
{
346-
query += QString( "SDO_UTIL.SIMPLIFY( %1, %2 )" )
347-
.arg( QgsOracleProvider::quotedIdentifier( mSource->mGeometryColumn ) )
348-
.arg( mRequest.simplifyMethod().tolerance() * 0.7 ); //-> We use a smaller tolerance than pre-filtering to be on the safe side
349-
}
350-
else
351-
{
352-
query += QgsOracleProvider::quotedIdentifier( mSource->mGeometryColumn );
353-
}
319+
query += QgsOracleProvider::quotedIdentifier( mSource->mGeometryColumn );
354320
delim = ",";
355321
}
356322

@@ -411,11 +377,6 @@ bool QgsOracleFeatureIterator::openQuery( QString whereClause )
411377
return true;
412378
}
413379

414-
bool QgsOracleFeatureIterator::providerCanSimplify( QgsSimplifyMethod::MethodType methodType ) const
415-
{
416-
return ( mConnection->majorVersion() > 10 || mConnection->hasSpatial() ) && methodType == QgsSimplifyMethod::OptimizeForRendering;
417-
}
418-
419380
// -----------
420381

421382
QgsOracleFeatureSource::QgsOracleFeatureSource( const QgsOracleProvider* p )

src/providers/oracle/qgsoraclefeatureiterator.h

-7
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,13 @@ class QgsOracleFeatureIterator : public QgsAbstractFeatureIteratorFromSource<Qgs
7676
//! fetch next feature filter expression
7777
bool nextFeatureFilterExpression( QgsFeature& f ) override;
7878

79-
//! Setup the simplification of geometries to fetch using the specified simplify method
80-
virtual bool prepareSimplification( const QgsSimplifyMethod& simplifyMethod ) override;
81-
8279
bool openQuery( QString whereClause );
8380

8481
QgsOracleConn *mConnection;
8582
QSqlQuery mQry;
8683
bool mRewind;
8784
bool mExpressionCompiled;
8885
QgsAttributeList mAttributeList;
89-
90-
private:
91-
//! returns whether the iterator supports simplify geometries on provider side
92-
virtual bool providerCanSimplify( QgsSimplifyMethod::MethodType methodType ) const override;
9386
};
9487

9588
#endif // QGSORACLEFEATUREITERATOR_H

src/providers/oracle/qgsoracleprovider.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -747,13 +747,6 @@ bool QgsOracleProvider::hasSufficientPermsAndCapabilities()
747747

748748
mEnabledCapabilities = QgsVectorDataProvider::SelectAtId | QgsVectorDataProvider::SelectGeometryAtId;
749749

750-
if ( mConnection->majorVersion() > 10 || mConnection->hasSpatial() )
751-
{
752-
// 10g doesn't support SDO_UTIL in Oracle Locator
753-
// supports geometry simplification on provider side
754-
mEnabledCapabilities |= QgsVectorDataProvider::SimplifyGeometries;
755-
}
756-
757750
QSqlQuery qry( *mConnection );
758751
if ( !mIsQuery )
759752
{

0 commit comments

Comments
 (0)