mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
- 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
This commit is contained in:
@@ -38,7 +38,7 @@ user_connect.h valblk.h value.h xindex.h xobject.h xtable.h)
|
|||||||
# Definitions that are shared for all OSes
|
# Definitions that are shared for all OSes
|
||||||
#
|
#
|
||||||
add_definitions( -DMARIADB -DFORCE_INIT_OF_VARS -Dconnect_EXPORTS)
|
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__
|
#endif // !__WIN__
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
|
||||||
|
#if defined(NEW_MAR)
|
||||||
|
#define stored_in_db stored_in_db()
|
||||||
|
#endif // NEW_MAR)
|
||||||
|
|
||||||
#if defined(XMAP)
|
#if defined(XMAP)
|
||||||
my_bool xmap= false;
|
my_bool xmap= false;
|
||||||
#endif // XMAP
|
#endif // XMAP
|
||||||
@@ -1559,7 +1563,7 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf)
|
|||||||
pcf->Flags |= U_NULLS;
|
pcf->Flags |= U_NULLS;
|
||||||
|
|
||||||
// Mark virtual columns as such
|
// 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->Flags |= U_VIRTUAL;
|
||||||
|
|
||||||
pcf->Key= 0; // Not used when called from MySQL
|
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++) {
|
for (field= table->field; *field && !rc; field++) {
|
||||||
fp= *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
|
continue; // This is a virtual column
|
||||||
|
|
||||||
if (bitmap_is_set(map, fp->field_index) || alter) {
|
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++) {
|
for (Field **field=table->field ; *field ; field++) {
|
||||||
fp= *field;
|
fp= *field;
|
||||||
|
|
||||||
if ((fp->vcol_info && !fp->stored_in_db()) ||
|
if ((fp->vcol_info && !fp->stored_in_db) ||
|
||||||
fp->option_struct->special)
|
fp->option_struct->special)
|
||||||
continue; // Is a virtual column possible here ???
|
continue; // Is a virtual column possible here ???
|
||||||
|
|
||||||
@@ -5359,14 +5363,13 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
|
|||||||
bool cnc= false;
|
bool cnc= false;
|
||||||
int cto= -1, qto= -1;
|
int cto= -1, qto= -1;
|
||||||
#endif // ODBC_SUPPORT
|
#endif // ODBC_SUPPORT
|
||||||
|
#if defined(JDBC_SUPPORT) || defined(MONGO_SUPPORT)
|
||||||
#if defined(JDBC_SUPPORT)
|
#if defined(JDBC_SUPPORT)
|
||||||
PJPARM sjp= NULL;
|
PJPARM sjp= NULL;
|
||||||
#endif // JDBC_SUPPORT
|
#endif // JDBC_SUPPORT
|
||||||
#if defined(MONGO_SUPPORT)
|
|
||||||
PCSZ driver= NULL;
|
PCSZ driver= NULL;
|
||||||
char *url= NULL;
|
char *url= NULL;
|
||||||
//char *prop= NULL;
|
#endif // JDBC_SUPPORT || MONGO_SUPPORT
|
||||||
#endif // MONGO_SUPPORT
|
|
||||||
uint tm, fnc= FNC_NO, supfnc= (FNC_NO | FNC_COL);
|
uint tm, fnc= FNC_NO, supfnc= (FNC_NO | FNC_COL);
|
||||||
bool bif, ok= false, dbf= false;
|
bool bif, ok= false, dbf= false;
|
||||||
TABTYPE ttp= TAB_UNDEF;
|
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++) {
|
for (field= table_arg->field; *field; field++) {
|
||||||
fp= *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
|
continue; // This is a virtual column
|
||||||
|
|
||||||
if (fp->flags & AUTO_INCREMENT_FLAG) {
|
if (fp->flags & AUTO_INCREMENT_FLAG) {
|
||||||
|
@@ -75,7 +75,7 @@ DROP TABLE rt3;
|
|||||||
connection default;
|
connection default;
|
||||||
DROP TABLE t1,t2,t3,total;
|
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';
|
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 11 as v' OPTION_LIST='port=MASTER_PORT';
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
@@ -90,6 +90,23 @@ SELECT * FROM total order by v desc;
|
|||||||
v
|
v
|
||||||
22
|
22
|
||||||
11
|
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 total;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
DROP TABLE t2;
|
DROP TABLE t2;
|
||||||
|
Binary file not shown.
@@ -54,7 +54,7 @@ connection default;
|
|||||||
DROP TABLE t1,t2,t3,total;
|
DROP TABLE t1,t2,t3,total;
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Old thread TBL tables test
|
--echo # Old thread TBL tables test modified
|
||||||
--echo #
|
--echo #
|
||||||
--replace_result $MASTER_MYPORT MASTER_PORT
|
--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'
|
--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'
|
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 22 as v' OPTION_LIST='port=$SLAVE_MYPORT'
|
||||||
SELECT * FROM t2;
|
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
|
--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';
|
--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;
|
SELECT * FROM total order by v desc;
|
||||||
|
@@ -31,11 +31,13 @@
|
|||||||
#if defined(ZIP_SUPPORT)
|
#if defined(ZIP_SUPPORT)
|
||||||
#include "filamzip.h"
|
#include "filamzip.h"
|
||||||
#endif // ZIP_SUPPORT
|
#endif // ZIP_SUPPORT
|
||||||
|
#if defined(MONGO_SUPPORT)
|
||||||
#if defined(JDBC_SUPPORT)
|
#if defined(JDBC_SUPPORT)
|
||||||
#include "jmgfam.h"
|
#include "jmgfam.h"
|
||||||
#endif // JDBC_SUPPORT
|
#endif // JDBC_SUPPORT
|
||||||
#if defined(CMGO_SUPPORT)
|
#if defined(CMGO_SUPPORT)
|
||||||
#include "cmgfam.h"
|
#include "cmgfam.h"
|
||||||
|
#endif // CMGO_SUPPORT
|
||||||
#endif // MONGO_SUPPORT
|
#endif // MONGO_SUPPORT
|
||||||
#include "tabmul.h"
|
#include "tabmul.h"
|
||||||
#include "checklvl.h"
|
#include "checklvl.h"
|
||||||
@@ -129,8 +131,8 @@ PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info)
|
|||||||
#endif // ZIP_SUPPORT
|
#endif // ZIP_SUPPORT
|
||||||
tdp->Fn = GetStringTableOption(g, topt, "Filename", NULL);
|
tdp->Fn = GetStringTableOption(g, topt, "Filename", NULL);
|
||||||
|
|
||||||
//if (!(tdp->Database = SetPath(g, db)))
|
if (!(tdp->Database = SetPath(g, db)))
|
||||||
// return NULL;
|
return NULL;
|
||||||
|
|
||||||
tdp->Objname = GetStringTableOption(g, topt, "Object", NULL);
|
tdp->Objname = GetStringTableOption(g, topt, "Object", NULL);
|
||||||
tdp->Base = GetIntegerTableOption(g, topt, "Base", 0) ? 1 : 0;
|
tdp->Base = GetIntegerTableOption(g, topt, "Base", 0) ? 1 : 0;
|
||||||
@@ -502,10 +504,10 @@ JSONDEF::JSONDEF(void)
|
|||||||
Pipe = false;
|
Pipe = false;
|
||||||
Driver = NULL;
|
Driver = NULL;
|
||||||
Version = 0;
|
Version = 0;
|
||||||
#endif // MONGO_SUPPORT
|
|
||||||
#if defined(JDBC_SUPPORT)
|
#if defined(JDBC_SUPPORT)
|
||||||
Wrapname = NULL;
|
Wrapname = NULL;
|
||||||
#endif // JDBC_SUPPORT
|
#endif // JDBC_SUPPORT
|
||||||
|
#endif // MONGO_SUPPORT
|
||||||
} // end of JSONDEF constructor
|
} // end of JSONDEF constructor
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
@@ -37,7 +37,9 @@ class DllExport JSONDEF : public DOSDEF { /* Table description */
|
|||||||
friend class TDBJSN;
|
friend class TDBJSN;
|
||||||
friend class TDBJCL;
|
friend class TDBJCL;
|
||||||
#if defined(MONGO_SUPPORT)
|
#if defined(MONGO_SUPPORT)
|
||||||
|
#if defined(CMGO_SUPPORT)
|
||||||
friend class CMGFAM;
|
friend class CMGFAM;
|
||||||
|
#endif // CMGO_SUPPORT
|
||||||
#if defined(JDBC_SUPPORT)
|
#if defined(JDBC_SUPPORT)
|
||||||
friend class JMGFAM;
|
friend class JMGFAM;
|
||||||
#endif // JDBC_SUPPORT
|
#endif // JDBC_SUPPORT
|
||||||
@@ -90,7 +92,9 @@ class DllExport TDBJSN : public TDBDOS {
|
|||||||
friend class JSONCOL;
|
friend class JSONCOL;
|
||||||
friend class JSONDEF;
|
friend class JSONDEF;
|
||||||
#if defined(MONGO_SUPPORT)
|
#if defined(MONGO_SUPPORT)
|
||||||
|
#if defined(CMGO_SUPPORT)
|
||||||
friend class CMGFAM;
|
friend class CMGFAM;
|
||||||
|
#endif // CMGO_SUPPORT
|
||||||
#if defined(JDBC_SUPPORT)
|
#if defined(JDBC_SUPPORT)
|
||||||
friend class JMGFAM;
|
friend class JMGFAM;
|
||||||
#endif // JDBC_SUPPORT
|
#endif // JDBC_SUPPORT
|
||||||
@@ -159,11 +163,13 @@ public:
|
|||||||
class DllExport JSONCOL : public DOSCOL {
|
class DllExport JSONCOL : public DOSCOL {
|
||||||
friend class TDBJSN;
|
friend class TDBJSN;
|
||||||
friend class TDBJSON;
|
friend class TDBJSON;
|
||||||
|
#if defined(MONGO_SUPPORT)
|
||||||
|
#if defined(CMGO_SUPPORT)
|
||||||
|
friend class CMGFAM;
|
||||||
|
#endif // CMGO_SUPPORT
|
||||||
#if defined(JDBC_SUPPORT)
|
#if defined(JDBC_SUPPORT)
|
||||||
friend class JMGFAM;
|
friend class JMGFAM;
|
||||||
#endif // JDBC_SUPPORT
|
#endif // JDBC_SUPPORT
|
||||||
#if defined(MONGO_SUPPORT)
|
|
||||||
friend class CMGFAM;
|
|
||||||
#endif // MONGO_SUPPORT
|
#endif // MONGO_SUPPORT
|
||||||
public:
|
public:
|
||||||
// Constructors
|
// Constructors
|
||||||
|
@@ -652,6 +652,7 @@ bool TDBTBM::OpenTables(PGLOBAL g)
|
|||||||
tp = (PTBMT)PlugSubAlloc(g, NULL, sizeof(TBMT));
|
tp = (PTBMT)PlugSubAlloc(g, NULL, sizeof(TBMT));
|
||||||
memset(tp, 0, sizeof(TBMT));
|
memset(tp, 0, sizeof(TBMT));
|
||||||
tp->G = g;
|
tp->G = g;
|
||||||
|
tp->Ready = false;
|
||||||
tp->Tap = tabp;
|
tp->Tap = tabp;
|
||||||
tp->Thd = thd;
|
tp->Thd = thd;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user