Skip to content

Commit 62f4534

Browse files
committed
[MSSQL] Don't MakeValid on geometries
MakeValid can make geometry data we can't read back (e.g GEOMETRYCOLLECTION) which is worse then just a user error in the first place. QGIS has the tools to deal with this so let it came back to the user to fix
1 parent 81855a7 commit 62f4534

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/providers/mssql/qgsmssqlprovider.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -883,10 +883,10 @@ bool QgsMssqlProvider::addFeatures( QgsFeatureList &flist, Flags flags )
883883
if ( mGeometryColType == QLatin1String( "geometry" ) )
884884
{
885885
if ( mUseWkb )
886-
values += QStringLiteral( "geometry::STGeomFromWKB(%1,%2).MakeValid()" ).arg(
886+
values += QStringLiteral( "geometry::STGeomFromWKB(%1,%2)" ).arg(
887887
QStringLiteral( "?" ), QString::number( mSRId ) );
888888
else
889-
values += QStringLiteral( "geometry::STGeomFromText(%1,%2).MakeValid()" ).arg(
889+
values += QStringLiteral( "geometry::STGeomFromText(%1,%2)" ).arg(
890890
QStringLiteral( "?" ), QString::number( mSRId ) );
891891
}
892892
else

0 commit comments

Comments
 (0)