| 2072 | } // end of jsonvalue_init |
| 2073 | |
| 2074 | char *jsonvalue(UDF_INIT *initid, UDF_ARGS *args, char *result, |
| 2075 | unsigned long *res_length, uchar *, uchar *) |
| 2076 | { |
| 2077 | char *str; |
| 2078 | PGLOBAL g = (PGLOBAL)initid->ptr; |
| 2079 | |
| 2080 | if (!g->Xchk) { |
| 2081 | if (!CheckMemory(g, initid, args, 1, false)) { |
| 2082 | PJVAL jvp = MakeValue(g, args, 0); |
| 2083 | |
| 2084 | if (!(str = Serialize(g, jvp, NULL, 0))) |
| 2085 | str = strcpy(result, g->Message); |
| 2086 | |
| 2087 | } else |
| 2088 | str = strcpy(result, g->Message); |
| 2089 | |
| 2090 | // Keep result of constant function |
| 2091 | g->Xchk = (initid->const_item) ? str : NULL; |
| 2092 | } else |
| 2093 | str = (char*)g->Xchk; |
| 2094 | |
| 2095 | *res_length = strlen(str); |
| 2096 | return str; |
| 2097 | } // end of JsonValue |
| 2098 | |
| 2099 | void jsonvalue_deinit(UDF_INIT* initid) |
| 2100 | { |
nothing calls this directly
no test coverage detected