| 5430 | } // end of bbin_array_delete_init |
| 5431 | |
| 5432 | char *bbin_array_delete(UDF_INIT *initid, UDF_ARGS *args, char *result, |
| 5433 | unsigned long *res_length, uchar *is_null, uchar *error) |
| 5434 | { |
| 5435 | PGLOBAL g = (PGLOBAL)initid->ptr; |
| 5436 | PBSON bsp = NULL; |
| 5437 | |
| 5438 | if (g->Xchk) { |
| 5439 | // This constant function was recalled |
| 5440 | bsp = (PBSON)g->Xchk; |
| 5441 | } else if (!CheckMemory(g, initid, args, 1, false, false, true)) { |
| 5442 | int* x; |
| 5443 | uint n = 1; |
| 5444 | BJNX bnx(g); |
| 5445 | PBVAL arp, top; |
| 5446 | PBVAL jvp = bnx.MakeValue(args, 0, true, &top); |
| 5447 | |
| 5448 | if (!(x = GetIntArgPtr(g, args, n))) |
| 5449 | PUSH_WARNING("Missing or null array index"); |
| 5450 | else if (bnx.CheckPath(g, args, jvp, arp, 1)) |
| 5451 | PUSH_WARNING(g->Message); |
| 5452 | else if (arp && arp->Type == TYPE_JAR) { |
| 5453 | bnx.SetChanged(bnx.DeleteValue(arp, *x)); |
| 5454 | bsp = bnx.MakeBinResult(args, top, initid->max_length); |
| 5455 | } else { |
| 5456 | PUSH_WARNING("First argument target is not an array"); |
| 5457 | // if (g->Mrr) *error = 1; |
| 5458 | } // endif jvp |
| 5459 | |
| 5460 | if (g->N) |
| 5461 | // Keep result of constant function |
| 5462 | g->Xchk = bsp; |
| 5463 | |
| 5464 | } // endif CheckMemory |
| 5465 | |
| 5466 | if (!bsp) { |
| 5467 | *is_null = 1; |
| 5468 | *error = 1; |
| 5469 | *res_length = 0; |
| 5470 | } else |
| 5471 | *res_length = sizeof(BSON); |
| 5472 | |
| 5473 | return (char*)bsp; |
| 5474 | } // end of bbin_array_delete |
| 5475 | |
| 5476 | void bbin_array_delete_deinit(UDF_INIT* initid) |
| 5477 | { |
nothing calls this directly
no test coverage detected