Skip to content
Permalink
Browse files

oracle provider: handle NULL geometry in case of multiple geometry co…

…lumns

(cherry picked from commit c93187d)
  • Loading branch information
jef-n committed Apr 8, 2016
1 parent dc791fd commit d4f62ced098e54afa4bbf0940154582f0e4dd7b0
Showing with 13 additions and 6 deletions.
  1. +13 −6 src/providers/oracle/qgsoraclefeatureiterator.cpp
@@ -282,13 +282,20 @@ bool QgsOracleFeatureIterator::fetchFeature( QgsFeature& feature )
if ( fld.type() == QVariant::ByteArray && fld.typeName().endsWith( ".SDO_GEOMETRY" ) )
{
QByteArray *ba = static_cast<QByteArray*>( v.data() );
unsigned char *copy = new unsigned char[ba->size()];
memcpy( copy, ba->constData(), ba->size() );
if ( ba->size() > 0 )
{
unsigned char *copy = new unsigned char[ba->size()];
memcpy( copy, ba->constData(), ba->size() );

QgsGeometry *g = new QgsGeometry();
g->fromWkb( copy, ba->size() );
v = g->exportToWkt();
delete g;
QgsGeometry *g = new QgsGeometry();
g->fromWkb( copy, ba->size() );
v = g->exportToWkt();
delete g;
}
else
{
v = QVariant( QVariant::String );
}
}
else if ( v.type() != fld.type() )
v = QgsVectorDataProvider::convertValue( fld.type(), v.toString() );

0 comments on commit d4f62ce

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