summaryrefslogtreecommitdiff
path: root/mysql-test/t/merge.test
diff options
context:
space:
mode:
authoringo@mysql.com <>2005-09-23 10:15:11 +0200
committeringo@mysql.com <>2005-09-23 10:15:11 +0200
commit4025d2965b5f978461ac51c6c6eca40e599429fc (patch)
treecc4780b69204be49c89964f8598a382e90523fe0 /mysql-test/t/merge.test
parenta8bdf632d3cd52d97f2c9fac3cc87c257b080982 (diff)
downloadmariadb-git-4025d2965b5f978461ac51c6c6eca40e599429fc.tar.gz
Bug#9112 - Merge table with composite index producing invalid results with some queries
The problem was an ab-use of last_rkey_length. Formerly we saved the packed key length (of the search key) in this element. But in certain cases it got replaced by the (packed) result key length. Now we use a new element of MI_INFO to save the packed key length of the search key.
Diffstat (limited to 'mysql-test/t/merge.test')
-rw-r--r--mysql-test/t/merge.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 57770dc0a0b..4c1d10b47e3 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -264,3 +264,36 @@ create table t3 engine=merge union=(t1, t2) select * from t1;
--error 1093
create table t3 engine=merge union=(t1, t2) select * from t2;
drop table t1, t2;
+
+#
+# Bug#9112 - Merge table with composite index producing invalid results with some queries
+# This test case will fail only without the bugfix and some
+# non-deterministic circumstances. It depends on properly initialized
+# "un-initialized" memory. At the time it happens with a standard
+# non-debug build. But there is no guarantee that this will be always so.
+#
+create table t1 (
+ a double(16,6),
+ b varchar(10),
+ index (a,b)
+) engine=merge union=(t2,t3);
+
+create table t2 (
+ a double(16,6),
+ b varchar(10),
+ index (a,b)
+) engine=myisam;
+
+create table t3 (
+ a double(16,6),
+ b varchar(10),
+ index (a,b)
+) engine=myisam;
+
+insert into t2 values ( null, '');
+insert into t2 values ( 9999999999.999999, '');
+insert into t3 select * from t2;
+select min(a), max(a) from t1;
+flush tables;
+select min(a), max(a) from t1;
+drop table t1, t2, t3;