Commit 24ebb184 authored by Guilhem Bichot's avatar Guilhem Bichot

fix for Bug#46897 'Test "index_merge_innodb" fails (mostly)':

that was already analyzed by Oracle: EXPLAIN can return 3 or 4 in "rows"; using replace_column to work around this.

mysql-test/include/index_merge2.inc:
  replace "rows" column of some EXPLAINs by "#", if told so
mysql-test/r/index_merge_innodb.result:
  result update
mysql-test/t/index_merge_innodb.test:
  tell index_merge2.inc to accept random "rows" values in some EXPLAINs; we don't do this in index_merge_myisam.test
  which has no randomness here.
parent c3b2933b
...@@ -122,12 +122,20 @@ insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) ...@@ -122,12 +122,20 @@ insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b)
analyze table t1; analyze table t1;
select count(*) from t1; select count(*) from t1;
if ($index_merge_random_rows_in_EXPLAIN)
{
--replace_column 9 #
}
explain select count(*) from t1 where explain select count(*) from t1 where
key1a = 2 and key1b is null and key2a = 2 and key2b is null; key1a = 2 and key1b is null and key2a = 2 and key2b is null;
select count(*) from t1 where select count(*) from t1 where
key1a = 2 and key1b is null and key2a = 2 and key2b is null; key1a = 2 and key1b is null and key2a = 2 and key2b is null;
if ($index_merge_random_rows_in_EXPLAIN)
{
--replace_column 9 #
}
explain select count(*) from t1 where explain select count(*) from t1 where
key1a = 2 and key1b is null and key3a = 2 and key3b is null; key1a = 2 and key1b is null and key3a = 2 and key3b is null;
......
...@@ -111,7 +111,7 @@ count(*) ...@@ -111,7 +111,7 @@ count(*)
explain select count(*) from t1 where explain select count(*) from t1 where
key1a = 2 and key1b is null and key2a = 2 and key2b is null; key1a = 2 and key1b is null and key2a = 2 and key2b is null;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge i1,i2 i1,i2 10,10 NULL 4 Using intersect(i1,i2); Using where; Using index 1 SIMPLE t1 index_merge i1,i2 i1,i2 10,10 NULL # Using intersect(i1,i2); Using where; Using index
select count(*) from t1 where select count(*) from t1 where
key1a = 2 and key1b is null and key2a = 2 and key2b is null; key1a = 2 and key1b is null and key2a = 2 and key2b is null;
count(*) count(*)
...@@ -119,7 +119,7 @@ count(*) ...@@ -119,7 +119,7 @@ count(*)
explain select count(*) from t1 where explain select count(*) from t1 where
key1a = 2 and key1b is null and key3a = 2 and key3b is null; key1a = 2 and key1b is null and key3a = 2 and key3b is null;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge i1,i3 i1,i3 10,10 NULL 4 Using intersect(i1,i3); Using where; Using index 1 SIMPLE t1 index_merge i1,i3 i1,i3 10,10 NULL # Using intersect(i1,i3); Using where; Using index
select count(*) from t1 where select count(*) from t1 where
key1a = 2 and key1b is null and key3a = 2 and key3b is null; key1a = 2 and key1b is null and key3a = 2 and key3b is null;
count(*) count(*)
......
...@@ -12,6 +12,12 @@ ...@@ -12,6 +12,12 @@
--source include/have_innodb.inc --source include/have_innodb.inc
let $engine_type= InnoDB; let $engine_type= InnoDB;
# According to Oracle: "InnoDB's estimate for the index cardinality
# depends on a pseudo random number generator (it picks up random
# pages to sample). After an optimization that was made in r2625 two
# EXPLAINs started returning a different number of rows (3 instead of
# 4)", so:
let $index_merge_random_rows_in_EXPLAIN = 1;
# InnoDB does not support Merge tables (affects include/index_merge1.inc) # InnoDB does not support Merge tables (affects include/index_merge1.inc)
let $merge_table_support= 0; let $merge_table_support= 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment