| 2113 | } // end of json_make_array_init |
| 2114 | |
| 2115 | char *json_make_array(UDF_INIT *initid, UDF_ARGS *args, char *result, |
| 2116 | unsigned long *res_length, uchar *, uchar *) |
| 2117 | { |
| 2118 | char *str; |
| 2119 | PGLOBAL g = (PGLOBAL)initid->ptr; |
| 2120 | |
| 2121 | if (!g->Xchk) { |
| 2122 | if (!CheckMemory(g, initid, args, args->arg_count, false)) { |
| 2123 | PJAR arp = new(g)JARRAY; |
| 2124 | |
| 2125 | for (uint i = 0; i < args->arg_count; i++) |
| 2126 | arp->AddArrayValue(g, MakeValue(g, args, i)); |
| 2127 | |
| 2128 | arp->InitArray(g); |
| 2129 | |
| 2130 | if (!(str = Serialize(g, arp, NULL, 0))) |
| 2131 | str = strcpy(result, g->Message); |
| 2132 | |
| 2133 | } else |
| 2134 | str = strcpy(result, g->Message); |
| 2135 | |
| 2136 | // Keep result of constant function |
| 2137 | g->Xchk = (initid->const_item) ? str : NULL; |
| 2138 | } else |
| 2139 | str = (char*)g->Xchk; |
| 2140 | |
| 2141 | *res_length = strlen(str); |
| 2142 | return str; |
| 2143 | } // end of json_make_array |
| 2144 | |
| 2145 | void json_make_array_deinit(UDF_INIT* initid) |
| 2146 | { |
nothing calls this directly
no test coverage detected