diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index be64ca7163f..af6bb5374a4 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -38,7 +38,7 @@ user_connect.h valblk.h value.h xindex.h xobject.h xtable.h) # Definitions that are shared for all OSes # add_definitions( -DMARIADB -DFORCE_INIT_OF_VARS -Dconnect_EXPORTS) -add_definitions( -DHUGE_SUPPORT -DGZ_SUPPORT -DPIVOT_SUPPORT ) +add_definitions( -DNEW_MAR -DHUGE_SUPPORT -DGZ_SUPPORT -DPIVOT_SUPPORT ) # diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 843a12f08ad..ab718878da9 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -180,6 +180,10 @@ extern "C" { #endif // !__WIN__ } // extern "C" +#if defined(NEW_MAR) +#define stored_in_db stored_in_db() +#endif // NEW_MAR) + #if defined(XMAP) my_bool xmap= false; #endif // XMAP @@ -1559,7 +1563,7 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) pcf->Flags |= U_NULLS; // Mark virtual columns as such - if (fp->vcol_info && !fp->stored_in_db()) + if (fp->vcol_info && !fp->stored_in_db) pcf->Flags |= U_VIRTUAL; pcf->Key= 0; // Not used when called from MySQL @@ -2055,7 +2059,7 @@ int ha_connect::MakeRecord(char *buf) for (field= table->field; *field && !rc; field++) { fp= *field; - if (fp->vcol_info && !fp->stored_in_db()) + if (fp->vcol_info && !fp->stored_in_db) continue; // This is a virtual column if (bitmap_is_set(map, fp->field_index) || alter) { @@ -2176,7 +2180,7 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *) for (Field **field=table->field ; *field ; field++) { fp= *field; - if ((fp->vcol_info && !fp->stored_in_db()) || + if ((fp->vcol_info && !fp->stored_in_db) || fp->option_struct->special) continue; // Is a virtual column possible here ??? @@ -5359,14 +5363,13 @@ static int connect_assisted_discovery(handlerton *, THD* thd, bool cnc= false; int cto= -1, qto= -1; #endif // ODBC_SUPPORT +#if defined(JDBC_SUPPORT) || defined(MONGO_SUPPORT) #if defined(JDBC_SUPPORT) PJPARM sjp= NULL; #endif // JDBC_SUPPORT -#if defined(MONGO_SUPPORT) PCSZ driver= NULL; char *url= NULL; -//char *prop= NULL; -#endif // MONGO_SUPPORT +#endif // JDBC_SUPPORT || MONGO_SUPPORT uint tm, fnc= FNC_NO, supfnc= (FNC_NO | FNC_COL); bool bif, ok= false, dbf= false; TABTYPE ttp= TAB_UNDEF; @@ -6339,7 +6342,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, for (field= table_arg->field; *field; field++) { fp= *field; - if (fp->vcol_info && !fp->stored_in_db()) + if (fp->vcol_info && !fp->stored_in_db) continue; // This is a virtual column if (fp->flags & AUTO_INCREMENT_FLAG) { diff --git a/storage/connect/mysql-test/connect/r/tbl_thread.result b/storage/connect/mysql-test/connect/r/tbl_thread.result index dc54da0b675..32602e3fbe4 100644 --- a/storage/connect/mysql-test/connect/r/tbl_thread.result +++ b/storage/connect/mysql-test/connect/r/tbl_thread.result @@ -75,7 +75,7 @@ DROP TABLE rt3; connection default; DROP TABLE t1,t2,t3,total; # -# Old thread TBL tables test +# Old thread TBL tables test modified # CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 11 as v' OPTION_LIST='port=MASTER_PORT'; SELECT * FROM t1; @@ -90,6 +90,23 @@ SELECT * FROM total order by v desc; v 22 11 +DROP TABLE t1,t2,total; +# +# Old thread TBL tables test not modified +# +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 11 as v'; +SELECT * FROM t1; +v +11 +CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 22 as v'; +SELECT * FROM t2; +v +22 +CREATE TABLE total (v BIGINT(20) UNSIGNED NOT NULL) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2' OPTION_LIST='thread=yes,port=PORT';; +SELECT * FROM total order by v desc; +v +22 +11 DROP TABLE total; DROP TABLE t1; DROP TABLE t2; diff --git a/storage/connect/mysql-test/connect/std_data/Mongo3.jar b/storage/connect/mysql-test/connect/std_data/Mongo3.jar index 21c6c2d10bd..73eb3571290 100644 Binary files a/storage/connect/mysql-test/connect/std_data/Mongo3.jar and b/storage/connect/mysql-test/connect/std_data/Mongo3.jar differ diff --git a/storage/connect/mysql-test/connect/t/tbl_thread.test b/storage/connect/mysql-test/connect/t/tbl_thread.test index c6f09c71d90..233d4149507 100644 --- a/storage/connect/mysql-test/connect/t/tbl_thread.test +++ b/storage/connect/mysql-test/connect/t/tbl_thread.test @@ -54,7 +54,7 @@ connection default; DROP TABLE t1,t2,t3,total; --echo # ---echo # Old thread TBL tables test +--echo # Old thread TBL tables test modified --echo # --replace_result $MASTER_MYPORT MASTER_PORT --eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 11 as v' OPTION_LIST='port=$MASTER_MYPORT' @@ -64,6 +64,20 @@ SELECT * FROM t1; --eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 22 as v' OPTION_LIST='port=$SLAVE_MYPORT' SELECT * FROM t2; +--replace_result $PORT PORT +--eval CREATE TABLE total (v BIGINT(20) UNSIGNED NOT NULL) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2' OPTION_LIST='thread=yes,port=$PORT'; +SELECT * FROM total order by v desc; +DROP TABLE t1,t2,total; + +--echo # +--echo # Old thread TBL tables test not modified +--echo # +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 11 as v'; +SELECT * FROM t1; + +CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 22 as v'; +SELECT * FROM t2; + --replace_result $PORT PORT --eval CREATE TABLE total (v BIGINT(20) UNSIGNED NOT NULL) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2' OPTION_LIST='thread=yes,port=$PORT'; SELECT * FROM total order by v desc; diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index 655cef18de3..5c79e62b514 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -31,11 +31,13 @@ #if defined(ZIP_SUPPORT) #include "filamzip.h" #endif // ZIP_SUPPORT +#if defined(MONGO_SUPPORT) #if defined(JDBC_SUPPORT) #include "jmgfam.h" #endif // JDBC_SUPPORT #if defined(CMGO_SUPPORT) #include "cmgfam.h" +#endif // CMGO_SUPPORT #endif // MONGO_SUPPORT #include "tabmul.h" #include "checklvl.h" @@ -129,8 +131,8 @@ PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info) #endif // ZIP_SUPPORT tdp->Fn = GetStringTableOption(g, topt, "Filename", NULL); -//if (!(tdp->Database = SetPath(g, db))) -// return NULL; + if (!(tdp->Database = SetPath(g, db))) + return NULL; tdp->Objname = GetStringTableOption(g, topt, "Object", NULL); tdp->Base = GetIntegerTableOption(g, topt, "Base", 0) ? 1 : 0; @@ -502,10 +504,10 @@ JSONDEF::JSONDEF(void) Pipe = false; Driver = NULL; Version = 0; -#endif // MONGO_SUPPORT #if defined(JDBC_SUPPORT) Wrapname = NULL; #endif // JDBC_SUPPORT +#endif // MONGO_SUPPORT } // end of JSONDEF constructor /***********************************************************************/ diff --git a/storage/connect/tabjson.h b/storage/connect/tabjson.h index 5b5aaca7941..eec1f0e355e 100644 --- a/storage/connect/tabjson.h +++ b/storage/connect/tabjson.h @@ -37,7 +37,9 @@ class DllExport JSONDEF : public DOSDEF { /* Table description */ friend class TDBJSN; friend class TDBJCL; #if defined(MONGO_SUPPORT) +#if defined(CMGO_SUPPORT) friend class CMGFAM; +#endif // CMGO_SUPPORT #if defined(JDBC_SUPPORT) friend class JMGFAM; #endif // JDBC_SUPPORT @@ -90,7 +92,9 @@ class DllExport TDBJSN : public TDBDOS { friend class JSONCOL; friend class JSONDEF; #if defined(MONGO_SUPPORT) +#if defined(CMGO_SUPPORT) friend class CMGFAM; +#endif // CMGO_SUPPORT #if defined(JDBC_SUPPORT) friend class JMGFAM; #endif // JDBC_SUPPORT @@ -159,11 +163,13 @@ public: class DllExport JSONCOL : public DOSCOL { friend class TDBJSN; friend class TDBJSON; +#if defined(MONGO_SUPPORT) +#if defined(CMGO_SUPPORT) + friend class CMGFAM; +#endif // CMGO_SUPPORT #if defined(JDBC_SUPPORT) friend class JMGFAM; #endif // JDBC_SUPPORT -#if defined(MONGO_SUPPORT) - friend class CMGFAM; #endif // MONGO_SUPPORT public: // Constructors diff --git a/storage/connect/tabtbl.cpp b/storage/connect/tabtbl.cpp index 1be6ffcd957..b567e9aecd4 100644 --- a/storage/connect/tabtbl.cpp +++ b/storage/connect/tabtbl.cpp @@ -652,6 +652,7 @@ bool TDBTBM::OpenTables(PGLOBAL g) tp = (PTBMT)PlugSubAlloc(g, NULL, sizeof(TBMT)); memset(tp, 0, sizeof(TBMT)); tp->G = g; + tp->Ready = false; tp->Tap = tabp; tp->Thd = thd;