List:Commits« Previous MessageNext Message »
From:Sergey Petrunia Date:April 28 2008 7:15pm
Subject:bk commit into 5.1 tree (sergefp:1.2582) BUG#36135
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of sergefp.  When sergefp 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, 2008-04-28 21:15:30+04:00, sergefp@stripped +3 -0
  BUG#36135: void Diagnostics_area::set_eof_status(THD*): Assertion `! is_set()' failed.
  - Before sending EOF, check if we've already sent an error.

  mysql-test/r/subselect3.result@stripped, 2008-04-28 21:15:22+04:00, sergefp@stripped +27 -1
    BUG#36135: void Diagnostics_area::set_eof_status(THD*): Assertion `! is_set()' failed.
    - Testcase

  mysql-test/t/subselect3.test@stripped, 2008-04-28 21:15:22+04:00, sergefp@stripped +40 -1
    BUG#36135: void Diagnostics_area::set_eof_status(THD*): Assertion `! is_set()' failed.
    - Testcase

  sql/sql_class.cc@stripped, 2008-04-28 21:15:22+04:00, sergefp@stripped +6 -0
    BUG#36135: void Diagnostics_area::set_eof_status(THD*): Assertion `! is_set()' failed.
    - Before sending EOF, check if we've already sent an error.

diff -Nrup a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result
--- a/mysql-test/r/subselect3.result	2008-04-23 10:03:47 +04:00
+++ b/mysql-test/r/subselect3.result	2008-04-28 21:15:22 +04:00
@@ -1,4 +1,4 @@
-drop table if exists t0, t1, t2, t3, t4;
+drop table if exists t0, t1, t2, t3, t4, t5;
 create table t1 (oref int, grp int, ie int) ;
 insert into t1 (oref, grp, ie) values
 (1, 1, 1),
@@ -780,3 +780,29 @@ SELECT 1 FROM t1 WHERE t1.a NOT IN (SELE
 1
 DROP TABLE t1, t2;
 End of 5.0 tests
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (
+a int(11) default null,
+b int(11) default null,
+key (a)
+);
+insert into t1 select A.a+10*(B.a+10*C.a),A.a+10*(B.a+10*C.a) from t0 A, t0 B, t0 C;
+create table t2 (a int(11) default null);
+insert into t2 values (0),(1);
+create table t3 (a int(11) default null);
+insert into t3 values (0),(1);
+create table t4 (a int(11) default null);
+insert into t4 values (0),(1);
+create table t5 (a int(11) default null);
+insert into t5 values (0),(1),(0),(1);
+select * from t2, t3 
+where
+t2.a < 10 and
+t3.a+1 = 2 and
+t3.a in (select t1.b from t1
+where t1.a+1=t1.a+1 and
+t1.a < (select t4.a+10                                  
+from t4, t5 limit 2));
+ERROR 21000: Subquery returns more than 1 row
+drop table t0, t1, t2, t3, t4, t5;
diff -Nrup a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test
--- a/mysql-test/t/subselect3.test	2008-04-23 10:03:47 +04:00
+++ b/mysql-test/t/subselect3.test	2008-04-28 21:15:22 +04:00
@@ -1,5 +1,5 @@
 --disable_warnings
-drop table if exists t0, t1, t2, t3, t4;
+drop table if exists t0, t1, t2, t3, t4, t5;
 --enable_warnings
 
 #
@@ -619,3 +619,42 @@ SELECT 1 FROM t1 WHERE t1.a NOT IN (SELE
 DROP TABLE t1, t2;
 
 --echo End of 5.0 tests
+
+#
+# BUG#36135 "void Diagnostics_area::set_eof_status(THD*): Assertion `!is_set()' failed."
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1 (
+  a int(11) default null,
+  b int(11) default null,
+  key (a)
+);
+# produce numbers 0..999
+insert into t1 select A.a+10*(B.a+10*C.a),A.a+10*(B.a+10*C.a) from t0 A, t0 B, t0 C;
+
+create table t2 (a int(11) default null);
+insert into t2 values (0),(1);
+
+create table t3 (a int(11) default null);
+insert into t3 values (0),(1);
+
+create table t4 (a int(11) default null);
+insert into t4 values (0),(1);
+
+create table t5 (a int(11) default null);
+insert into t5 values (0),(1),(0),(1);
+
+# this must not fail assertion
+--error 1242
+select * from t2, t3 
+where
+    t2.a < 10 and
+    t3.a+1 = 2 and
+    t3.a in (select t1.b from t1
+                 where t1.a+1=t1.a+1 and
+                       t1.a < (select t4.a+10                                  
+                                  from t4, t5 limit 2));
+
+drop table t0, t1, t2, t3, t4, t5;
diff -Nrup a/sql/sql_class.cc b/sql/sql_class.cc
--- a/sql/sql_class.cc	2008-03-30 15:12:23 +04:00
+++ b/sql/sql_class.cc	2008-04-28 21:15:22 +04:00
@@ -1566,6 +1566,12 @@ bool select_send::send_eof()
     mysql_unlock_tables(thd, thd->lock);
     thd->lock=0;
   }
+  /* 
+    Don't send EOF if we're in error condition (which implies we've already
+    sent or are sending an error)
+  */
+  if (thd->is_error())
+    return TRUE;
   ::my_eof(thd);
   is_result_set_started= 0;
   return FALSE;
Thread
bk commit into 5.1 tree (sergefp:1.2582) BUG#36135Sergey Petrunia28 Apr