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.

(cherry picked from commit 31a0e72)
  • Loading branch information
rduivenvoorde authored and nyalldawson committed Jan 15, 2021
1 parent 25d8a29 commit 8ba9727
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/oracle/qgsoracleprovider.cpp
Expand Up @@ -3094,8 +3094,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 8ba9727

Please sign in to comment.