List:Commits« Previous MessageNext Message »
From:Oystein.Grovlen Date:May 6 2010 7:42pm
Subject:bzr commit into mysql-next-mr-bugfixing branch (oystein.grovlen:3139)
Bug#46733
View as plain text  
#At file:///home/oysteing/mysql/mysql-next-mr-opt-backporting/ based on revid:roy.lyseng@stripped

 3139 oystein.grovlen@stripped	2010-05-06
      Bug#46733 - NULL value not returned for aggregate on empty result 
                  set w/ semijoin on
      
      Issue was fixed by BUG#46328. This patch adds a regression test
      for the query that was reported in BUG#46733.
     @ mysql-test/r/join_cache.result
        Add regression test for BUG#46733
     @ mysql-test/t/join_cache.test
        Add regression test for BUG#46733

    modified:
      mysql-test/r/join_cache.result
      mysql-test/t/join_cache.test
=== modified file 'mysql-test/r/join_cache.result'
--- a/mysql-test/r/join_cache.result	2010-05-06 14:11:28 +0000
+++ b/mysql-test/r/join_cache.result	2010-05-06 19:42:45 +0000
@@ -4018,3 +4018,38 @@ c1	c2	c1	c2	LENGTH(t2.c1)	LENGTH(t2.c2)
 2	2	tt	uu	2	2
 set join_cache_level=default;
 DROP TABLE t1,t2;
+#
+# Regression test for
+# Bug#46733 - NULL value not returned for aggregate on empty result 
+#             set w/ semijoin on
+CREATE TABLE t1 (
+i int(11) NOT NULL,
+v varchar(1) DEFAULT NULL,
+PRIMARY KEY (i)
+);
+INSERT INTO t1 VALUES (10,'a'),(11,'b'),(12,'c'),(13,'d');
+CREATE TABLE t2 (
+i int(11) NOT NULL,
+v varchar(1) DEFAULT NULL,
+PRIMARY KEY (i)
+);
+INSERT INTO t2 VALUES (1,'x'),(2,'y');
+
+SELECT MAX(t1.i) 
+FROM t1 JOIN t2 ON t2.v
+ORDER BY t2.v;
+MAX(t1.i)
+NULL
+Warnings:
+Warning	1292	Truncated incorrect INTEGER value: 'x'
+Warning	1292	Truncated incorrect INTEGER value: 'y'
+
+EXPLAIN
+SELECT MAX(t1.i) 
+FROM t1 JOIN t2 ON t2.v
+ORDER BY t2.v;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	2	Using where
+1	SIMPLE	t1	index	NULL	PRIMARY	4	NULL	4	Using index; Using join buffer
+
+DROP TABLE t1,t2;

=== modified file 'mysql-test/t/join_cache.test'
--- a/mysql-test/t/join_cache.test	2010-05-06 14:11:28 +0000
+++ b/mysql-test/t/join_cache.test	2010-05-06 19:42:45 +0000
@@ -1686,3 +1686,42 @@ set join_cache_level=default;
 
 DROP TABLE t1,t2;
 
+--echo #
+--echo # Regression test for
+--echo # Bug#46733 - NULL value not returned for aggregate on empty result 
+--echo #             set w/ semijoin on
+CREATE TABLE t1 (
+  i int(11) NOT NULL,
+  v varchar(1) DEFAULT NULL,
+  PRIMARY KEY (i)
+);
+
+INSERT INTO t1 VALUES (10,'a'),(11,'b'),(12,'c'),(13,'d');
+
+CREATE TABLE t2 (
+  i int(11) NOT NULL,
+  v varchar(1) DEFAULT NULL,
+  PRIMARY KEY (i)
+);
+
+INSERT INTO t2 VALUES (1,'x'),(2,'y');
+
+--echo
+
+SELECT MAX(t1.i) 
+FROM t1 JOIN t2 ON t2.v
+ORDER BY t2.v;
+
+--echo
+
+EXPLAIN
+SELECT MAX(t1.i) 
+FROM t1 JOIN t2 ON t2.v
+ORDER BY t2.v;
+
+--echo
+
+DROP TABLE t1,t2;
+
+
+


Attachment: [text/bzr-bundle]
Thread
bzr commit into mysql-next-mr-bugfixing branch (oystein.grovlen:3139)Bug#46733Oystein.Grovlen6 May