1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

- Make user variable prefix recognized by IsArgJson and IsJson

modified:   storage/connect/bsonudf.cpp
  modified:   storage/connect/jsonudf.cpp

- Stringify option is now a ; separated list of columns
  modified:   storage/connect/json.cpp
  modified:   storage/connect/json.h
  modified:   storage/connect/mongo.h
  modified:   storage/connect/tabbson.cpp
  modified:   storage/connect/tabcmg.cpp
  modified:   storage/connect/tabcmg.h
  modified:   storage/connect/tabjmg.cpp
  modified:   storage/connect/tabjmg.h
  modified:   storage/connect/tabjson.cpp

- PrepareColist not a static function anymore (+ typo)
  modified:   storage/connect/taboccur.cpp

- JDVC: Recognize schema (database) from a wrapper server
  modified:   storage/connect/tabjdbc.cpp
This commit is contained in:
Olivier Bertrand
2021-07-24 16:28:57 +02:00
parent 1c4b917f0e
commit 0f18135ec8
13 changed files with 111 additions and 61 deletions

View File

@@ -1889,24 +1889,31 @@ static int *GetIntArgPtr(PGLOBAL g, UDF_ARGS *args, uint& n)
/*********************************************************************************/
int IsArgJson(UDF_ARGS *args, uint i)
{
int n = 0;
char *pat = args->attributes[i];
int n = 0;
if (*pat == '@') {
pat++;
if (*pat == '\'' || *pat == '"')
pat++;
} // endif pat
if (i >= args->arg_count || args->arg_type[i] != STRING_RESULT) {
} else if (!strnicmp(args->attributes[i], "Bson_", 5) ||
!strnicmp(args->attributes[i], "Json_", 5)) {
} else if (!strnicmp(pat, "Bson_", 5) || !strnicmp(pat, "Json_", 5)) {
if (!args->args[i] || strchr("[{ \t\r\n", *args->args[i]))
n = 1; // arg should be is a json item
// else
// n = 2; // A file name may have been returned
} else if (!strnicmp(args->attributes[i], "Bbin_", 5)) {
} else if (!strnicmp(pat, "Bbin_", 5)) {
if (args->lengths[i] == sizeof(BSON))
n = 3; // arg is a binary json item
// else
// n = 2; // A file name may have been returned
} else if (!strnicmp(args->attributes[i], "Bfile_", 6) ||
!strnicmp(args->attributes[i], "Jfile_", 6)) {
} else if (!strnicmp(pat, "Bfile_", 6) || !strnicmp(pat, "Jfile_", 6)) {
n = 2; // arg is a json file name
#if 0
} else if (args->lengths[i]) {