Skip to content

Commit

Permalink
Fix wrong merge of commit d218d1a
Browse files Browse the repository at this point in the history
  • Loading branch information
cvicentiu committed Jun 12, 2020
1 parent 8c67fff commit 2fd2fd7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
6 changes: 1 addition & 5 deletions mysql-test/r/index_merge_innodb.result
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -826,15 +824,13 @@ 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
3 3 3
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;
4 changes: 0 additions & 4 deletions mysql-test/t/index_merge_innodb.test
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
3 changes: 3 additions & 0 deletions sql/uniques.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ class Unique :public Sql_alloc
{
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));
}

Expand Down

0 comments on commit 2fd2fd7

Please sign in to comment.