Skip to content

Commit

Permalink
Partially fix of #39855: diminfo in inserted as string in mdsys query
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rduivenvoorde committed Nov 16, 2020
1 parent ef7e80d commit 31a0e72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/oracle/qgsoracleprovider.cpp
Expand Up @@ -3093,8 +3093,8 @@ QgsVectorLayerExporter::ExportError QgsOracleProvider::createEmptyLayer(
}
}

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

0 comments on commit 31a0e72

Please sign in to comment.