MCPcopy Create free account
hub / github.com/MapServer/MapServer / TRY

Function TRY

maporaclespatial.c:225–264  ·  view source on GitHub ↗

if an error ocurred call msSetError, sets last_oci_status to MS_FAILURE and return 0; * otherwise returns 1 */

Source from the content-addressed store, hash-verified

223/* if an error ocurred call msSetError, sets last_oci_status to MS_FAILURE and return 0;
224 * otherwise returns 1 */
225static int TRY( msOracleSpatialHandler *hand, sword status )
226{
227 sb4 errcode = 0;
228
229 if (hand->last_oci_status == MS_FAILURE)
230 return 0; /* error from previous call */
231
232 switch (status)
233 {
234 case OCI_SUCCESS_WITH_INFO:
235 case OCI_ERROR:
236 OCIErrorGet((dvoid *)hand->errhp, (ub4)1, (text *)NULL, &errcode, hand->last_oci_error, (ub4)sizeof(hand->last_oci_error), OCI_HTYPE_ERROR );
237 if (errcode == NULLERRCODE)
238 {
239 hand->last_oci_error[0] = (text)'\0';
240 return 1;
241 }
242 hand->last_oci_error[sizeof(hand->last_oci_error)-1] = 0; /* terminate string!? */
243 break;
244 case OCI_NEED_DATA:
245 strlcpy( (char *)hand->last_oci_error, "OCI_NEED_DATA", sizeof(hand->last_oci_error));
246 break;
247 case OCI_INVALID_HANDLE:
248 strlcpy( (char *)hand->last_oci_error, "OCI_INVALID_HANDLE", sizeof(hand->last_oci_error));
249 break;
250 case OCI_STILL_EXECUTING:
251 ((char*)hand->last_oci_error)[sizeof(hand->last_oci_error)-1] = 0;
252 break;
253 case OCI_CONTINUE:
254 strlcpy( (char *)hand->last_oci_error, "OCI_CONTINUE", sizeof(hand->last_oci_error));
255 break;
256 default:
257 return 1; /* no error */
258 }
259
260 /* if I got here, there was an error */
261 hand->last_oci_status = MS_FAILURE;
262
263 return 0; /* error! */
264}
265
266OCIType *get_tdo(char *typename, msOracleSpatialHandler *hand, msOracleSpatialDataHandler *dthand )
267{

Callers 15

get_tdoFunction · 0.85
msOCIOpenStatementFunction · 0.85
msOCISetDataHandlersFunction · 0.85
msOCISetHandlersFunction · 0.85
msOCIGet2DOrdinatesFunction · 0.85
msOCIGet3DOrdinatesFunction · 0.85
msOCIGet4DOrdinatesFunction · 0.85
osGetOrdinatesFunction · 0.85

Calls 1

strlcpyFunction · 0.85

Tested by

no test coverage detected