Commit b63f8477 authored by Olivier Bertrand's avatar Olivier Bertrand

- Suppress warning when creating mongo JSON tables

  modified:   storage/connect/ha_connect.cc

- Add catalog table for Mongo java driver tables
  modified:   storage/connect/mongo.cpp
  modified:   storage/connect/mongo.h
  modified:   storage/connect/tabjmg.cpp
  modified:   storage/connect/tabjmg.h
parent 94e5d7de
...@@ -6079,6 +6079,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -6079,6 +6079,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
TABTYPE type; TABTYPE type;
TABLE *st= table; // Probably unuseful TABLE *st= table; // Probably unuseful
THD *thd= ha_thd(); THD *thd= ha_thd();
LEX_STRING cnc = table_arg->s->connect_string;
#if defined(WITH_PARTITION_STORAGE_ENGINE) #if defined(WITH_PARTITION_STORAGE_ENGINE)
partition_info *part_info= table_arg->part_info; partition_info *part_info= table_arg->part_info;
#endif // WITH_PARTITION_STORAGE_ENGINE #endif // WITH_PARTITION_STORAGE_ENGINE
...@@ -6126,7 +6127,8 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -6126,7 +6127,8 @@ int ha_connect::create(const char *name, TABLE *table_arg,
if (check_privileges(thd, options, GetDBfromName(name))) if (check_privileges(thd, options, GetDBfromName(name)))
DBUG_RETURN(HA_ERR_INTERNAL_ERROR); DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
inward= IsFileType(type) && !options->filename; inward= IsFileType(type) && !options->filename &&
(type != TAB_JSON || !cnc.length);
if (options->data_charset) { if (options->data_charset) {
const CHARSET_INFO *data_charset; const CHARSET_INFO *data_charset;
...@@ -6223,7 +6225,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -6223,7 +6225,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
DBUG_RETURN(HA_ERR_INTERNAL_ERROR); DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
} // endif CheckSelf } // endif CheckSelf
}break; } break;
default: /* do nothing */; default: /* do nothing */;
break; break;
} // endswitch ttp } // endswitch ttp
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
//#if defined(__WIN__) //#if defined(__WIN__)
//extern "C" HINSTANCE s_hModule; // Saved module handle //extern "C" HINSTANCE s_hModule; // Saved module handle
//#endif // __WIN__ //#endif // __WIN__
//#define nullptr 0 #define nullptr 0
TYPCONV GetTypeConv(); TYPCONV GetTypeConv();
int GetConvSize(); int GetConvSize();
......
...@@ -81,8 +81,12 @@ PTDB MGODEF::GetTable(PGLOBAL g, MODE m) ...@@ -81,8 +81,12 @@ PTDB MGODEF::GetTable(PGLOBAL g, MODE m)
if (Driver && toupper(*Driver) == 'C') if (Driver && toupper(*Driver) == 'C')
return new(g)TDBGOL(this); return new(g)TDBGOL(this);
#endif // MONGO_SUPPORT #endif // MONGO_SUPPORT
strcpy(g->Message, "No column find for Java Mongo yet"); #if defined(JDBC_SUPPORT)
return new(g)TDBJGL(this);
#else // !JDBC_SUPPORT
strcpy(g->Message, "No column find, no MONGO nor Java support");
return NULL; return NULL;
#endif // !JDBC_SUPPORT
} // endif Catfunc } // endif Catfunc
#if defined(MONGO_SUPPORT) #if defined(MONGO_SUPPORT)
......
...@@ -32,6 +32,7 @@ class DllExport MGODEF : public EXTDEF { /* Table description */ ...@@ -32,6 +32,7 @@ class DllExport MGODEF : public EXTDEF { /* Table description */
friend class TDBMGO; friend class TDBMGO;
friend class TDBJMG; friend class TDBJMG;
friend class TDBGOL; friend class TDBGOL;
friend class TDBJGL;
friend class MGOFAM; friend class MGOFAM;
friend class MGODISC; friend class MGODISC;
friend PQRYRES MGOColumns(PGLOBAL, PCSZ, PCSZ, PTOS, bool); friend PQRYRES MGOColumns(PGLOBAL, PCSZ, PCSZ, PTOS, bool);
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#define MAXCOL 200 /* Default max column nb in result */ #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 */
PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info);
/* --------------------------- Class TDBJMG -------------------------- */ /* --------------------------- Class TDBJMG -------------------------- */
/***********************************************************************/ /***********************************************************************/
...@@ -481,25 +483,26 @@ bool JMGCOL::AddValue(PGLOBAL g, bson_t *doc, char *key, bool upd) ...@@ -481,25 +483,26 @@ bool JMGCOL::AddValue(PGLOBAL g, bson_t *doc, char *key, bool upd)
return false; return false;
} // end of AddValue } // end of AddValue
#endif // 0
/* ---------------------------TDBGOL class --------------------------- */ /* -------------------------- TDBJGL class --------------------------- */
/***********************************************************************/ /***********************************************************************/
/* TDBGOL class constructor. */ /* TDBJGL class constructor. */
/***********************************************************************/ /***********************************************************************/
TDBGOL::TDBGOL(PMGODEF tdp) : TDBCAT(tdp) TDBJGL::TDBJGL(PMGODEF tdp) : TDBCAT(tdp)
{ {
Topt = tdp->GetTopt(); Topt = tdp->GetTopt();
Db = (char*)tdp->GetTabschema(); Uri = tdp->Uri;
Db = tdp->GetTabschema();
} // end of TDBJCL constructor } // end of TDBJCL constructor
/***********************************************************************/ /***********************************************************************/
/* GetResult: Get the list the JSON file columns. */ /* GetResult: Get the list the JSON file columns. */
/***********************************************************************/ /***********************************************************************/
PQRYRES TDBGOL::GetResult(PGLOBAL g) PQRYRES TDBJGL::GetResult(PGLOBAL g)
{ {
return MGOColumns(g, Db, Topt, false); return JSONColumns(g, Db, Uri, Topt, false);
} // end of GetResult } // end of GetResult
#endif // 0
/* -------------------------- End of mongo --------------------------- */ /* -------------------------- End of mongo --------------------------- */
...@@ -102,21 +102,20 @@ class DllExport JMGCOL : public EXTCOL { ...@@ -102,21 +102,20 @@ class DllExport JMGCOL : public EXTCOL {
//char *Mbuf; // The Mini buffer //char *Mbuf; // The Mini buffer
}; // end of class JMGCOL }; // end of class JMGCOL
#if 0
/***********************************************************************/ /***********************************************************************/
/* This is the class declaration for the MONGO catalog table. */ /* This is the class declaration for the MONGO catalog table. */
/***********************************************************************/ /***********************************************************************/
class DllExport TDBGOL : public TDBCAT { class DllExport TDBJGL : public TDBCAT {
public: public:
// Constructor // Constructor
TDBGOL(PMGODEF tdp); TDBJGL(PMGODEF tdp);
protected: protected:
// Specific routines // Specific routines
virtual PQRYRES GetResult(PGLOBAL g); virtual PQRYRES GetResult(PGLOBAL g);
// Members // Members
PTOS Topt; PTOS Topt;
char *Db; PCSZ Uri;
PCSZ Db;
}; // end of class TDBGOL }; // end of class TDBGOL
#endif 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment