mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 03:51:50 +01:00
- 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
This commit is contained in:
parent
fb9e2fa33f
commit
66890975eb
3 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue