List:Commits« Previous MessageNext Message »
From:Joerg Bruehe Date:June 24 2008 5:49pm
Subject:bzr push into mysql-5.1 branch (joerg:2656 to 2658)
View as plain text  
 2658 Joerg Bruehe	2008-06-24 [merge]
      Merge from 5.1 main tree.
added:
  mysql-test/suite/bugs/r/rpl_bug33029.result
  mysql-test/suite/bugs/t/rpl_bug33029.test
modified:
  client/mysql.cc
  configure.in
  mysql-test/r/mysql.result
  mysql-test/t/mysql_delimiter.sql
  sql/slave.cc
  sql/sql_class.cc
  sql/structs.h

 2657 Joerg Bruehe	2008-06-20 [merge]
      Pull some bug fixes from the main tree.
modified:
  client/mysql.cc
  mysql-test/r/subselect.result
  mysql-test/suite/rpl/t/disabled.def
  mysql-test/t/subselect.test
  sql/sql_select.cc
  storage/innobase/Makefile.am

 2656 Joerg Bruehe	2008-06-19 [merge]
      Pull main tree into build team tree.
modified:
  mysql-test/r/repair.result
  scripts/make_binary_distribution.sh
  sql/sql_table.cc

=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2008-03-28 18:20:21 +0000
+++ b/client/mysql.cc	2008-06-20 16:58:14 +0000
@@ -1821,7 +1821,7 @@ static int read_and_execute(bool interac
         the very beginning of a text file when
         you save the file using "Unicode UTF-8" format.
       */
-      if (!line_number &&
+      if (line && !line_number &&
            (uchar) line[0] == 0xEF &&
            (uchar) line[1] == 0xBB &&
            (uchar) line[2] == 0xBF)
@@ -2101,37 +2101,6 @@ static bool add_line(String &buffer,char
 	continue;
       }
     }
-    else if (!*ml_comment && !*in_string &&
-             (end_of_line - pos) >= 10 &&
-             !my_strnncoll(charset_info, (uchar*) pos, 10,
-                           (const uchar*) "delimiter ", 10))
-    {
-      // Flush previously accepted characters
-      if (out != line)
-      {
-        buffer.append(line, (uint32) (out - line));
-        out= line;
-      }
-
-      // Flush possible comments in the buffer
-      if (!buffer.is_empty())
-      {
-        if (com_go(&buffer, 0) > 0) // < 0 is not fatal
-          DBUG_RETURN(1);
-        buffer.length(0);
-      }
-
-      /*
-        Delimiter wants the get rest of the given line as argument to
-        allow one to change ';' to ';;' and back
-      */
-      buffer.append(pos);
-      if (com_delimiter(&buffer, pos) > 0)
-        DBUG_RETURN(1);
-
-      buffer.length(0);
-      break;
-    }
     else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter))
     {
       // Found a statement. Continue parsing after the delimiter

=== modified file 'configure.in'
--- a/configure.in	2008-05-21 07:59:58 +0000
+++ b/configure.in	2008-06-20 17:06:03 +0000
@@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
 #
 # When changing major version number please also check switch statement
 # in mysqlbinlog::check_master_version().
-AM_INIT_AUTOMAKE(mysql, 5.1.26-rc)
+AM_INIT_AUTOMAKE(mysql, 5.1.27)
 AM_CONFIG_HEADER([include/config.h:config.h.in])
 
 PROTOCOL_VERSION=10

=== modified file 'mysql-test/r/mysql.result'
--- a/mysql-test/r/mysql.result	2007-11-26 18:50:43 +0000
+++ b/mysql-test/r/mysql.result	2008-06-20 16:58:14 +0000
@@ -38,6 +38,8 @@ t2
 t3
 Tables_in_test
 t1
+delimiter
+1
 _
 Test delimiter : from command line
 a

=== modified file 'mysql-test/r/subselect.result'
--- a/mysql-test/r/subselect.result	2008-05-16 16:28:24 +0000
+++ b/mysql-test/r/subselect.result	2008-06-19 03:08:41 +0000
@@ -4391,3 +4391,10 @@ SELECT * FROM t1 WHERE _utf8'a' = ANY (S
 s1
 a
 DROP TABLE t1;
+CREATE TABLE t1(c int, KEY(c));
+CREATE TABLE t2(a int, b int);
+INSERT INTO t2 VALUES (1, 10), (2, NULL);
+INSERT INTO t1 VALUES (1), (3);
+SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10);
+a	b
+DROP TABLE t1,t2;

=== added file 'mysql-test/suite/bugs/r/rpl_bug33029.result'
--- a/mysql-test/suite/bugs/r/rpl_bug33029.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/bugs/r/rpl_bug33029.result	2008-06-19 18:47:59 +0000
@@ -0,0 +1,15 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+create table `t1` (`id` int not null auto_increment primary key);
+create trigger `trg` before insert on `t1` for each row begin end;
+set @@global.debug="+d,simulate_bug33029";
+stop slave;
+start slave;
+insert into `t1` values ();
+select * from t1;
+id
+1

=== added file 'mysql-test/suite/bugs/t/rpl_bug33029.test'
--- a/mysql-test/suite/bugs/t/rpl_bug33029.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/bugs/t/rpl_bug33029.test	2008-06-19 18:47:59 +0000
@@ -0,0 +1,25 @@
+#
+# Bug #36443 Server crashes when executing insert when insert trigger on table
+#
+# Emulating the former bug#33029 situation to see that there is no crash anymore.
+# 
+
+
+source include/master-slave.inc;
+
+create table `t1` (`id` int not null auto_increment primary key);
+create trigger `trg` before insert on `t1` for each row begin end;
+
+sync_slave_with_master;
+set @@global.debug="+d,simulate_bug33029";
+
+stop slave;
+start slave;
+
+connection master;
+
+insert into `t1` values ();
+
+sync_slave_with_master;
+select * from t1;
+

=== modified file 'mysql-test/suite/rpl/t/disabled.def'
--- a/mysql-test/suite/rpl/t/disabled.def	2008-05-19 06:38:53 +0000
+++ b/mysql-test/suite/rpl/t/disabled.def	2008-06-19 10:39:48 +0000
@@ -12,3 +12,4 @@
 
 rpl_redirect               : Failure is sporadic and and the test is superfluous (mats)
 rpl_innodb_bug28430        : Failure on Solaris Bug #36793
+rpl_server_id1             : Bug #36818 rpl_server_id1 fails expecting slave has stopped
(azundris)

=== modified file 'mysql-test/t/mysql_delimiter.sql'
--- a/mysql-test/t/mysql_delimiter.sql	2006-11-22 06:27:06 +0000
+++ b/mysql-test/t/mysql_delimiter.sql	2008-06-20 16:58:14 +0000
@@ -59,3 +59,9 @@ source t/mysql_delimiter_19799.sql
 use test//
 show tables//
 delimiter ; # Reset delimiter
+
+#
+# Bug #33812: mysql client incorrectly parsing DELIMITER
+#
+select a as delimiter from t1
+delimiter ; # Reset delimiter

=== modified file 'mysql-test/t/subselect.test'
--- a/mysql-test/t/subselect.test	2008-05-16 16:03:50 +0000
+++ b/mysql-test/t/subselect.test	2008-06-19 03:08:41 +0000
@@ -3273,3 +3273,15 @@ INSERT INTO t1 VALUES ('a');
 SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1);
 DROP TABLE t1;
 
