Commit 0387c13e authored by Olivier Bertrand's avatar Olivier Bertrand

- Add a define making ha_connect.cc source unique for all MariaDB version.

#if defined(NEW_MAR)
#define stored_in_db stored_in_db()
#endif   // NEW_MAR)
  modified:   storage/connect/CMakeLists.txt
  modified:   storage/connect/ha_connect.cc

- Fix compile failure for some configuration of CONNECT.
This by updating the #ifdef's JDBC, MONGO and CMGO_SUPPORT.
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h

- Fix failure of zip.test (restore code wrongly deleted)
  modified:   storage/connect/tabjson.cpp

- Make sure thread TBL table structure is correctly initialized.
  modified:   storage/connect/tabtbl.cpp

- Add new test case in tbl_thread.test
  modified:   storage/connect/mysql-test/connect/r/tbl_thread.result
  modified:   storage/connect/mysql-test/connect/t/tbl_thread.test

- Remake a jar file after Java was updated
  modified:   storage/connect/mysql-test/connect/std_data/Mongo3.jar
parent d8f99f16
......@@ -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 )
#
......
......@@ -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) {
......
......@@ -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;
......
This diff was suppressed by a .gitattributes entry.
......@@ -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;
......
......@@ -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
/***********************************************************************/
......
......@@ -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 @@ class DllExport TDBJSN : public TDBDOS {
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
......
......@@ -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;
......
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