Skip to content
Permalink
Browse files

[BUGFIX][Oracle] Mixing SDO_GEOMETRY Point definition

Fixes #18900

In `sdoobj`, the `elem_info` array size is not the right way to defined the way
to read Point coordinate. The right way is to check the
sdoind attributes, like in Mapserver.

The way Mapserver defined check point coordinate: https://github.com/mapserver/mapserver/blob/fd04328a89e75ac963f15867d9d90a50d47513c1/maporaclespatial.c#L1588

(cherry-picked from 4017690)
  • Loading branch information
rldhont authored and nyalldawson committed May 4, 2018
1 parent 8f9c1d4 commit d29317c3b2854dabc262b77f64b1911f4506430e
Showing with 4 additions and 10 deletions.
  1. +4 −10 src/providers/oracle/ocispatial/qsql_ocispatial.cpp
@@ -2402,19 +2402,13 @@ bool QOCISpatialCols::convertToWkb( QVariant &v, int index )
return false;
}

if ( iType == gtPoint && nElems == 0 )
if ( iType == gtPoint &&
sdoind->_atomic == OCI_IND_NOTNULL &&
sdoind->point.x == OCI_IND_NOTNULL &&
sdoind->point.y == OCI_IND_NOTNULL )
{
Q_ASSERT( nOrds == 0 );

if ( sdoind->_atomic != OCI_IND_NOTNULL ||
sdoind->point.x != OCI_IND_NOTNULL ||
sdoind->point.y != OCI_IND_NOTNULL )
{
qDebug() << "null point";
v = QVariant();
return true;
}

double x, y, z = 0.0;
if ( !getValue( &sdoobj->point.x, x ) )
{

0 comments on commit d29317c

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