Skip to content

Commit 31a0e72

Browse files
committedNov 16, 2020
Partially fix of #39855: diminfo in inserted as string in mdsys query
By inserting the diminfo string into the query instead of giving it as a param in the prepared statement, the error is fixed. Apparently the param was resolved as a string? Note that this NOT fix the dbmanager issue of #39855. But it makes it possible to drag/drop a layer from the browser again.
1 parent ef7e80d commit 31a0e72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/providers/oracle/qgsoracleprovider.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3093,8 +3093,8 @@ QgsVectorLayerExporter::ExportError QgsOracleProvider::createEmptyLayer(
30933093
}
30943094
}
30953095

3096-
if ( !exec( qry, QString( "INSERT INTO mdsys.user_sdo_geom_metadata(table_name,column_name,srid,diminfo) VALUES (?,?,?,?)" ),
3097-
QVariantList() << tableName.toUpper() << geometryColumn.toUpper() << srid << diminfo ) )
3096+
if ( !exec( qry, QString( "INSERT INTO mdsys.user_sdo_geom_metadata(table_name,column_name,srid,diminfo) VALUES (?,?,?,%1)" ).arg( QString( diminfo ) ),
3097+
QVariantList() << tableName.toUpper() << geometryColumn.toUpper() << srid ) )
30983098
{
30993099
throw OracleException( tr( "Could not insert metadata." ), qry );
31003100
}

0 commit comments

Comments
 (0)
Please sign in to comment.