MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Jorgen Loland Date:September 25 2009 1:24pm
Subject:bzr commit into mysql-6.0-bugfixing branch (jorgen.loland:2841) Bug#46733
View as plain text  
#At file:///localhome/jl208045/mysql/mysql-6.0-codebase-bugfixing-46733/ based on revid:jorgen.loland@stripped

 2841 Jorgen Loland	2009-09-25
      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	2009-09-25 12:19:01 +0000
+++ b/mysql-test/r/join_cache.result	2009-09-25 13:24:51 +0000
@@ -4028,3 +4028,34 @@ id	select_type	table	type	possible_keys	
 DROP TABLE t1,t2;
 SET join_cache_level=default;
 #
+# 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 t1.v=t2.v ;
+MAX(t1.i)
+NULL
+
+EXPLAIN
+SELECT MAX(t1.i) 
+FROM t1 JOIN t2 ON t1.v=t2.v ;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t2	ALL	NULL	NULL	NULL	NULL	2	
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	4	Using where; Using join buffer
+
+DROP TABLE t1,t2;
+#

=== modified file 'mysql-test/t/join_cache.test'
--- a/mysql-test/t/join_cache.test	2009-09-25 12:19:01 +0000
+++ b/mysql-test/t/join_cache.test	2009-09-25 13:24:51 +0000
@@ -1688,4 +1688,41 @@ DROP TABLE t1,t2;
 SET join_cache_level=default;
 
 --echo #
+--echo # Regression test for
+--echo # Bug#46733 - NULL value not returned for aggregate on empty result 
+--echo #             set w/ semijoin on
+--echo #
+
+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 t1.v=t2.v ;
+
+--echo
+
+EXPLAIN
+SELECT MAX(t1.i) 
+FROM t1 JOIN t2 ON t1.v=t2.v ;
+
+--echo
+
+DROP TABLE t1,t2;
+
+--echo #
 


Attachment: [text/bzr-bundle] bzr/jorgen.loland@sun.com-20090925132451-nuabutzb01ic0yhq.bundle
Thread
bzr commit into mysql-6.0-bugfixing branch (jorgen.loland:2841) Bug#46733Jorgen Loland25 Sep
  • Re: bzr commit into mysql-6.0-bugfixing branch (jorgen.loland:2841)Bug#46733Øystein Grøvlen25 Sep
    • Re: bzr commit into mysql-6.0-bugfixing branch (jorgen.loland:2841)Bug#46733Øystein Grøvlen28 Sep