Skip to content
Permalink
Browse files

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.
  • Loading branch information
rduivenvoorde committed Nov 16, 2020
1 parent ef7e80d commit 31a0e72147b1783fcd6d0fecd83194d856a1bae4
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/providers/oracle/qgsoracleprovider.cpp
@@ -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 );
}

0 comments on commit 31a0e72

Please sign in to comment.
You can’t perform that action at this time.