if an error ocurred call msSetError, sets last_oci_status to MS_FAILURE and return 0; * otherwise returns 1 */
| 223 | /* if an error ocurred call msSetError, sets last_oci_status to MS_FAILURE and return 0; |
| 224 | * otherwise returns 1 */ |
| 225 | static 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 | |
| 266 | OCIType *get_tdo(char *typename, msOracleSpatialHandler *hand, msOracleSpatialDataHandler *dthand ) |
| 267 | { |
no test coverage detected