diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2017-08-09 12:50:06 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2017-08-09 12:50:06 +0200 |
commit | efc8a5b6899f8ad3d540c672c036d51cbcf52519 (patch) | |
tree | 4d523d97bde6e1882d860281ca31f940661b0528 | |
parent | 3523c12eb05a4e8590b0d4f8e578add32574ea49 (diff) | |
download | mariadb-git-efc8a5b6899f8ad3d540c672c036d51cbcf52519.tar.gz |
- 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
-rw-r--r-- | storage/connect/mongo.cpp | 9 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/r/mysql.result | 2 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/r/mysql_new.result | 2 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/r/tbl_thread.result | 1 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/t/tbl_thread.test | 1 | ||||
-rw-r--r-- | storage/connect/tabjson.cpp | 12 |
6 files changed, 16 insertions, 11 deletions
diff --git a/storage/connect/mongo.cpp b/storage/connect/mongo.cpp index 2bbbc7eef86..12f2f428112 100644 --- a/storage/connect/mongo.cpp +++ b/storage/connect/mongo.cpp @@ -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}; int ncol = sizeof(buftyp) / sizeof(int); int i, n = 0; + PCSZ drv; PBCOL bcp; MGODISC *cmgd; PQRYRES qrp; @@ -61,7 +62,7 @@ PQRYRES MGOColumns(PGLOBAL g, PCSZ db, PCSZ uri, PTOS topt, bool info) /*********************************************************************/ /* Open MongoDB. */ /*********************************************************************/ - PCSZ drv = GetStringTableOption(g, topt, "Driver", NULL); + drv = GetStringTableOption(g, topt, "Driver", NULL); if (drv && toupper(*drv) == 'C') { #if defined(CMGO_SUPPORT) @@ -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))) { bcp->Fmt = PlugDup(g, fmt); - length[7] = MY_MAX(length[7], strlen(fmt)); + length[7] = MY_MAX(length[7], (signed)strlen(fmt)); } // endif *fmt bcp->Len = MY_MAX(bcp->Len, bcol.Len); @@ -269,11 +270,11 @@ void MGODISC::AddColumn(PGLOBAL g, PCSZ colname, PCSZ fmt, int k) *bcp = bcol; bcp->Cbn |= (i > 1); bcp->Name = PlugDup(g, colname); - length[0] = MY_MAX(length[0], strlen(colname)); + length[0] = MY_MAX(length[0], (signed)strlen(colname)); if (k) { bcp->Fmt = PlugDup(g, fmt); - length[7] = MY_MAX(length[7], strlen(fmt)); + length[7] = MY_MAX(length[7], (signed)strlen(fmt)); } else bcp->Fmt = NULL; diff --git a/storage/connect/mysql-test/connect/r/mysql.result b/storage/connect/mysql-test/connect/r/mysql.result index 29f077c3d9f..3ac23394cbc 100644 --- a/storage/connect/mysql-test/connect/r/mysql.result +++ b/storage/connect/mysql-test/connect/r/mysql.result @@ -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'; ERROR HY000: (1049) Unknown database 'unknown' 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; 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'; diff --git a/storage/connect/mysql-test/connect/r/mysql_new.result b/storage/connect/mysql-test/connect/r/mysql_new.result index 69402ff7532..0394caac8af 100644 --- a/storage/connect/mysql-test/connect/r/mysql_new.result +++ b/storage/connect/mysql-test/connect/r/mysql_new.result @@ -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' CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL 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; ERROR 42S02: Table 'test.t1' doesn't exist CREATE TABLE t1 (x int, y char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL diff --git a/storage/connect/mysql-test/connect/r/tbl_thread.result b/storage/connect/mysql-test/connect/r/tbl_thread.result index 32602e3fbe4..1f6d1023ec8 100644 --- a/storage/connect/mysql-test/connect/r/tbl_thread.result +++ b/storage/connect/mysql-test/connect/r/tbl_thread.result @@ -26,6 +26,7 @@ a b 6 test06 7 test07 connection slave; +USE test; CREATE TABLE rt3 (a int, b char(10)); INSERT INTO rt3 VALUES (8,'test08'),(9,'test09'),(10,'test10'),(11,'test11'); SELECT * FROM rt3; diff --git a/storage/connect/mysql-test/connect/t/tbl_thread.test b/storage/connect/mysql-test/connect/t/tbl_thread.test index 233d4149507..c7003cdaffa 100644 --- a/storage/connect/mysql-test/connect/t/tbl_thread.test +++ b/storage/connect/mysql-test/connect/t/tbl_thread.test @@ -19,6 +19,7 @@ SELECT * FROM rt2; connection slave; +USE test; CREATE TABLE rt3 (a int, b char(10)); INSERT INTO rt3 VALUES (8,'test08'),(9,'test09'),(10,'test10'),(11,'test11'); SELECT * FROM rt3; diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index 5556985770e..1b7ab8ca952 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -1590,18 +1590,20 @@ PVAL JSONCOL::ExpandArray(PGLOBAL g, PJAR arp, int n) /***********************************************************************/ PVAL JSONCOL::CalculateArray(PGLOBAL g, PJAR arp, int n) { - int i, ars, nv = 0, nextsame = Tjp->NextSame; - bool err; +//int i, ars, nv = 0, nextsame = Tjp->NextSame; + int i, nv = 0, nextsame = Tjp->NextSame; + bool err; OPVAL op = Nodes[n].Op; PVAL val[2], vp = Nodes[n].Valp; PJVAL jvrp, jvp; JVALUE jval; vp->Reset(); - ars = MY_MIN(Tjp->Limit, arp->size()); +//ars = MY_MIN(Tjp->Limit, arp->size()); - for (i = 0; i < ars; i++) { - jvrp = arp->GetValue(i); +//for (i = 0; i < ars; i++) { + for (i = 0; i < arp->size(); i++) { + jvrp = arp->GetValue(i); if (!jvrp->IsNull() || (op == OP_CNC && GetJsonNull())) do { if (jvrp->IsNull()) { |