Permalink
Browse files

Add OCI_THREADED to OciEnvCreate flags and fix some warning

  • Loading branch information...
1 parent e1e319e commit b924dc5ec132b6618cc91adf11e32158be13074a @unicolet unicolet committed Aug 14, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 maporaclespatial.c
View
@@ -279,7 +279,7 @@ static int ERROR( char *routine, msOracleSpatialHandler *hand, msOracleSpatialDa
{
if (hand->last_oci_status == MS_FAILURE) {
/* there was an error */
- msSetError( MS_ORACLESPATIALERR, (char *)hand->last_oci_error, routine );
+ msSetError( MS_ORACLESPATIALERR, "%s", routine, (char *)hand->last_oci_error);
/* reset error flag */
hand->last_oci_status = MS_SUCCESS;
@@ -598,7 +598,7 @@ static msOracleSpatialHandler *msOCISetHandlers( char *username, char *password,
success = TRY( hand,
/* allocate envhp */
- OCIEnvCreate( &hand->envhp, OCI_OBJECT, (dvoid *)0, 0, 0, 0, (size_t) 0, (dvoid **)0 ) )
+ OCIEnvCreate( &hand->envhp, OCI_OBJECT|OCI_THREADED, (dvoid *)0, 0, 0, 0, (size_t) 0, (dvoid **)0 ) )
&& TRY( hand,
/* allocate errhp */
OCIHandleAlloc( (dvoid *)hand->envhp, (dvoid **)&hand->errhp, (ub4)OCI_HTYPE_ERROR, (size_t)0, (dvoid **)0 ) )
@@ -2248,14 +2248,14 @@ int msOracleSpatialLayerGetShape( layerObj *layer, shapeObj *shape, resultObj *r
if (resultindex >= sthand->rows_count) {
if (layer->debug >= 5)
- msDebug("msOracleSpatialLayerGetShape problem with cursor. Trying to fetch record = %ld of %ld, falling back to GetShape\n", resultindex, sthand->rows_count);
+ msDebug("msOracleSpatialLayerGetShape problem with cursor. Trying to fetch record = %d of %d, falling back to GetShape\n", resultindex, sthand->rows_count);
msSetError( MS_ORACLESPATIALERR, "msOracleSpatialLayerGetShape record out of range","msOracleSpatialLayerGetShape()" );
return MS_FAILURE;
}
if (layer->debug >= 5)
- msDebug("msOracleSpatialLayerGetShape was called. Using the record = %ld of %ld. (shape: %ld should equal pkey: %ld)\n",
+ msDebug("msOracleSpatialLayerGetShape was called. Using the record = %d of %d. (shape: %ld should equal pkey: %ld)\n",
resultindex, layer->resultcache->numresults, layer->resultcache->results[resultindex].shapeindex, shapeindex);
/* NOTE: with the way the resultcache works, we should see items in increasing order, but some may have been filtered out. */
@@ -2269,7 +2269,7 @@ int msOracleSpatialLayerGetShape( layerObj *layer, shapeObj *shape, resultObj *r
sthand->row_num += resultindex - sthand->row_num;
} else { /* Item is not in buffer. Fetch item from Oracle */
if (layer->debug >= 4)
- msDebug("msOracleSpatialLayerGetShape: Fetching result from DB start: %ld end:%ld record: %ld\n", buffer_first_row_num, buffer_last_row_num, resultindex);
+ msDebug("msOracleSpatialLayerGetShape: Fetching result from DB start: %ld end:%ld record: %d\n", buffer_first_row_num, buffer_last_row_num, resultindex);
success = TRY( hand, OCIStmtFetch2( sthand->stmthp, hand->errhp, (ub4)ARRAY_SIZE, (ub2)OCI_FETCH_ABSOLUTE, (sb4)resultindex+1, (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 ) );

0 comments on commit b924dc5

Please sign in to comment.