MCPcopy Create free account
hub / github.com/MariaDB/server / GetIntArgPtr

Function GetIntArgPtr

storage/connect/jsonudf.cpp:1508–1527  ·  view source on GitHub ↗

/ Returns a pointer to the first integer argument found from the nth argument. */ /

Source from the content-addressed store, hash-verified

1506/* Returns a pointer to the first integer argument found from the nth argument. */
1507/*********************************************************************************/
1508static int *GetIntArgPtr(PGLOBAL g, UDF_ARGS *args, uint& n)
1509{
1510 int *x = NULL;
1511
1512 for (uint i = n; i < args->arg_count; i++)
1513 if (args->arg_type[i] == INT_RESULT) {
1514 if (args->args[i]) {
1515 if ((x = (int*)PlgDBSubAlloc(g, NULL, sizeof(int))))
1516 *x = (int)*(longlong*)args->args[i];
1517 else
1518 PUSH_WARNING(g->Message);
1519
1520 } // endif args
1521
1522 n = i + 1;
1523 break;
1524 } // endif arg_type
1525
1526 return x;
1527} // end of GetIntArgPtr
1528
1529/*********************************************************************************/
1530/* Returns not 0 if the argument is a JSON item or file name. */

Callers 4

json_array_addFunction · 0.70
json_array_deleteFunction · 0.70
jbin_array_addFunction · 0.70
jbin_array_deleteFunction · 0.70

Calls 1

PlgDBSubAllocFunction · 0.85

Tested by

no test coverage detected