Skip to content

Commit

Permalink
Merge pull request #4532 from unicolet/oraclespatial_pagingfix
Browse files Browse the repository at this point in the history
Oracle and queryByAttributes doesn't run (#4417), patch by Benedikt Rothe
Merging: confirmed by Benedikt
  • Loading branch information
unicolet committed Dec 12, 2012
2 parents 8758578 + 8f66815 commit 760b60e
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions maporaclespatial.c
Original file line number Diff line number Diff line change
Expand Up @@ -2153,15 +2153,14 @@ int msOracleSpatialLayerNextShape( layerObj *layer, shapeObj *shape )
&& TRY( hand, OCIAttrGet( (dvoid *)sthand->stmthp, (ub4)OCI_HTYPE_STMT, (dvoid *)&sthand->rows_fetched, (ub4 *)0, (ub4)OCI_ATTR_ROWS_FETCHED, hand->errhp ) )
&& TRY( hand, OCIAttrGet( (dvoid *)sthand->stmthp, (ub4)OCI_HTYPE_STMT, (dvoid *)&sthand->rows_count, (ub4 *)0, (ub4)OCI_ATTR_ROW_COUNT, hand->errhp ) );


if (!success || sthand->rows_fetched == 0 || sthand->row_num >= sthand->rows_count) {
hand->last_oci_status=MS_SUCCESS;
return MS_DONE;
}
if(layer->debug >= 4 )
msDebug("msOracleSpatialLayerNextShape on layer %p, Fetched %d more rows (%d total)\n", layer, sthand->rows_fetched, sthand->rows_count);

if (sthand->row_num >= sthand->rows_count)
return MS_DONE;

if (!success || sthand->rows_fetched == 0)
return MS_DONE;

sthand->row = 0; /* reset buffer row index */
}

Expand Down Expand Up @@ -3156,11 +3155,10 @@ int msOracleSpatialLayerGetExtent(layerObj *layer, rectObj *extent)
success = TRY( hand, OCIStmtFetch( sthand->stmthp, hand->errhp, (ub4)ARRAY_SIZE, (ub2)OCI_FETCH_NEXT, (ub4)OCI_DEFAULT ) )
&& TRY( hand, OCIAttrGet( (dvoid *)sthand->stmthp, (ub4)OCI_HTYPE_STMT, (dvoid *)&sthand->rows_fetched, (ub4 *)0, (ub4)OCI_ATTR_ROW_COUNT, hand->errhp ) );

if (!success || sthand->rows_fetched == 0)
break;

if (sthand->row_num >= sthand->rows_fetched)
if (!success || sthand->rows_fetched == 0 || sthand->row_num >= sthand->rows_fetched) {
hand->last_oci_status=MS_SUCCESS;
break;
}

sthand->row = 0; /* reset row index */
}
Expand Down

0 comments on commit 760b60e

Please sign in to comment.