summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2002-06-15 20:59:42 +0300
committerunknown <Sinisa@sinisa.nasamreza.org>2002-06-15 20:59:42 +0300
commitfc12cafff26e9372568c71b91ee73680c77605d4 (patch)
tree9843d9f75a46bd100e12e4677570ece39501909c /mysql-test
parent1986f3b64d0f46fffb89bcc914e1715c80259dc9 (diff)
downloadmariadb-git-fc12cafff26e9372568c71b91ee73680c77605d4.tar.gz
Fixed a bug in optimiser with MERGE tables with non-unique values
with aggregating functions. This consistently crashed Mysql
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/merge.result9
-rw-r--r--mysql-test/t/merge.test7
2 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 9b72ff26350..1e657883253 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -462,3 +462,12 @@ a b
6 1
6 2
drop table if exists t6, t5, t4, t3, t2, t1;
+CREATE TABLE t1 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) TYPE=MyISAM;
+INSERT INTO t1 VALUES (1,1), (2,1);
+CREATE TABLE t2 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) TYPE=MyISAM;
+INSERT INTO t2 VALUES (1,2), (2,2);
+CREATE TABLE t ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', KEY a (a,b)) TYPE=MRG_MyISAM UNION=(t1,t2);
+select max(b) from t where a = 2;
+max(b)
+NULL
+drop table if exists t,t1,t2;
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 5bd78769a05..de26d7eb1d3 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -168,3 +168,10 @@ select * from t3 order by a,b;
select * from t4 order by a,b;
select * from t5 order by a,b;
drop table if exists t6, t5, t4, t3, t2, t1;
+CREATE TABLE t1 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) TYPE=MyISAM;
+INSERT INTO t1 VALUES (1,1), (2,1);
+CREATE TABLE t2 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) TYPE=MyISAM;
+INSERT INTO t2 VALUES (1,2), (2,2);
+CREATE TABLE t ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', KEY a (a,b)) TYPE=MRG_MyISAM UNION=(t1,t2);
+select max(b) from t where a = 2;
+drop table if exists t,t1,t2;