diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2016-03-16 23:56:43 +0100 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2016-03-16 23:56:43 +0100 |
commit | 66890975ebf6a7d7ab9f19ba25543223b78c8c82 (patch) | |
tree | bf8702e5537c680c2aedb557cd41a3d96ef4f775 /storage | |
parent | fb9e2fa33f531aaa0a853f0db1150a86ca3512e0 (diff) | |
download | mariadb-git-66890975ebf6a7d7ab9f19ba25543223b78c8c82.tar.gz |
- Fix crash when sorting a TBL table with thread=yes.
This was because Tablist can be NULL when no lacal tables are in the list.
modified: storage/connect/tabtbl.cpp
modified: storage/connect/mysql-test/connect/r/tbl.result
modified: storage/connect/mysql-test/connect/t/tbl.test
Diffstat (limited to 'storage')
-rw-r--r-- | storage/connect/mysql-test/connect/r/tbl.result | 2 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/t/tbl.test | 2 | ||||
-rw-r--r-- | storage/connect/tabtbl.cpp | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/storage/connect/mysql-test/connect/r/tbl.result b/storage/connect/mysql-test/connect/r/tbl.result index c584a9dd61f..f51b4dfa57f 100644 --- a/storage/connect/mysql-test/connect/r/tbl.result +++ b/storage/connect/mysql-test/connect/r/tbl.result @@ -153,7 +153,7 @@ 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; +SELECT * FROM total order by v desc; v 22 11 diff --git a/storage/connect/mysql-test/connect/t/tbl.test b/storage/connect/mysql-test/connect/t/tbl.test index 8478679d22c..3dc4b2e64b0 100644 --- a/storage/connect/mysql-test/connect/t/tbl.test +++ b/storage/connect/mysql-test/connect/t/tbl.test @@ -63,7 +63,7 @@ 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; +SELECT * FROM total order by v desc; DROP TABLE total; DROP TABLE t1; diff --git a/storage/connect/tabtbl.cpp b/storage/connect/tabtbl.cpp index 6b72c715517..36849146746 100644 --- a/storage/connect/tabtbl.cpp +++ b/storage/connect/tabtbl.cpp @@ -607,7 +607,7 @@ void TDBTBM::ResetDB(void) for (PTABLE tabp = Tablist; tabp; tabp = tabp->GetNext()) ((PTDBASE)tabp->GetTo_Tdb())->ResetDB(); - Tdbp = (PTDBASE)Tablist->GetTo_Tdb(); + Tdbp = (Tablist) ? (PTDBASE)Tablist->GetTo_Tdb() : NULL; Crp = 0; } // end of ResetDB @@ -679,7 +679,7 @@ bool TDBTBM::OpenDB(PGLOBAL g) /* Table already open, replace it at its beginning. */ /*******************************************************************/ ResetDB(); - return Tdbp->OpenDB(g); // Re-open fist table + return (Tdbp) ? Tdbp->OpenDB(g) : false; // Re-open fist table } // endif use #if 0 |