Commit efc8a5b6 authored by Olivier Bertrand's avatar Olivier Bertrand

- Fix gcc compile error: crosses initialization of ‘const char* drv’

  modified:   storage/connect/mongo.cpp

- Fix test failures
  modified:   storage/connect/mysql-test/connect/r/mysql.result
  modified:   storage/connect/mysql-test/connect/r/mysql_new.result
  modified:   storage/connect/mysql-test/connect/r/tbl_thread.result
  modified:   storage/connect/mysql-test/connect/t/tbl_thread.test
  modified:   storage/connect/tabjson.cpp
parent 3523c12e
...@@ -47,6 +47,7 @@ PQRYRES MGOColumns(PGLOBAL g, PCSZ db, PCSZ uri, PTOS topt, bool info) ...@@ -47,6 +47,7 @@ PQRYRES MGOColumns(PGLOBAL g, PCSZ db, PCSZ uri, PTOS topt, bool info)
unsigned int length[] = {0, 6, 8, 10, 10, 6, 6, 0}; unsigned int length[] = {0, 6, 8, 10, 10, 6, 6, 0};
int ncol = sizeof(buftyp) / sizeof(int); int ncol = sizeof(buftyp) / sizeof(int);
int i, n = 0; int i, n = 0;
PCSZ drv;
PBCOL bcp; PBCOL bcp;
MGODISC *cmgd; MGODISC *cmgd;
PQRYRES qrp; PQRYRES qrp;
...@@ -61,7 +62,7 @@ PQRYRES MGOColumns(PGLOBAL g, PCSZ db, PCSZ uri, PTOS topt, bool info) ...@@ -61,7 +62,7 @@ PQRYRES MGOColumns(PGLOBAL g, PCSZ db, PCSZ uri, PTOS topt, bool info)
/*********************************************************************/ /*********************************************************************/
/* Open MongoDB. */ /* Open MongoDB. */
/*********************************************************************/ /*********************************************************************/
PCSZ drv = GetStringTableOption(g, topt, "Driver", NULL); drv = GetStringTableOption(g, topt, "Driver", NULL);
if (drv && toupper(*drv) == 'C') { if (drv && toupper(*drv) == 'C') {
#if defined(CMGO_SUPPORT) #if defined(CMGO_SUPPORT)
...@@ -256,7 +257,7 @@ void MGODISC::AddColumn(PGLOBAL g, PCSZ colname, PCSZ fmt, int k) ...@@ -256,7 +257,7 @@ void MGODISC::AddColumn(PGLOBAL g, PCSZ colname, PCSZ fmt, int k)
if (k && *fmt && (!bcp->Fmt || strlen(bcp->Fmt) < strlen(fmt))) { if (k && *fmt && (!bcp->Fmt || strlen(bcp->Fmt) < strlen(fmt))) {
bcp->Fmt = PlugDup(g, fmt); bcp->Fmt = PlugDup(g, fmt);
length[7] = MY_MAX(length[7], strlen(fmt)); length[7] = MY_MAX(length[7], (signed)strlen(fmt));
} // endif *fmt } // endif *fmt
bcp->Len = MY_MAX(bcp->Len, bcol.Len); bcp->Len = MY_MAX(bcp->Len, bcol.Len);
...@@ -269,11 +270,11 @@ void MGODISC::AddColumn(PGLOBAL g, PCSZ colname, PCSZ fmt, int k) ...@@ -269,11 +270,11 @@ void MGODISC::AddColumn(PGLOBAL g, PCSZ colname, PCSZ fmt, int k)
*bcp = bcol; *bcp = bcol;
bcp->Cbn |= (i > 1); bcp->Cbn |= (i > 1);
bcp->Name = PlugDup(g, colname); bcp->Name = PlugDup(g, colname);
length[0] = MY_MAX(length[0], strlen(colname)); length[0] = MY_MAX(length[0], (signed)strlen(colname));
if (k) { if (k) {
bcp->Fmt = PlugDup(g, fmt); bcp->Fmt = PlugDup(g, fmt);
length[7] = MY_MAX(length[7], strlen(fmt)); length[7] = MY_MAX(length[7], (signed)strlen(fmt));
} else } else
bcp->Fmt = NULL; bcp->Fmt = NULL;
......
...@@ -17,7 +17,7 @@ ERROR HY000: (1049) Unknown database 'unknown' ...@@ -17,7 +17,7 @@ ERROR HY000: (1049) Unknown database 'unknown'
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL OPTION_LIST='host=localhost,user=root,port=PORT' DBNAME='unknown' TABNAME='t1'; CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL OPTION_LIST='host=localhost,user=root,port=PORT' DBNAME='unknown' TABNAME='t1';
ERROR HY000: (1049) Unknown database 'unknown' ERROR HY000: (1049) Unknown database 'unknown'
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='unknown' OPTION_LIST='host=localhost,user=root,port=PORT'; CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='unknown' OPTION_LIST='host=localhost,user=root,port=PORT';
ERROR HY000: (1146) Table 'test.unknown' doesn't exist [SHOW FULL COLUMNS FROM unknown FROM test] ERROR HY000: (1146) Table 'test.unknown' doesn't exist [SHOW FULL COLUMNS FROM `unknown` FROM test]
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
ERROR 42S02: Table 'test.t2' doesn't exist ERROR 42S02: Table 'test.t2' doesn't exist
CREATE TABLE t2 (x int, y char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT'; CREATE TABLE t2 (x int, y char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT';
......
...@@ -29,7 +29,7 @@ OPTION_LIST='host=127.0.0.1,user=root,port=SLAVE_PORT' DBNAME='unknown' TABNAME= ...@@ -29,7 +29,7 @@ OPTION_LIST='host=127.0.0.1,user=root,port=SLAVE_PORT' DBNAME='unknown' TABNAME=
ERROR HY000: (1049) Unknown database 'unknown' ERROR HY000: (1049) Unknown database 'unknown'
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/unknown'; CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/unknown';
ERROR HY000: (1146) Table 'test.unknown' doesn't exist [SHOW FULL COLUMNS FROM unknown FROM test] ERROR HY000: (1146) Table 'test.unknown' doesn't exist [SHOW FULL COLUMNS FROM `unknown` FROM test]
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
ERROR 42S02: Table 'test.t1' doesn't exist ERROR 42S02: Table 'test.t1' doesn't exist
CREATE TABLE t1 (x int, y char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL CREATE TABLE t1 (x int, y char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL
......
...@@ -26,6 +26,7 @@ a b ...@@ -26,6 +26,7 @@ a b
6 test06 6 test06
7 test07 7 test07
connection slave; connection slave;
USE test;
CREATE TABLE rt3 (a int, b char(10)); CREATE TABLE rt3 (a int, b char(10));
INSERT INTO rt3 VALUES (8,'test08'),(9,'test09'),(10,'test10'),(11,'test11'); INSERT INTO rt3 VALUES (8,'test08'),(9,'test09'),(10,'test10'),(11,'test11');
SELECT * FROM rt3; SELECT * FROM rt3;
......
...@@ -19,6 +19,7 @@ SELECT * FROM rt2; ...@@ -19,6 +19,7 @@ SELECT * FROM rt2;
connection slave; connection slave;
USE test;
CREATE TABLE rt3 (a int, b char(10)); CREATE TABLE rt3 (a int, b char(10));
INSERT INTO rt3 VALUES (8,'test08'),(9,'test09'),(10,'test10'),(11,'test11'); INSERT INTO rt3 VALUES (8,'test08'),(9,'test09'),(10,'test10'),(11,'test11');
SELECT * FROM rt3; SELECT * FROM rt3;
......
...@@ -1590,18 +1590,20 @@ PVAL JSONCOL::ExpandArray(PGLOBAL g, PJAR arp, int n) ...@@ -1590,18 +1590,20 @@ PVAL JSONCOL::ExpandArray(PGLOBAL g, PJAR arp, int n)
/***********************************************************************/ /***********************************************************************/
PVAL JSONCOL::CalculateArray(PGLOBAL g, PJAR arp, int n) PVAL JSONCOL::CalculateArray(PGLOBAL g, PJAR arp, int n)
{ {
int i, ars, nv = 0, nextsame = Tjp->NextSame; //int i, ars, nv = 0, nextsame = Tjp->NextSame;
bool err; int i, nv = 0, nextsame = Tjp->NextSame;
bool err;
OPVAL op = Nodes[n].Op; OPVAL op = Nodes[n].Op;
PVAL val[2], vp = Nodes[n].Valp; PVAL val[2], vp = Nodes[n].Valp;
PJVAL jvrp, jvp; PJVAL jvrp, jvp;
JVALUE jval; JVALUE jval;
vp->Reset(); vp->Reset();
ars = MY_MIN(Tjp->Limit, arp->size()); //ars = MY_MIN(Tjp->Limit, arp->size());
for (i = 0; i < ars; i++) { //for (i = 0; i < ars; i++) {
jvrp = arp->GetValue(i); for (i = 0; i < arp->size(); i++) {
jvrp = arp->GetValue(i);
if (!jvrp->IsNull() || (op == OP_CNC && GetJsonNull())) do { if (!jvrp->IsNull() || (op == OP_CNC && GetJsonNull())) do {
if (jvrp->IsNull()) { if (jvrp->IsNull()) {
......
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