From de13fccfc6b16915190cd740f7fe1e3445dff0e7 Mon Sep 17 00:00:00 2001 From: Daniel Bartholomew Date: Mon, 11 May 2020 12:50:03 -0400 Subject: [PATCH 1/3] bump the VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 5048bc29198..bccc9d350b1 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 -MYSQL_VERSION_PATCH=68 +MYSQL_VERSION_PATCH=69 MYSQL_VERSION_EXTRA= From 76f4ae8295f63e4f3f7b8b72c2120d5da59b302c Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Tue, 26 May 2020 01:50:46 +0530 Subject: [PATCH 2/3] MDEV-21495: Conditional jump or move depends on uninitialised value in sel_arg_range_seq_next Initialize the parameter PARAM::max_key_part when we iterate over the ranges to get estimates from EITS. --- mysql-test/r/selectivity.result | 15 +++++++++++++++ mysql-test/r/selectivity_innodb.result | 15 +++++++++++++++ mysql-test/t/selectivity.test | 12 ++++++++++++ sql/opt_range_mrr.cc | 1 + 4 files changed, 43 insertions(+) diff --git a/mysql-test/r/selectivity.result b/mysql-test/r/selectivity.result index dc7e9494946..9bb197ad056 100644 --- a/mysql-test/r/selectivity.result +++ b/mysql-test/r/selectivity.result @@ -1866,4 +1866,19 @@ id select_type table type possible_keys key key_len ref rows Extra set optimizer_switch= @save_optimizer_switch; set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; drop table t1,t2; +# +# MDEV-21495: Conditional jump or move depends on uninitialised value in sel_arg_range_seq_next +# +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 SELECT seq, seq from seq_1_to_100; +set optimizer_use_condition_selectivity=4; +ANALYZE TABLE t1 PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +SELECT * from t1 WHERE a = 5 and b = 5; +a b +5 5 +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +drop table t1; # End of 10.1 tests diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result index f0cbf1662aa..d0e31374784 100644 --- a/mysql-test/r/selectivity_innodb.result +++ b/mysql-test/r/selectivity_innodb.result @@ -1876,6 +1876,21 @@ id select_type table type possible_keys key key_len ref rows Extra set optimizer_switch= @save_optimizer_switch; set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; drop table t1,t2; +# +# MDEV-21495: Conditional jump or move depends on uninitialised value in sel_arg_range_seq_next +# +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 SELECT seq, seq from seq_1_to_100; +set optimizer_use_condition_selectivity=4; +ANALYZE TABLE t1 PERSISTENT FOR ALL; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +SELECT * from t1 WHERE a = 5 and b = 5; +a b +5 5 +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +drop table t1; # End of 10.1 tests set optimizer_switch=@save_optimizer_switch_for_selectivity_test; set @tmp_ust= @@use_stat_tables; diff --git a/mysql-test/t/selectivity.test b/mysql-test/t/selectivity.test index 7df326edb44..1d0256b1b7e 100644 --- a/mysql-test/t/selectivity.test +++ b/mysql-test/t/selectivity.test @@ -1266,5 +1266,17 @@ set optimizer_switch= @save_optimizer_switch; set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; drop table t1,t2; +--echo # +--echo # MDEV-21495: Conditional jump or move depends on uninitialised value in sel_arg_range_seq_next +--echo # + +CREATE TABLE t1(a INT, b INT); +INSERT INTO t1 SELECT seq, seq from seq_1_to_100; +set optimizer_use_condition_selectivity=4; +ANALYZE TABLE t1 PERSISTENT FOR ALL; +SELECT * from t1 WHERE a = 5 and b = 5; +set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; +drop table t1; + --echo # End of 10.1 tests diff --git a/sql/opt_range_mrr.cc b/sql/opt_range_mrr.cc index 5d62ceda7d4..b1894f4b6c4 100644 --- a/sql/opt_range_mrr.cc +++ b/sql/opt_range_mrr.cc @@ -73,6 +73,7 @@ range_seq_t sel_arg_range_seq_init(void *init_param, uint n_ranges, uint flags) { SEL_ARG_RANGE_SEQ *seq= (SEL_ARG_RANGE_SEQ*)init_param; seq->at_start= TRUE; + seq->param->max_key_part= 0; seq->stack[0].key_tree= NULL; seq->stack[0].min_key= seq->param->min_key; seq->stack[0].min_key_flag= 0; From 9bbd685e8d325c5868a93083addc7a930c1c90de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 26 May 2020 12:23:20 +0300 Subject: [PATCH 3/3] MDEV-22513 main.processlist_notembedded Timeout in wait_until_count_sessions Do not blindly disconnect the connection that is in WAIT_FOR because it could happen that neither the disconnect nor the SIGNAL would be processed before RESET would discard the signal. --- mysql-test/r/processlist_notembedded.result | 1 + mysql-test/t/processlist_notembedded.test | 3 +++ 2 files changed, 4 insertions(+) diff --git a/mysql-test/r/processlist_notembedded.result b/mysql-test/r/processlist_notembedded.result index ab1ced79e25..ed8509ca13c 100644 --- a/mysql-test/r/processlist_notembedded.result +++ b/mysql-test/r/processlist_notembedded.result @@ -4,5 +4,6 @@ SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync WAIT_FOR go'; SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; SET DEBUG_SYNC= 'now SIGNAL go'; +user SET DEBUG_SYNC = 'RESET'; End of 5.5 tests diff --git a/mysql-test/t/processlist_notembedded.test b/mysql-test/t/processlist_notembedded.test index b07ac00a44a..90750b40e62 100644 --- a/mysql-test/t/processlist_notembedded.test +++ b/mysql-test/t/processlist_notembedded.test @@ -30,7 +30,10 @@ remove_file $MYSQLTEST_VARDIR/tmp//MDEV-20466.text; SET DEBUG_SYNC= 'now SIGNAL go'; +connection con1; +reap; disconnect con1; +connection default; SET DEBUG_SYNC = 'RESET';