Skip to content

Commit

Permalink
check that we have reached last row before attempintg another fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
unicolet committed Aug 22, 2012
1 parent 5f9e272 commit bc4ccf0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions maporaclespatial.c
Expand Up @@ -2148,6 +2148,9 @@ int msOracleSpatialLayerNextShape( layerObj *layer, shapeObj *shape )
do {
/* is buffer empty? */
if (sthand->row >= sthand->rows_fetched) {
if (sthand->row_num >= sthand->rows_count)
return MS_DONE;

/* fetch more */
success = TRY( hand, OCIStmtFetch2( sthand->stmthp, hand->errhp, (ub4)ARRAY_SIZE, (ub2)OCI_FETCH_NEXT, (sb4)0, (ub4)OCI_DEFAULT ) )
&& TRY( hand, OCIAttrGet( (dvoid *)sthand->stmthp, (ub4)OCI_HTYPE_STMT, (dvoid *)&sthand->rows_fetched, (ub4 *)0, (ub4)OCI_ATTR_ROWS_FETCHED, hand->errhp ) )
Expand All @@ -2160,9 +2163,6 @@ int msOracleSpatialLayerNextShape( layerObj *layer, shapeObj *shape )
if (!success || sthand->rows_fetched == 0)
return MS_DONE;

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

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

Expand Down

3 comments on commit bc4ccf0

@regiodata
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our opinion this patch causes the loop to be finished too early.
We have experienced the problem with php-mapscript (php 5.3.3-7+squeeze14).
With mapserver-6.2.0-beta2 everything worked fine. However with mapserver-6.2.0-beta3 the resulting map image shows a subset of the expected objects.
So we rolled back this patch and everything worked fine again.

@unicolet
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it happen while using wfs? Could you open an issue and attach a small test case?

@regiodata
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see ticket #4508

Please sign in to comment.