From 2fd2fd77e70ed78fe8f9fc7cf99f2ebf5c2a1eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Fri, 12 Jun 2020 10:45:54 +0300 Subject: [PATCH] Fix wrong merge of commit d218d1aa49e848cef2bdbe83bbaf08e474d5209c --- mysql-test/r/index_merge_innodb.result | 6 +----- mysql-test/t/index_merge_innodb.test | 4 ---- sql/uniques.h | 3 +++ 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/index_merge_innodb.result b/mysql-test/r/index_merge_innodb.result index f5396bc88ff..5bf7aceb597 100644 --- a/mysql-test/r/index_merge_innodb.result +++ b/mysql-test/r/index_merge_innodb.result @@ -815,8 +815,6 @@ SET @save_sort_buffer_size=@@sort_buffer_size; SET @save_innodb_file_format= @@innodb_file_format; SET @save_innodb_large_prefix= @@innodb_large_prefix; SET sort_buffer_size=2048; -SET GLOBAL innodb_file_format = BARRACUDA; -SET GLOBAL innodb_large_prefix = ON; CREATE TABLE t1 ( a VARCHAR(1024) CHARACTER SET UTF8 PRIMARY KEY, b INT, @@ -826,7 +824,7 @@ INDEX (b) INSERT INTO t1 SELECT seq, seq, seq from seq_1_to_100; EXPLAIN SELECT * FROM t1 WHERE a='1' OR b < 5; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge PRIMARY,b b,PRIMARY 5,3074 NULL 4 Using sort_union(b,PRIMARY); Using where +1 SIMPLE t1 index_merge PRIMARY,b b,PRIMARY 5,3074 NULL 5 Using sort_union(b,PRIMARY); Using where SELECT * FROM t1 WHERE a='1' OR b < 5; a b c 2 2 2 @@ -834,7 +832,5 @@ a b c 4 4 4 1 1 1 DROP TABLE t1; -SET GLOBAL innodb_file_format = @save_innodb_file_format; -SET GLOBAL innodb_large_prefix = @save_innodb_large_prefix; SET sort_buffer_size= @save_sort_buffer_size; disconnect disable_purge; diff --git a/mysql-test/t/index_merge_innodb.test b/mysql-test/t/index_merge_innodb.test index 3acb8b6c4aa..2713daff034 100644 --- a/mysql-test/t/index_merge_innodb.test +++ b/mysql-test/t/index_merge_innodb.test @@ -208,8 +208,6 @@ SET @save_sort_buffer_size=@@sort_buffer_size; SET @save_innodb_file_format= @@innodb_file_format; SET @save_innodb_large_prefix= @@innodb_large_prefix; SET sort_buffer_size=2048; -SET GLOBAL innodb_file_format = BARRACUDA; -SET GLOBAL innodb_large_prefix = ON; CREATE TABLE t1 ( a VARCHAR(1024) CHARACTER SET UTF8 PRIMARY KEY, @@ -222,8 +220,6 @@ EXPLAIN SELECT * FROM t1 WHERE a='1' OR b < 5; SELECT * FROM t1 WHERE a='1' OR b < 5; DROP TABLE t1; -SET GLOBAL innodb_file_format = @save_innodb_file_format; -SET GLOBAL innodb_large_prefix = @save_innodb_large_prefix; SET sort_buffer_size= @save_sort_buffer_size; disconnect disable_purge; diff --git a/sql/uniques.h b/sql/uniques.h index 7cdf6607dd0..a4f5b378fb0 100644 --- a/sql/uniques.h +++ b/sql/uniques.h @@ -85,6 +85,9 @@ public: { size_t max_elems_in_tree= max_in_memory_size / ALIGN_SIZE(sizeof(TREE_ELEMENT)+key_size); + + if (max_elems_in_tree == 0) + max_elems_in_tree= 1; return (int) (sizeof(uint)*(1 + nkeys/max_elems_in_tree)); }