mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-09 00:08:52 -04:00
oracle provider: handle NULL geometry in case of multiple geometry columns
This commit is contained in:
parent
59de73ac3b
commit
c93187d78c
@ -275,13 +275,20 @@ bool QgsOracleFeatureIterator::fetchFeature( QgsFeature& feature )
|
|||||||
if ( fld.type() == QVariant::ByteArray && fld.typeName().endsWith( ".SDO_GEOMETRY" ) )
|
if ( fld.type() == QVariant::ByteArray && fld.typeName().endsWith( ".SDO_GEOMETRY" ) )
|
||||||
{
|
{
|
||||||
QByteArray *ba = static_cast<QByteArray*>( v.data() );
|
QByteArray *ba = static_cast<QByteArray*>( v.data() );
|
||||||
unsigned char *copy = new unsigned char[ba->size()];
|
if ( ba->size() > 0 )
|
||||||
memcpy( copy, ba->constData(), ba->size() );
|
{
|
||||||
|
unsigned char *copy = new unsigned char[ba->size()];
|
||||||
|
memcpy( copy, ba->constData(), ba->size() );
|
||||||
|
|
||||||
QgsGeometry *g = new QgsGeometry();
|
QgsGeometry *g = new QgsGeometry();
|
||||||
g->fromWkb( copy, ba->size() );
|
g->fromWkb( copy, ba->size() );
|
||||||
v = g->exportToWkt();
|
v = g->exportToWkt();
|
||||||
delete g;
|
delete g;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
v = QVariant( QVariant::String );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ( v.type() != fld.type() )
|
else if ( v.type() != fld.type() )
|
||||||
v = QgsVectorDataProvider::convertValue( fld.type(), v.toString() );
|
v = QgsVectorDataProvider::convertValue( fld.type(), v.toString() );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user