diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2020-11-21 21:52:48 +0100 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2020-11-21 21:52:48 +0100 |
commit | 477b5256ddca1431b94aad7bc78e339ee399e5bb (patch) | |
tree | d9ebfdec721be7de3526d3e45e5d4f36d6e39a4c /storage/connect/tabjson.cpp | |
parent | 038381e110c4cb03d79839f5672299a22bbc1489 (diff) | |
download | mariadb-git-477b5256ddca1431b94aad7bc78e339ee399e5bb.tar.gz |
Fix some test failure
Diffstat (limited to 'storage/connect/tabjson.cpp')
-rw-r--r-- | storage/connect/tabjson.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index d5aa1be892d..a9aeadd7bf4 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -46,7 +46,7 @@ /* This should be an option. */ /***********************************************************************/ #define MAXCOL 200 /* Default max column nb in result */ -#define TYPE_UNKNOWN 12 /* Must be greater than other types */ +//#define TYPE_UNKNOWN 12 /* Must be greater than other types */ /***********************************************************************/ /* External functions. */ @@ -114,7 +114,7 @@ PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info) /*********************************************************************/ for (i = 0, jcp = pjdc->fjcp; jcp; i++, jcp = jcp->Next) { if (jcp->Type == TYPE_UNKNOWN) - jcp->Type = TYPE_STRING; // Void column + jcp->Type = TYPE_STRG; // Void column crp = qrp->Colresp; // Column Name crp->Kdata->SetValue(jcp->Name, i); @@ -395,7 +395,7 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j) PJAR jar; if (jvp && jvp->DataType != TYPE_JSON) { - if (JsonAllPath() && !fmt[bf]) + if (JsonAllPath() && !fmt[bf]) strcat(fmt, colname); jcol.Type = jvp->DataType; @@ -506,7 +506,7 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j) } else if (JsonAllPath() && !fmt[bf]) strcat(fmt, colname); - jcol.Type = TYPE_STRING; + jcol.Type = TYPE_STRG; jcol.Len = sz; jcol.Scale = 0; jcol.Cbn = true; @@ -528,23 +528,23 @@ void JSONDISC::AddColumn(PGLOBAL g) if (jcp) { if (jcp->Type != jcol.Type) { - if (jcp->Type == TYPE_UNKNOWN || jcol.Type == TYPE_VOID) + if (jcp->Type == TYPE_UNKNOWN || jcp->Type == TYPE_NULL) jcp->Type = jcol.Type; // else if (jcol.Type != TYPE_UNKNOWN && jcol.Type != TYPE_VOID) // jcp->Type = TYPE_STRING; - else if (jcp->Type != TYPE_STRING) + else if (jcp->Type != TYPE_STRG) switch (jcol.Type) { - case TYPE_STRING: - case TYPE_DOUBLE: + case TYPE_STRG: + case TYPE_DBL: jcp->Type = jcol.Type; break; - case TYPE_BIGINT: - if (jcp->Type == TYPE_INT || jcp->Type == TYPE_TINY) + case TYPE_BINT: + if (jcp->Type == TYPE_INTG || jcp->Type == TYPE_BOOL) jcp->Type = jcol.Type; break; - case TYPE_INT: - if (jcp->Type == TYPE_TINY) + case TYPE_INTG: + if (jcp->Type == TYPE_BOOL) jcp->Type = jcol.Type; break; |