List:Commits« Previous MessageNext Message »
From:kgeorge Date:October 30 2007 12:27pm
Subject:bk commit into 5.0 tree (gkodinov:1.2554) BUG#31884
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kgeorge. When kgeorge does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-10-30 14:27:21+02:00, gkodinov@stripped +3 -0
  Bug #31884: Assertion + crash in subquery in the SELECT clause.
  
  Item_in_subselect's only externally callable method is val_bool().
  However the nullability in the wrapper class (Item_in_optimizer) is 
  established by calling the "forbidden" method val_int().
  
  Fixed to use the correct method (val_bool() ) to establish nullability 
  of Item_in_subselect in Item_in_optimizer.

  mysql-test/r/subselect.result@stripped, 2007-10-30 14:27:19+02:00, gkodinov@stripped +11 -0
    Bug #31884: test case

  mysql-test/t/subselect.test@stripped, 2007-10-30 14:27:19+02:00, gkodinov@stripped +15 -0
    Bug #31884: test case

  sql/item_subselect.h@stripped, 2007-10-30 14:27:19+02:00, gkodinov@stripped +1 -0
    Bug #31884: Use the correct method to establish nullability

diff -Nrup a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
--- a/mysql-test/r/subselect.result	2007-06-29 10:39:15 +03:00
+++ b/mysql-test/r/subselect.result	2007-10-30 14:27:19 +02:00
@@ -4139,4 +4139,15 @@ SELECT (SELECT SUM(t1.a) FROM t2 WHERE a
 (SELECT SUM(t1.a) FROM t2 WHERE a=1)
 3
 DROP TABLE t1,t2;
+CREATE TABLE t1 (a1 INT, a2 INT);
+CREATE TABLE t2 (b1 INT, b2 INT);
+INSERT INTO t1 VALUES (100, 200);
+INSERT INTO t1 VALUES (101, 201);
+INSERT INTO t2 VALUES (101, 201);
+INSERT INTO t2 VALUES (103, 203);
+SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1;
+((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL
+0
+0
+DROP TABLE t1, t2;
 End of 5.0 tests.
diff -Nrup a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
--- a/mysql-test/t/subselect.test	2007-06-29 10:39:15 +03:00
+++ b/mysql-test/t/subselect.test	2007-10-30 14:27:19 +02:00
@@ -2987,4 +2987,19 @@ SELECT (SELECT SUM(t1.a) FROM t2 WHERE a
 SELECT (SELECT SUM(t1.a) FROM t2 WHERE a=1) FROM t1;
 DROP TABLE t1,t2;
 
+#
+# Bug #31884: Assertion + crash in subquery in the SELECT clause.
+#
+
+CREATE TABLE t1 (a1 INT, a2 INT);
+CREATE TABLE t2 (b1 INT, b2 INT);
+
+INSERT INTO t1 VALUES (100, 200);
+INSERT INTO t1 VALUES (101, 201);
+INSERT INTO t2 VALUES (101, 201);
+INSERT INTO t2 VALUES (103, 203);
+
+SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1;
+DROP TABLE t1, t2;
+
 --echo End of 5.0 tests.
diff -Nrup a/sql/item_subselect.h b/sql/item_subselect.h
--- a/sql/item_subselect.h	2007-04-26 17:31:19 +03:00
+++ b/sql/item_subselect.h	2007-10-30 14:27:19 +02:00
@@ -306,6 +306,7 @@ public:
   double val_real();
   String *val_str(String*);
   my_decimal *val_decimal(my_decimal *);
+  void update_null_value () { (void) val_bool(); }
   bool val_bool();
   void top_level_item() { abort_on_null=1; }
   inline bool is_top_level_item() { return abort_on_null; }
Thread
bk commit into 5.0 tree (gkodinov:1.2554) BUG#31884kgeorge30 Oct
  • Re: bk commit into 5.0 tree (gkodinov:1.2554) BUG#31884Timour Katchaounov30 Oct