List:Commits« Previous MessageNext Message »
From:Kristofer Pettersson Date:June 8 2010 11:51am
Subject:bzr commit into mysql-5.1-bugteam branch (kristofer.pettersson:3420)
View as plain text  
#At file:///Users/thek/Development/mysql-5.1-bugteam/ based on revid:kristofer.pettersson@stripped

 3420 Kristofer Pettersson	2010-06-08 [merge]
      automerge

    modified:
      mysql-test/r/func_isnull.result
      mysql-test/t/func_isnull.test
      sql/item_cmpfunc.h
=== modified file 'mysql-test/r/func_isnull.result'
--- a/mysql-test/r/func_isnull.result	2002-05-16 20:35:09 +0000
+++ b/mysql-test/r/func_isnull.result	2010-06-08 06:22:40 +0000
@@ -5,3 +5,17 @@ flush tables;
 select * from t1 where isnull(to_days(mydate));
 id	mydate
 drop table t1;
+#
+# Bug#53933 crash when using uncacheable subquery in the having clause of outer query
+#
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (0),(0);
+SELECT ISNULL((SELECT GET_LOCK('Bug#53933', 0) FROM t1 GROUP BY f1)) AS f2
+FROM t1 GROUP BY f1 HAVING f2 = f2;
+f2
+0
+SELECT RELEASE_LOCK('Bug#53933');
+RELEASE_LOCK('Bug#53933')
+1
+DROP TABLE t1;
+End of 5.0 tests

=== modified file 'mysql-test/t/func_isnull.test'
--- a/mysql-test/t/func_isnull.test	2005-07-28 00:22:47 +0000
+++ b/mysql-test/t/func_isnull.test	2010-06-08 06:22:40 +0000
@@ -13,3 +13,18 @@ select * from t1 where isnull(to_days(my
 drop table t1;
 
 # End of 4.1 tests
+
+--echo #
+--echo # Bug#53933 crash when using uncacheable subquery in the having clause of outer query
+--echo #
+
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (0),(0);
+
+SELECT ISNULL((SELECT GET_LOCK('Bug#53933', 0) FROM t1 GROUP BY f1)) AS f2
+FROM t1 GROUP BY f1 HAVING f2 = f2;
+SELECT RELEASE_LOCK('Bug#53933');
+
+DROP TABLE t1;
+
+--echo End of 5.0 tests

=== modified file 'sql/item_cmpfunc.h'
--- a/sql/item_cmpfunc.h	2010-04-16 11:42:34 +0000
+++ b/sql/item_cmpfunc.h	2010-06-08 06:28:30 +0000
@@ -1313,8 +1313,8 @@ public:
     else
     {
       args[0]->update_used_tables();
-      if ((const_item_cache= !(used_tables_cache= args[0]->used_tables())) &&
-          !with_subselect)
+      if ((const_item_cache= !(used_tables_cache= args[0]->used_tables()) &&
+          !with_subselect))
       {
 	/* Remember if the value is always NULL or never NULL */
 	cached_value= (longlong) args[0]->is_null();


Attachment: [text/bzr-bundle]
Thread
bzr commit into mysql-5.1-bugteam branch (kristofer.pettersson:3420)Kristofer Pettersson8 Jun