summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem@mysql.com>2009-08-25 17:53:43 +0200
committerGuilhem Bichot <guilhem@mysql.com>2009-08-25 17:53:43 +0200
commit0e8f2efa6eef217c64c47e3c24e7b90fe16957d0 (patch)
tree4dabe801fcdcc80e35a7107e1a622c74c1b9ff52
parentfe4ae6b0584c7bd4c1425c4a9707b12e87a1e625 (diff)
downloadmariadb-git-0e8f2efa6eef217c64c47e3c24e7b90fe16957d0.tar.gz
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.
-rw-r--r--mysql-test/include/index_merge2.inc8
-rw-r--r--mysql-test/r/index_merge_innodb.result4
-rw-r--r--mysql-test/t/index_merge_innodb.test6
3 files changed, 16 insertions, 2 deletions
diff --git a/mysql-test/include/index_merge2.inc b/mysql-test/include/index_merge2.inc
index d65115eac0f..9b98eb3ebf2 100644
--- a/mysql-test/include/index_merge2.inc
+++ b/mysql-test/include/index_merge2.inc
@@ -122,12 +122,20 @@ insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b)
analyze table t1;
select count(*) from t1;
+if ($index_merge_random_rows_in_EXPLAIN)
+{
+ --replace_column 9 #
+}
explain select count(*) from t1 where
key1a = 2 and key1b is null and key2a = 2 and key2b is null;
select count(*) from t1 where
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
key1a = 2 and key1b is null and key3a = 2 and key3b is null;
diff --git a/mysql-test/r/index_merge_innodb.result b/mysql-test/r/index_merge_innodb.result
index 588de70e6e5..71b81d6acd2 100644
--- a/mysql-test/r/index_merge_innodb.result
+++ b/mysql-test/r/index_merge_innodb.result
@@ -111,7 +111,7 @@ count(*)
explain select count(*) from t1 where
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
-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
key1a = 2 and key1b is null and key2a = 2 and key2b is null;
count(*)
@@ -119,7 +119,7 @@ count(*)
explain select count(*) from t1 where
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
-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
key1a = 2 and key1b is null and key3a = 2 and key3b is null;
count(*)
diff --git a/mysql-test/t/index_merge_innodb.test b/mysql-test/t/index_merge_innodb.test
index a3bda0ad00c..04516f45bfe 100644
--- a/mysql-test/t/index_merge_innodb.test
+++ b/mysql-test/t/index_merge_innodb.test
@@ -12,6 +12,12 @@
--source include/have_innodb.inc
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)
let $merge_table_support= 0;