diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-30 11:04:16 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-30 11:04:16 +0200 |
commit | 199863d72b7cccaa4c75641c50c45a83b568ab8c (patch) | |
tree | 4a5e71963b2fd64141439552c1493d4ab368c3b9 | |
parent | 99362359850d3cece6e465788827aef7e8c33ca6 (diff) | |
download | mariadb-git-199863d72b7cccaa4c75641c50c45a83b568ab8c.tar.gz |
MDEV-23991 fixup: Initialize the memory
Also, revert the work-around for the test that was attempted in
commit 85613a32477ef4b8fb9aefba5f61689028f3ff87.
This issue was caught by MemorySanitizer as well as on the
Microsoft Windows debug builds, thanks to /MD being used
starting with 10.4.
The code fix will also be applied to 10.2 because the regression
was introduced in commit afc9d00c66db946c8240fe1fa6b345a3a8b6fec1.
-rw-r--r-- | mysql-test/main/innodb_ext_key,off.rdiff | 9 | ||||
-rw-r--r-- | mysql-test/main/innodb_ext_key.result | 6 | ||||
-rw-r--r-- | mysql-test/main/innodb_ext_key.test | 10 | ||||
-rw-r--r-- | storage/innobase/dict/dict0stats.cc | 3 |
4 files changed, 23 insertions, 5 deletions
diff --git a/mysql-test/main/innodb_ext_key,off.rdiff b/mysql-test/main/innodb_ext_key,off.rdiff index 1e0f5d6fbd5..2164c56c5b5 100644 --- a/mysql-test/main/innodb_ext_key,off.rdiff +++ b/mysql-test/main/innodb_ext_key,off.rdiff @@ -150,6 +150,15 @@ Handler_read_rnd_deleted 0 Handler_read_rnd_next 0 explain +@@ -209,7 +209,7 @@ + where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 + or l_receiptdate='1992-07-01' and l_orderkey between 5001 and 6000; + id select_type table type possible_keys key key_len ref rows Extra +-1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate,i_l_receiptdate # NULL # Using ++1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate,PRIMARY,i_l_receiptdate,PRIMARY # NULL # Using + flush status; + select l_orderkey, l_linenumber from lineitem + where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 @@ -220,12 +220,12 @@ 5959 3 show status like 'handler_read_next'; diff --git a/mysql-test/main/innodb_ext_key.result b/mysql-test/main/innodb_ext_key.result index 6725e91a137..dbc201be669 100644 --- a/mysql-test/main/innodb_ext_key.result +++ b/mysql-test/main/innodb_ext_key.result @@ -204,6 +204,12 @@ Handler_read_retry 0 Handler_read_rnd 3 Handler_read_rnd_deleted 0 Handler_read_rnd_next 0 +explain +select l_orderkey, l_linenumber from lineitem +where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 +or l_receiptdate='1992-07-01' and l_orderkey between 5001 and 6000; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate,i_l_receiptdate # NULL # Using flush status; select l_orderkey, l_linenumber from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 diff --git a/mysql-test/main/innodb_ext_key.test b/mysql-test/main/innodb_ext_key.test index 2fed1c35a41..9ca9bbd608f 100644 --- a/mysql-test/main/innodb_ext_key.test +++ b/mysql-test/main/innodb_ext_key.test @@ -98,11 +98,11 @@ select l_orderkey, l_linenumber or l_receiptdate='1992-07-01' and l_orderkey between 5001 and 6000; show status like 'handler_read%'; -# FIXME: optimizer_switch=extended_keys=off occasionally gets wrong plan -#explain -#select l_orderkey, l_linenumber from lineitem -# where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 -# or l_receiptdate='1992-07-01' and l_orderkey between 5001 and 6000; +--replace_column 7 # 9 # 10 Using +explain +select l_orderkey, l_linenumber from lineitem + where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 + or l_receiptdate='1992-07-01' and l_orderkey between 5001 and 6000; flush status; select l_orderkey, l_linenumber from lineitem where l_shipdate='1992-07-01' and l_orderkey between 1 and 1000 diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc index 950e33c090b..ba724703221 100644 --- a/storage/innobase/dict/dict0stats.cc +++ b/storage/innobase/dict/dict0stats.cc @@ -2244,6 +2244,9 @@ dict_stats_update_persistent( } ut_ad(!dict_index_is_ibuf(index)); + mutex_enter(&dict_sys.mutex); + dict_stats_empty_index(index, false); + mutex_exit(&dict_sys.mutex); index_stats_t stats = dict_stats_analyze_index(index); |