Skip to content
Permalink
Browse files

MSSQL - Don't use spatial index if there is null values, calc extent …

…instead.

Funded by Digital Mapping Solutions
  • Loading branch information
NathanW2 committed Feb 12, 2015
1 parent 1a60635 commit 1eaec173697d40dbee968c9a6d632a0967e61795
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/providers/mssql/qgsmssqlprovider.cpp
@@ -601,9 +601,12 @@ void QgsMssqlProvider::UpdateStatistics( bool estimate )

if ( query.exec( statement ) )
{
QgsDebugMsg( "Found extents in spatial index" );
if ( query.next() )
if ( query.next() && ( !query.value( 0 ).isNull() ||
!query.value( 1 ).isNull() ||
!query.value( 2 ).isNull() ||
!query.value( 3 ).isNull() ) )
{
QgsDebugMsg( "Found extents in spatial index" );
mExtent.setXMinimum( query.value( 0 ).toDouble() );
mExtent.setYMinimum( query.value( 1 ).toDouble() );
mExtent.setXMaximum( query.value( 2 ).toDouble() );

0 comments on commit 1eaec17

Please sign in to comment.
You can’t perform that action at this time.