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

- Fix bug returning pointer to a stack string

in JVALUE::GetString
  modified:   storage/connect/json.cpp
  modified:   storage/connect/json.h
  modified:   storage/connect/jsonudf.cpp

- Fix a compiler bug happening on some configuration and platforms
  in JSNX::CalculateArray
  modified:   storage/connect/jsonudf.cpp

- Set default Schema as current directory
  This fix several bugs like:
    Fail to make JSON catalog tables
    Fail to use zipped file made by a file LOAD
  modified:   storage/connect/reldef.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
This commit is contained in:
Olivier Bertrand
2017-08-07 16:24:53 +02:00
parent f5b0993bbd
commit cdf00b8d92
6 changed files with 65 additions and 38 deletions

View File

@@ -500,7 +500,7 @@ JSONDEF::JSONDEF(void)
Sep = '.';
#if defined(MONGO_SUPPORT)
Uri = NULL;
Collname = Schema = Options = Filter = NULL;
Collname = Options = Filter = NULL;
Pipe = false;
Driver = NULL;
Version = 0;
@@ -515,7 +515,8 @@ JSONDEF::JSONDEF(void)
/***********************************************************************/
bool JSONDEF::DefineAM(PGLOBAL g, LPCSTR, int poff)
{
Jmode = (JMODE)GetIntCatInfo("Jmode", MODE_OBJECT);
Schema = GetStringCatInfo(g, "DBname", Schema);
Jmode = (JMODE)GetIntCatInfo("Jmode", MODE_OBJECT);
Objname = GetStringCatInfo(g, "Object", NULL);
Xcol = GetStringCatInfo(g, "Expand", NULL);
Pretty = GetIntCatInfo("Pretty", 2);
@@ -528,7 +529,6 @@ bool JSONDEF::DefineAM(PGLOBAL g, LPCSTR, int poff)
Collname = GetStringCatInfo(g, "Name",
(Catfunc & (FNC_TABLE | FNC_COL)) ? NULL : Name);
Collname = GetStringCatInfo(g, "Tabname", Collname);
Schema = GetStringCatInfo(g, "Dbname", "test");
Options = GetStringCatInfo(g, "Colist", NULL);
Filter = GetStringCatInfo(g, "Filter", NULL);
Pipe = GetBoolCatInfo("Pipeline", false);
@@ -2278,11 +2278,7 @@ void TDBJSON::CloseDB(PGLOBAL g)
TDBJCL::TDBJCL(PJDEF tdp) : TDBCAT(tdp)
{
Topt = tdp->GetTopt();
#if defined(MONGO_SUPPORT)
Db = tdp->Schema;
#else
Db = NULL;
#endif
Dsn = tdp->Uri;
} // end of TDBJCL constructor