| 1976 | } // end of bsonvalue_init |
| 1977 | |
| 1978 | char* bsonvalue(UDF_INIT* initid, UDF_ARGS* args, char* result, |
| 1979 | unsigned long* res_length, uchar *, uchar *) |
| 1980 | { |
| 1981 | char *str; |
| 1982 | PGLOBAL g = (PGLOBAL)initid->ptr; |
| 1983 | |
| 1984 | if (!g->Xchk) { |
| 1985 | if (!CheckMemory(g, initid, args, 1, false)) { |
| 1986 | BJNX bnx(g); |
| 1987 | PBVAL bvp = bnx.MakeValue(args, 0, true); |
| 1988 | |
| 1989 | if (!(str = bnx.Serialize(g, bvp, NULL, 0))) |
| 1990 | str = strcpy(result, g->Message); |
| 1991 | |
| 1992 | } else |
| 1993 | str = strcpy(result, g->Message); |
| 1994 | |
| 1995 | // Keep result of constant function |
| 1996 | g->Xchk = (initid->const_item) ? str : NULL; |
| 1997 | } else |
| 1998 | str = (char*)g->Xchk; |
| 1999 | |
| 2000 | *res_length = strlen(str); |
| 2001 | return str; |
| 2002 | } // end of bsonValue |
| 2003 | |
| 2004 | void bsonvalue_deinit(UDF_INIT* initid) { |
| 2005 | JsonFreeMem((PGLOBAL)initid->ptr); |
nothing calls this directly
no test coverage detected