/ Make a Json array from values coming from rows. */ /
| 2888 | /* Make a Json array from values coming from rows. */ |
| 2889 | /*********************************************************************************/ |
| 2890 | my_bool bson_array_grp_init(UDF_INIT *initid, UDF_ARGS *args, char *message) |
| 2891 | { |
| 2892 | unsigned long reslen, memlen, n = GetJsonGroupSize(); |
| 2893 | |
| 2894 | if (args->arg_count != 1) { |
| 2895 | strcpy(message, "This function can only accept 1 argument"); |
| 2896 | return true; |
| 2897 | } else if (IsArgJson(args, 0) == 3) { |
| 2898 | strcpy(message, "This function does not support Jbin arguments"); |
| 2899 | return true; |
| 2900 | } else |
| 2901 | CalcLen(args, false, reslen, memlen); |
| 2902 | |
| 2903 | reslen *= n; |
| 2904 | memlen += ((memlen - MEMFIX) * (n - 1)); |
| 2905 | |
| 2906 | if (JsonInit(initid, args, message, false, reslen, memlen)) |
| 2907 | return true; |
| 2908 | |
| 2909 | PGLOBAL g = (PGLOBAL)initid->ptr; |
| 2910 | (void) new(g) BJNX(g); |
| 2911 | |
| 2912 | JsonMemSave(g); |
| 2913 | return false; |
| 2914 | } // end of bson_array_grp_init |
| 2915 | |
| 2916 | void bson_array_grp_clear(UDF_INIT *initid, uchar *, uchar *) |
| 2917 | { |
no test coverage detected