/ Make a Json array from values coming from rows. */ /
| 3179 | /* Make a Json array from values coming from rows. */ |
| 3180 | /*********************************************************************************/ |
| 3181 | my_bool json_array_grp_init(UDF_INIT *initid, UDF_ARGS *args, char *message) |
| 3182 | { |
| 3183 | unsigned long reslen, memlen, n = GetJsonGroupSize(); |
| 3184 | |
| 3185 | if (args->arg_count != 1) { |
| 3186 | strcpy(message, "This function can only accept 1 argument"); |
| 3187 | return true; |
| 3188 | } else if (IsJson(args, 0) == 3) { |
| 3189 | strcpy(message, "This function does not support Jbin arguments"); |
| 3190 | return true; |
| 3191 | } else |
| 3192 | CalcLen(args, false, reslen, memlen); |
| 3193 | |
| 3194 | reslen *= n; |
| 3195 | memlen += ((memlen - MEMFIX) * (n - 1)); |
| 3196 | |
| 3197 | if (JsonInit(initid, args, message, false, reslen, memlen)) |
| 3198 | return true; |
| 3199 | |
| 3200 | PGLOBAL g = (PGLOBAL)initid->ptr; |
| 3201 | |
| 3202 | PlugSubSet(g->Sarea, g->Sarea_Size); |
| 3203 | g->Activityp = (PACTIVITY)JsonNew(g, TYPE_JAR); |
| 3204 | g->N = (int)n; |
| 3205 | return false; |
| 3206 | } // end of json_array_grp_init |
| 3207 | |
| 3208 | void json_array_grp_add(UDF_INIT *initid, UDF_ARGS *args, uchar *, uchar *) |
| 3209 | { |
nothing calls this directly
no test coverage detected