Skip to content

Commit cafc367

Browse files
committed
spatialite provider: accept empty tables from spatialite 4 (fixes #7664)
1 parent c80a1f4 commit cafc367

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/providers/spatialite/qgsspatialiteprovider.cpp

+11-5
Original file line numberDiff line numberDiff line change
@@ -4164,7 +4164,7 @@ bool QgsSpatiaLiteProvider::checkLayerTypeAbstractInterface( gaiaVectorLayerPtr
41644164
case GAIA_VECTOR_VIRTUAL:
41654165
mVShapeBased = true;
41664166
break;
4167-
};
4167+
}
41684168

41694169
if ( lyr->AuthInfos )
41704170
{
@@ -4400,7 +4400,8 @@ bool QgsSpatiaLiteProvider::getGeometryDetailsAbstractInterface( gaiaVectorLayer
44004400
default:
44014401
geomType = QGis::WKBUnknown;
44024402
break;
4403-
};
4403+
}
4404+
44044405
mSrid = lyr->Srid;
44054406
if ( lyr->SpatialIndex == GAIA_SPATIAL_INDEX_RTREE )
44064407
{
@@ -4424,7 +4425,7 @@ bool QgsSpatiaLiteProvider::getGeometryDetailsAbstractInterface( gaiaVectorLayer
44244425
case GAIA_XY_Z_M:
44254426
nDims = GAIA_XY_Z_M;
44264427
break;
4427-
};
4428+
}
44284429

44294430
if ( mViewBased && spatialIndexRTree )
44304431
getViewSpatialIndexName();
@@ -4915,9 +4916,14 @@ bool QgsSpatiaLiteProvider::getTableSummaryAbstractInterface( gaiaVectorLayerPtr
49154916
layerExtent.set( lyr->ExtentInfos->MinX, lyr->ExtentInfos->MinY,
49164917
lyr->ExtentInfos->MaxX, lyr->ExtentInfos->MaxY );
49174918
numberFeatures = lyr->ExtentInfos->Count;
4918-
return true;
49194919
}
4920-
return false;
4920+
else
4921+
{
4922+
layerExtent.setMinimal();
4923+
numberFeatures = 0;
4924+
}
4925+
4926+
return true;
49214927
}
49224928
#endif
49234929

0 commit comments

Comments
 (0)