summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2017-05-12 00:33:33 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2017-05-12 00:33:33 +0200
commit436070c6e106d22f2afce3a28fc15e33a2241ef9 (patch)
treea5404c0419e49a410733dc96406e81445c7ce448
parent1c88b9a8d3200bdf554ece09316cacf2146877ee (diff)
downloadmariadb-git-436070c6e106d22f2afce3a28fc15e33a2241ef9.tar.gz
Fix failing test connect.json for MariaDB 10.0
Suppressing Uri and dsn from json tables (was MGO) modified: storage/connect/ha_connect.cc modified: storage/connect/tabdos.cpp modified: storage/connect/tabjson.cpp modified: storage/connect/tabjson.h
-rw-r--r--storage/connect/ha_connect.cc8
-rw-r--r--storage/connect/tabdos.cpp2
-rw-r--r--storage/connect/tabjson.cpp9
-rw-r--r--storage/connect/tabjson.h3
4 files changed, 8 insertions, 14 deletions
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 240625d03fb..d20fa05a463 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -209,7 +209,7 @@ pthread_mutex_t parmut = PTHREAD_MUTEX_INITIALIZER;
/***********************************************************************/
PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info);
PQRYRES VirColumns(PGLOBAL g, bool info);
-PQRYRES JSONColumns(PGLOBAL g, char *db, char *dsn, PTOS topt, bool info);
+PQRYRES JSONColumns(PGLOBAL g, char *db, PTOS topt, bool info);
PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info);
int TranslateJDBCType(int stp, char *tn, int prec, int& len, char& v);
void PushWarning(PGLOBAL g, THD *thd, int level);
@@ -5557,9 +5557,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
case TAB_XML:
#endif // LIBXML2_SUPPORT || DOMDOC_SUPPORT
case TAB_JSON:
- dsn = strz(g, create_info->connect_string);
-
- if (!fn && !zfn && !mul && !dsn)
+ if (!fn && !zfn && !mul)
sprintf(g->Message, "Missing %s file name", topt->type);
else
ok = true;
@@ -5705,7 +5703,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
qrp = VirColumns(g, fnc == FNC_COL);
break;
case TAB_JSON:
- qrp = JSONColumns(g, (char*)db, dsn, topt, fnc == FNC_COL);
+ qrp = JSONColumns(g, (char*)db, topt, fnc == FNC_COL);
break;
#if defined(LIBXML2_SUPPORT) || defined(DOMDOC_SUPPORT)
case TAB_XML:
diff --git a/storage/connect/tabdos.cpp b/storage/connect/tabdos.cpp
index 6f95eafe838..87925161320 100644
--- a/storage/connect/tabdos.cpp
+++ b/storage/connect/tabdos.cpp
@@ -132,7 +132,6 @@ bool DOSDEF::DefineAM(PGLOBAL g, LPCSTR am, int)
bool map = (am && (*am == 'M' || *am == 'm'));
LPCSTR dfm = (am && (*am == 'F' || *am == 'f')) ? "F"
: (am && (*am == 'B' || *am == 'b')) ? "B"
- : (am && (*am == 'X' || *am == 'x')) ? "X"
: (am && !stricmp(am, "DBF")) ? "D" : "V";
if ((Zipped = GetBoolCatInfo("Zipped", false))) {
@@ -149,7 +148,6 @@ bool DOSDEF::DefineAM(PGLOBAL g, LPCSTR am, int)
GetCharCatInfo("Recfm", (PSZ)dfm, buf, sizeof(buf));
Recfm = (toupper(*buf) == 'F') ? RECFM_FIX :
(toupper(*buf) == 'B') ? RECFM_BIN :
- (toupper(*buf) == 'X') ? RECFM_NAF : // MGO
(toupper(*buf) == 'D') ? RECFM_DBF : RECFM_VAR;
Lrecl = GetIntCatInfo("Lrecl", 0);
diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp
index edfe710bc92..5853425a4e5 100644
--- a/storage/connect/tabjson.cpp
+++ b/storage/connect/tabjson.cpp
@@ -63,7 +63,7 @@ typedef struct _jncol {
/* JSONColumns: construct the result blocks containing the description */
/* of all the columns of a table contained inside a JSON file. */
/***********************************************************************/
-PQRYRES JSONColumns(PGLOBAL g, char *db, char *dsn, PTOS topt, bool info)
+PQRYRES JSONColumns(PGLOBAL g, char *db, PTOS topt, bool info)
{
static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING, TYPE_INT,
TYPE_INT, TYPE_SHORT, TYPE_SHORT, TYPE_STRING};
@@ -112,7 +112,7 @@ PQRYRES JSONColumns(PGLOBAL g, char *db, char *dsn, PTOS topt, bool info)
#endif // ZIP_SUPPORT
tdp->Fn = GetStringTableOption(g, topt, "Filename", NULL);
- if (!tdp->Fn && !dsn) {
+ if (!tdp->Fn) {
strcpy(g->Message, MSG(MISSING_FNAME));
return NULL;
} // endif Fn
@@ -424,7 +424,7 @@ bool JSONDEF::DefineAM(PGLOBAL g, LPCSTR, int poff)
Pretty = GetIntCatInfo("Pretty", 2);
Limit = GetIntCatInfo("Limit", 10);
Base = GetIntCatInfo("Base", 0) ? 1 : 0;
- return DOSDEF::DefineAM(g, (Uri ? "XMGO" : "DOS"), poff);
+ return DOSDEF::DefineAM(g, "DOS", poff);
} // end of DefineAM
/***********************************************************************/
@@ -2048,7 +2048,6 @@ TDBJCL::TDBJCL(PJDEF tdp) : TDBCAT(tdp)
{
Topt = tdp->GetTopt();
Db = (char*)tdp->GetDB();
- Dsn = (char*)tdp->Uri;
} // end of TDBJCL constructor
/***********************************************************************/
@@ -2056,7 +2055,7 @@ TDBJCL::TDBJCL(PJDEF tdp) : TDBCAT(tdp)
/***********************************************************************/
PQRYRES TDBJCL::GetResult(PGLOBAL g)
{
- return JSONColumns(g, Db, Dsn, Topt, false);
+ return JSONColumns(g, Db, Topt, false);
} // end of GetResult
/* --------------------------- End of json --------------------------- */
diff --git a/storage/connect/tabjson.h b/storage/connect/tabjson.h
index 2c8f226b5ca..c16cf6846b6 100644
--- a/storage/connect/tabjson.h
+++ b/storage/connect/tabjson.h
@@ -36,7 +36,7 @@ class DllExport JSONDEF : public DOSDEF { /* Table description */
friend class TDBJSON;
friend class TDBJSN;
friend class TDBJCL;
- friend PQRYRES JSONColumns(PGLOBAL, char*, char*, PTOS, bool);
+ friend PQRYRES JSONColumns(PGLOBAL, char*, PTOS, bool);
public:
// Constructor
JSONDEF(void);
@@ -58,7 +58,6 @@ public:
int Level; /* Used for catalog table */
int Base; /* The array index base */
bool Strict; /* Strict syntax checking */
- const char *Uri; /* MongoDB connection URI */
}; // end of JSONDEF
/* -------------------------- TDBJSN class --------------------------- */