From 3345e7564d033313ac54ca34d1505d6a2e78cdad Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Fri, 29 Mar 2013 19:27:06 +0400 Subject: MDEV-4335: Unexpected results when selecting on information_schema - When converting a subquery to a semi-join, propagate OPTION_SCHEMA_TABLE. --- mysql-test/t/subselect_sj.test | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test/t') diff --git a/mysql-test/t/subselect_sj.test b/mysql-test/t/subselect_sj.test index 650c9d73893..c05896fadda 100644 --- a/mysql-test/t/subselect_sj.test +++ b/mysql-test/t/subselect_sj.test @@ -2481,6 +2481,13 @@ execute stmt; deallocate prepare stmt; drop table t1,t2; +--echo # +--echo # MDEV-4335: Unexpected results when selecting on information_schema +--echo # +CREATE TABLE t1 (db VARCHAR(64) DEFAULT NULL); +INSERT INTO t1 VALUES ('mysql'),('information_schema'); +SELECT * FROM t1 WHERE db IN (SELECT `SCHEMA_NAME` FROM information_schema.SCHEMATA); +DROP TABLE t1; # The following command must be the last one the file set optimizer_switch=@subselect_sj_tmp; -- cgit v1.2.1 From 33f3c93e6feb9550e465b2373c2ba24fa65a4967 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 4 Apr 2013 11:05:04 +0200 Subject: MDEV-4161 Assertion `status_var.memory_used == 0' fails in virtual THD::~THD() init join->top_join_tab_count to be in sync with join->join_tab=stat, otherwise a query can be killed in-between and join_tab's won't be deleted (JOIN::cleanup won't call JOIN_TAB::cleanup) --- mysql-test/t/quick_select_4161.test | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 mysql-test/t/quick_select_4161.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/quick_select_4161.test b/mysql-test/t/quick_select_4161.test new file mode 100644 index 00000000000..1e746754b41 --- /dev/null +++ b/mysql-test/t/quick_select_4161.test @@ -0,0 +1,53 @@ +# +# MDEV-4161 Assertion `status_var.memory_used == 0' fails in virtual THD::~THD() +# +--source include/have_debug_sync.inc + +CREATE TABLE t1 ( + event_date date DEFAULT '0000-00-00' NOT NULL, + type int(11) DEFAULT '0' NOT NULL, + event_id int(11) DEFAULT '0' NOT NULL, + PRIMARY KEY (event_date,type,event_id) +); + +INSERT INTO t1 VALUES ('1999-07-10',100100,24), ('1999-07-11',100100,25), +('1999-07-13',100600,0), ('1999-07-13',100600,4), ('1999-07-13',100600,26), +('1999-07-14',100600,10), ('1999-07-15',100600,16), ('1999-07-15',100800,45), +('1999-07-15',101000,47), ('1999-07-16',100800,46), ('1999-07-20',100600,5), +('1999-07-20',100600,27), ('1999-07-21',100600,11), ('1999-07-22',100600,17), +('1999-07-23',100100,39), ('1999-07-24',100100,39), ('1999-07-24',100500,40), +('1999-07-25',100100,39), ('1999-07-27',100600,1), ('1999-07-27',100600,6), +('1999-07-27',100600,28), ('1999-07-28',100600,12), ('1999-07-29',100500,41), +('1999-07-29',100600,18), ('1999-07-30',100500,41), ('1999-07-31',100500,41), +('1999-08-01',100700,34), ('1999-08-03',100600,7), ('1999-08-03',100600,29), +('1999-08-04',100600,13), ('1999-08-05',100500,42), ('1999-08-05',100600,19), +('1999-08-06',100500,42), ('1999-08-07',100500,42), ('1999-08-08',100500,42), +('1999-08-10',100600,2), ('1999-08-10',100600,9), ('1999-08-10',100600,30), +('1999-08-11',100600,14), ('1999-08-12',100600,20), ('1999-08-17',100500,8), +('1999-08-17',100600,31), ('1999-08-18',100600,15), ('1999-08-19',100600,22), +('1999-08-24',100600,3), ('1999-08-24',100600,32), ('1999-08-27',100500,43), +('1999-08-31',100600,33), ('1999-09-17',100100,37), ('1999-09-18',100100,37), +('1999-09-19',100100,37), ('2000-12-18',100700,38); + +connect (killee, localhost, root); + +let $id=`select connection_id()`; + +set debug_sync='inside_make_join_statistics signal killme wait_for done'; +send select event_date,type,event_id from t1 WHERE event_date >= "1999-07-01" AND event_date < "1999-07-15" AND (type=100600 OR type=100100) ORDER BY event_date; + +connection default; +set debug_sync='now wait_for killme'; +--replace_result $id %connection% +eval kill $id; +set debug_sync='now signal done'; + +connection killee; +--error 1053,1927,2006,2013 +reap; + +connection default; +disconnect killee; + +drop table t1; + -- cgit v1.2.1 From 6770a9a836fcc8aa9f49f6b91ce237851638916b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 6 Apr 2013 15:14:46 +0200 Subject: MDEV-4316 MariaDB server crash with signal 11 fulltext search was initialized for all MATCH ... AGAINST items at the end of the JOIN::optimize(). But since 5.3 derived tables are initialized lazily on first use, very late in the sub_select(). Skip Item_func_match::init_search initialization if the corresponding table isn't open yet; repeat fulltext initialization for all not-yet-initialized MATCH ... AGAINST items after creating derived tables. --- mysql-test/t/fulltext_derived_4316.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 mysql-test/t/fulltext_derived_4316.test (limited to 'mysql-test/t') diff --git a/mysql-test/t/fulltext_derived_4316.test b/mysql-test/t/fulltext_derived_4316.test new file mode 100644 index 00000000000..ecf4a0e7722 --- /dev/null +++ b/mysql-test/t/fulltext_derived_4316.test @@ -0,0 +1,14 @@ +# +# MATCH on the derived tables +# + +# +# MDEV-4316 MariaDB server crash with signal 11 +# + +create table t1 (ft text) engine=myisam; +insert into t1 values ('test1'),('test2'); +select distinct match(ft) against("test1" in boolean mode) from + (select distinct ft from t1) as t; +drop table t1; + -- cgit v1.2.1