+#
+# Bug #37004: NOT IN subquery with MAX over an empty set
+#
+
+CREATE TABLE t1(c int, KEY(c));
+CREATE TABLE t2(a int, b int);
+INSERT INTO t2 VALUES (1, 10), (2, NULL);
+INSERT INTO t1 VALUES (1), (3);
+
+SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10);
+
+DROP TABLE t1,t2;

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2008-03-31 08:57:18 +0000
+++ b/sql/slave.cc	2008-06-19 18:47:59 +0000
@@ -4136,6 +4136,7 @@ bool rpl_master_erroneous_autoinc(THD *t
   if (active_mi && active_mi->rli.sql_thd == thd)
   {
     Relay_log_info *rli= &active_mi->rli;
+    DBUG_EXECUTE_IF("simulate_bug33029", return TRUE;);
     return rpl_master_has_bug(rli, 33029, FALSE);
   }
   return FALSE;

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2008-05-20 07:38:17 +0000
+++ b/sql/sql_class.cc	2008-06-19 18:47:59 +0000
@@ -2882,8 +2882,8 @@ void THD::reset_sub_statement_state(Sub_
    */
   if (rpl_master_erroneous_autoinc(this))
   {
-    backup->auto_inc_intervals_forced= auto_inc_intervals_forced;
-    auto_inc_intervals_forced.empty();
+    DBUG_ASSERT(backup->auto_inc_intervals_forced.nb_elements() == 0);
+    auto_inc_intervals_forced.swap(&backup->auto_inc_intervals_forced);
   }
 #endif
   
@@ -2931,8 +2931,8 @@ void THD::restore_sub_statement_state(Su
    */
   if (rpl_master_erroneous_autoinc(this))
   {
-    auto_inc_intervals_forced= backup->auto_inc_intervals_forced;
-    backup->auto_inc_intervals_forced.empty();
+    backup->auto_inc_intervals_forced.swap(&auto_inc_intervals_forced);
+    DBUG_ASSERT(backup->auto_inc_intervals_forced.nb_elements() == 0);
   }
 #endif
 

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2008-05-16 16:03:50 +0000
+++ b/sql/sql_select.cc	2008-06-19 03:08:41 +0000
@@ -888,6 +888,7 @@ JOIN::optimize()
       {
         DBUG_PRINT("info",("No matching min/max row"));
 	zero_result_cause= "No matching min/max row";
+        tables= 0;
 	error=0;
 	DBUG_RETURN(0);
       }
@@ -901,6 +902,7 @@ JOIN::optimize()
       {
         DBUG_PRINT("info",("No matching min/max row"));
         zero_result_cause= "No matching min/max row";
+        tables= 0;
         error=0;
         DBUG_RETURN(0);
       }

=== modified file 'sql/structs.h'
--- a/sql/structs.h	2008-03-14 03:35:41 +0000
+++ b/sql/structs.h	2008-06-19 18:47:59 +0000
@@ -314,31 +314,22 @@ private:
   */
   Discrete_interval        *current;
   uint                  elements; // number of elements
-
-  /* helper function for copy construct and assignment operator */
-  void copy_(const Discrete_intervals_list& from)
-  {
-    for (Discrete_interval *i= from.head; i; i= i->next)
-    {
-      Discrete_interval j= *i;
-      append(&j);
-    }
+  void set_members(Discrete_interval *h, Discrete_interval *t,
+                   Discrete_interval *c, uint el)
+  {  
+    head= h;
+    tail= t;
+    current= c;
+    elements= el;
   }
+  void operator=(Discrete_intervals_list &);  /* prevent use of these */
+  Discrete_intervals_list(const Discrete_intervals_list &);
+
 public:
   Discrete_intervals_list() : head(NULL), current(NULL), elements(0) {};
-  Discrete_intervals_list(const Discrete_intervals_list& from)
-  {
-    copy_(from);
-  }
-  void operator=(const Discrete_intervals_list& from)
-  {
-    empty();
-    copy_(from);
-  }
   void empty_no_free()
   {
-    head= current= NULL;
-    elements= 0;
+    set_members(NULL, NULL, NULL, 0);
   }
   void empty()
   {
@@ -350,7 +341,24 @@ public:
     }
     empty_no_free();
   }
-
+  void copy_shallow(const Discrete_intervals_list * dli)
+  {
+    head= dli->get_head();
+    tail= dli->get_tail();
+    current= dli->get_current();
+    elements= dli->nb_elements();
+  }
+  void swap (Discrete_intervals_list * dli)
+  {
+    Discrete_interval *h, *t, *c;
+    uint el;
+    h= dli->get_head();
+    t= dli->get_tail();
+    c= dli->get_current();
+    el= dli->nb_elements();
+    dli->copy_shallow(this);
+    set_members(h, t, c, el);
+  }
   const Discrete_interval* get_next()
   {
     Discrete_interval *tmp= current;
@@ -364,4 +372,7 @@ public:
   ulonglong minimum()     const { return (head ? head->minimum() : 0); };
   ulonglong maximum()     const { return (head ? tail->maximum() : 0); };
   uint      nb_elements() const { return elements; }
+  Discrete_interval* get_head() const { return head; };
+  Discrete_interval* get_tail() const { return tail; };
+  Discrete_interval* get_current() const { return current; };
 };

=== modified file 'storage/innobase/Makefile.am'
--- a/storage/innobase/Makefile.am	2008-05-14 08:45:32 +0000
+++ b/storage/innobase/Makefile.am	2008-06-19 04:44:22 +0000
@@ -159,7 +159,7 @@ libinnobase_a_CXXFLAGS=	$(AM_CFLAGS)
 libinnobase_a_CFLAGS  =	$(AM_CFLAGS)
 
 EXTRA_LTLIBRARIES =	ha_innodb.la
-pkglib_LTLIBRARIES =	@plugin_innobase_shared_target@
+pkgplugin_LTLIBRARIES=	@plugin_innobase_shared_target@
 
 ha_innodb_la_LDFLAGS =	-module -rpath $(pkgplugindir)
 ha_innodb_la_CXXFLAGS=	$(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN

Thread
bzr push into mysql-5.1 branch (joerg:2656 to 2658) Joerg Bruehe24 Jun