Skip to content

Commit d29317c

Browse files
rldhontnyalldawson
authored andcommittedMay 24, 2018
[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)
1 parent 8f9c1d4 commit d29317c

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed
 

‎src/providers/oracle/ocispatial/qsql_ocispatial.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2402,19 +2402,13 @@ bool QOCISpatialCols::convertToWkb( QVariant &v, int index )
24022402
return false;
24032403
}
24042404

2405-
if ( iType == gtPoint && nElems == 0 )
2405+
if ( iType == gtPoint &&
2406+
sdoind->_atomic == OCI_IND_NOTNULL &&
2407+
sdoind->point.x == OCI_IND_NOTNULL &&
2408+
sdoind->point.y == OCI_IND_NOTNULL )
24062409
{
24072410
Q_ASSERT( nOrds == 0 );
24082411

2409-
if ( sdoind->_atomic != OCI_IND_NOTNULL ||
2410-
sdoind->point.x != OCI_IND_NOTNULL ||
2411-
sdoind->point.y != OCI_IND_NOTNULL )
2412-
{
2413-
qDebug() << "null point";
2414-
v = QVariant();
2415-
return true;
2416-
}
2417-
24182412
double x, y, z = 0.0;
24192413
if ( !getValue( &sdoobj->point.x, x ) )
24202414
{

0 commit comments

Comments
 (0)
Please sign in to comment.