List:Commits« Previous MessageNext Message »
From:Lars Thalmann Date:September 11 2006 11:35am
Subject:bk commit into 5.1 tree (lars:1.2318)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of lthalmann. When lthalmann 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, 2006-09-11 13:34:44+02:00, lars@stripped +21 -0
  Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl
  into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge
  MERGE: 1.2245.1.12

  BitKeeper/deleted/.del-rpl_heap.test@stripped, 2006-09-11 13:23:03+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.10.1.2

  BitKeeper/deleted/.del-rpl_heap.test@stripped, 2006-09-11 13:23:02+02:00, lars@stripped +0 -0
    Merge rename: mysql-test/t/rpl_heap.test -> BitKeeper/deleted/.del-rpl_heap.test

  Makefile.am@stripped, 2006-09-11 13:23:03+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.94.1.1

  mysql-test/extra/binlog_tests/binlog.test@stripped, 2006-09-11 13:23:03+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.11.1.1

  mysql-test/r/binlog_stm_binlog.result@stripped, 2006-09-11 13:23:03+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.11.1.1

  mysql-test/r/rpl_switch_stm_row_mixed.result@stripped, 2006-09-11 13:23:03+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.12.1.2

  mysql-test/t/date_formats.test@stripped, 2006-09-11 13:23:03+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.21.1.1

  mysql-test/t/disabled.def@stripped, 2006-09-11 13:34:40+02:00, lars@stripped +7 -17
    Merge (main -> rpl 5.1)
    MERGE: 1.182.1.2

  mysql-test/t/mysqlbinlog.test@stripped, 2006-09-11 13:23:03+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.26.1.1

  mysql-test/t/rpl_trigger.test@stripped, 2006-09-11 13:23:03+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.8.1.1

  sql/CMakeLists.txt@stripped, 2006-09-11 13:23:03+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.24.1.1

  sql/Makefile.am@stripped, 2006-09-11 13:23:04+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.146.2.1

  sql/field.cc@stripped, 2006-09-11 13:23:04+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.327.1.2

  sql/field.h@stripped, 2006-09-11 13:23:04+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.183.1.18

  sql/log.cc@stripped, 2006-09-11 13:23:04+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.222.1.1

  sql/mysql_priv.h@stripped, 2006-09-11 13:23:05+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.422.1.1

  sql/mysqld.cc@stripped, 2006-09-11 13:23:05+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.570.4.1

  sql/sql_class.cc@stripped, 2006-09-11 13:23:05+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.278.1.1

  sql/sql_insert.cc@stripped, 2006-09-11 13:23:06+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.214.1.1

  storage/innobase/handler/ha_innodb.cc@stripped, 2006-09-11 13:23:06+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.283.1.2

  storage/innobase/handler/ha_innodb.cc@stripped, 2006-09-11 13:23:02+02:00, lars@stripped +0 -0
    Merge rename: sql/ha_innodb.cc -> storage/innobase/handler/ha_innodb.cc

  unittest/README.txt@stripped, 2006-09-11 13:23:06+02:00, lars@stripped +0 -0
    Auto merged
    MERGE: 1.3.1.1

  unittest/unit.pl@stripped, 2006-09-11 13:23:06+02:00, lars@stripped +0 -1
    Auto merged
    MERGE: 1.4.1.1

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	lars
# Host:	dl145j.mysql.com
# Root:	/users/lthalmann/bk/MERGE/mysql-5.1-merge/RESYNC

--- 1.95/Makefile.am	2006-09-11 13:35:07 +02:00
+++ 1.96/Makefile.am	2006-09-11 13:35:07 +02:00
@@ -114,7 +114,7 @@ test-unit:
 
 test-ps:
 	cd mysql-test ; \
-	./mysql-test-run.pl $(force) --ps-protocol --mysqld=--binlog-format=statement
+	./mysql-test-run.pl $(force) --ps-protocol --mysqld=--binlog-format=mixed
 
 test-nr:
 	cd mysql-test ; \
@@ -125,6 +125,10 @@ test-pr:
 	./mysql-test-run.pl $(force) --ps-protocol --mysqld=--binlog-format=row
 
 test-ns:
+	cd mysql-test ; \
+	./mysql-test-run.pl $(force) --mysqld=--binlog-format=mixed
+
+test-binlog-statement:
 	cd mysql-test ; \
 	./mysql-test-run.pl $(force) --mysqld=--binlog-format=statement
 

--- 1.155/sql/Makefile.am	2006-09-11 13:35:07 +02:00
+++ 1.156/sql/Makefile.am	2006-09-11 13:35:07 +02:00
@@ -52,7 +52,7 @@ noinst_HEADERS =	item.h item_func.h item
 			ha_partition.h \
 			ha_ndbcluster.h ha_ndbcluster_binlog.h \
 			ha_ndbcluster_tables.h \
-			opt_range.h protocol.h rpl_tblmap.h \
+			opt_range.h protocol.h rpl_tblmap.h rpl_utility.h \
 			log.h sql_show.h rpl_rli.h \
 			sql_select.h structs.h table.h sql_udf.h hash_filo.h \
 			lex.h lex_symbol.h sql_acl.h sql_crypt.h  \
@@ -92,7 +92,7 @@ mysqld_SOURCES =	sql_lex.cc sql_handler.
 			sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
 			sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
 			slave.cc sql_repl.cc rpl_filter.cc rpl_tblmap.cc \
-			rpl_injector.cc \
+			rpl_utility.cc rpl_injector.cc \
                         sql_union.cc sql_derived.cc \
 			client.c sql_client.cc mini_client_errors.c pack.c\
 			stacktrace.c repl_failsafe.h repl_failsafe.cc \

--- 1.339/sql/field.cc	2006-09-11 13:35:07 +02:00
+++ 1.340/sql/field.cc	2006-09-11 13:35:07 +02:00
@@ -1257,6 +1257,13 @@ void Field::hash(ulong *nr, ulong *nr2)
   }
 }
 
+my_size_t
+Field::do_last_null_byte() const
+{
+  DBUG_ASSERT(null_ptr == NULL || (byte*) null_ptr >= table->record[0]);
+  return null_ptr ? (byte*) null_ptr - table->record[0] + 1 : 0;
+}
+
 
 void Field::copy_from_tmp(int row_offset)
 {
@@ -8094,6 +8101,30 @@ Field_bit::Field_bit(char *ptr_arg, uint
 }
 
 
+my_size_t
+Field_bit::do_last_null_byte() const
+{
+  /*
+    Code elsewhere is assuming that bytes are 8 bits, so I'm using
+    that value instead of the correct one: CHAR_BIT.
+
+    REFACTOR SUGGESTION (Matz): Change to use the correct number of
+    bits. On systems with CHAR_BIT > 8 (not very common), the storage
+    will lose the extra bits.
+  */
+  DBUG_PRINT("debug", ("bit_ofs=%d, bit_len=%d, bit_ptr=%p",
+                       bit_ofs, bit_len, bit_ptr));
+  uchar *result;
+  if (bit_len == 0)
+    result= null_ptr;
+  else if (bit_ofs + bit_len > 8)
+    result= bit_ptr + 1;
+  else
+    result= bit_ptr;
+
+  return result ? (byte*) result - table->record[0] + 1 : 0;
+}
+
 Field *Field_bit::new_key_field(MEM_ROOT *root,
                                 struct st_table *new_table,
                                 char *new_ptr, uchar *new_null_ptr,
@@ -8344,6 +8375,14 @@ const char *Field_bit::unpack(char *to, 
   return from + bytes_in_rec;
 }
 
+
+void Field_bit::set_default()
+{
+  my_ptrdiff_t const offset= table->s->default_values - table->record[0];
+  uchar bits= get_rec_bits(bit_ptr + offset, bit_ofs, bit_len);
+  set_rec_bits(bits, bit_ptr, bit_ofs, bit_len);
+  Field::set_default();
+}
 
 /*
   Bit field support for non-MyISAM tables.

--- 1.186/sql/field.h	2006-09-11 13:35:07 +02:00
+++ 1.187/sql/field.h	2006-09-11 13:35:07 +02:00
@@ -118,6 +118,11 @@ public:
   */
   virtual String *val_str(String*,String *)=0;
   String *val_int_as_str(String *val_buffer, my_bool unsigned_flag);
+  /*
+   str_needs_quotes() returns TRUE if the value returned by val_str() needs
+   to be quoted when used in constructing an SQL query.
+  */
+  virtual bool str_needs_quotes() { return FALSE; }
   virtual Item_result result_type () const=0;
   virtual Item_result cmp_type () const { return result_type(); }
   virtual Item_result cast_to_int_type () const { return result_type(); }
@@ -144,6 +149,11 @@ public:
     table, which is located on disk).
   */
   virtual uint32 pack_length_in_rec() const { return pack_length(); }
+
+  /*
+    data_length() return the "real size" of the data in memory.
+  */
+  virtual uint32 data_length(const char *from) { return pack_length(); }
   virtual uint32 sort_length() const { return pack_length(); }
   virtual void reset(void) { bzero(ptr,pack_length()); }
   virtual void reset_fields() {}
@@ -281,8 +291,6 @@ public:
     ptr= old_ptr;
     return str;
   }
-  bool quote_data(String *unquoted_string);
-  bool needs_quotes(void);
   virtual bool send_binary(Protocol *protocol);
   virtual char *pack(char* to, const char *from, uint max_length=~(uint) 0)
   {
@@ -430,6 +438,7 @@ public:
   uint32 max_length() { return field_length; }
   friend class create_field;
   my_decimal *val_decimal(my_decimal *);
+  virtual bool str_needs_quotes() { return TRUE; }
   uint is_equal(create_field *new_field);
 };
 
@@ -810,6 +819,8 @@ public:
                   uchar *null_ptr_arg, uchar null_bit_arg,
 		  enum utype unireg_check_arg, const char *field_name_arg,
 		  TABLE_SHARE *share, CHARSET_INFO *cs);
+  Field_timestamp(bool maybe_null_arg, const char *field_name_arg,
+		  CHARSET_INFO *cs);
   enum_field_types type() const { return FIELD_TYPE_TIMESTAMP;}
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
   enum Item_result cmp_type () const { return INT_RESULT; }
@@ -1131,6 +1142,7 @@ public:
   int key_cmp(const byte *str, uint length);
   uint packed_col_length(const char *to, uint length);
   uint max_packed_col_length(uint max_length);
+  uint32 data_length(const char *from);
   uint size_of() const { return sizeof(*this); }
   enum_field_types real_type() const { return MYSQL_TYPE_VARCHAR; }
   bool has_charset(void) const
@@ -1160,6 +1172,21 @@ public:
   {
     flags|= BLOB_FLAG;
   }
+  Field_blob(uint32 len_arg,bool maybe_null_arg, const char *field_name_arg,
+	     CHARSET_INFO *cs, bool set_packlength)
+    :Field_longstr((char*) 0,len_arg, maybe_null_arg ? (uchar*) "": 0, 0,
+                   NONE, field_name_arg, cs)
+  {
+    flags|= BLOB_FLAG;
+    packlength= 4;
+    if (set_packlength)
+    {
+      uint32 char_length= len_arg/cs->mbmaxlen;
+      packlength= char_length <= 255 ? 1 :
+                  char_length <= 65535 ? 2 :
+                  char_length <= 16777215 ? 3 : 4;
+    }
+  }
   enum_field_types type() const { return FIELD_TYPE_BLOB;}
   enum ha_base_keytype key_type() const
     { return binary() ? HA_KEYTYPE_VARBINARY2 : HA_KEYTYPE_VARTEXT2; }
@@ -1380,6 +1407,7 @@ public:
   double val_real(void);
   longlong val_int(void);
   String *val_str(String*, String *);
+  virtual bool str_needs_quotes() { return TRUE; }
   my_decimal *val_decimal(my_decimal *);
   int cmp(const char *a, const char *b)
   { return cmp_binary(a, b); }

--- 1.225/sql/log.cc	2006-09-11 13:35:07 +02:00
+++ 1.226/sql/log.cc	2006-09-11 13:35:07 +02:00
@@ -3171,7 +3171,7 @@ int MYSQL_BIN_LOG::
   flush_and_set_pending_rows_event(THD *thd, Rows_log_event* event)
 {
   DBUG_ENTER("MYSQL_BIN_LOG::flush_and_set_pending_rows_event(event)");
-  DBUG_ASSERT(thd->current_stmt_binlog_row_based && mysql_bin_log.is_open());
+  DBUG_ASSERT(mysql_bin_log.is_open());
   DBUG_PRINT("enter", ("event=%p", event));
 
   int error= 0;

--- 1.433/sql/mysql_priv.h	2006-09-11 13:35:07 +02:00
+++ 1.434/sql/mysql_priv.h	2006-09-11 13:35:07 +02:00
@@ -21,6 +21,9 @@
   except the part which must be in the server and in the client.
 */
 
+#ifndef MYSQL_PRIV_H
+#define MYSQL_PRIV_H
+
 #ifndef MYSQL_CLIENT
 
 #include <my_global.h>
@@ -2036,3 +2039,5 @@ bool schema_table_store_record(THD *thd,
 
 #endif /* MYSQL_SERVER */
 #endif /* MYSQL_CLIENT */
+
+#endif /* MYSQL_PRIV_H */

--- 1.582/sql/mysqld.cc	2006-09-11 13:35:07 +02:00
+++ 1.583/sql/mysqld.cc	2006-09-11 13:35:07 +02:00
@@ -3121,7 +3121,11 @@ with --log-bin instead.");
       global_system_variables.binlog_format= BINLOG_FORMAT_ROW;
     else
 #endif
+#if defined(HAVE_ROW_BASED_REPLICATION)
+      global_system_variables.binlog_format= BINLOG_FORMAT_MIXED;
+#else
       global_system_variables.binlog_format= BINLOG_FORMAT_STMT;
+#endif
   }
 
   /* Check that we have not let the format to unspecified at this point */
@@ -4886,7 +4890,13 @@ struct my_option my_long_options[] =
    "supports only statement-based binary logging, so only 'statement' is "
    "a legal value."
 #endif
-   , 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
+   , 0, 0, 0, GET_STR, REQUIRED_ARG,
+#ifdef HAVE_ROW_BASED_REPLICATION
+   BINLOG_FORMAT_MIXED
+#else
+   BINLOG_FORMAT_STMT
+#endif
+   , 0, 0, 0, 0, 0 },
   {"binlog-do-db", OPT_BINLOG_DO_DB,
    "Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned.",
    0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},

--- 1.287/sql/sql_class.cc	2006-09-11 13:35:07 +02:00
+++ 1.288/sql/sql_class.cc	2006-09-11 13:35:07 +02:00
@@ -2660,7 +2660,12 @@ int THD::binlog_delete_row(TABLE* table,
 int THD::binlog_flush_pending_rows_event(bool stmt_end)
 {
   DBUG_ENTER("THD::binlog_flush_pending_rows_event");
-  if (!current_stmt_binlog_row_based || !mysql_bin_log.is_open())
+  /*
+    We shall flush the pending event even if we are not in row-based
+    mode: it might be the case that we left row-based mode before
+    flushing anything (e.g., if we have explicitly locked tables).
+   */
+  if (!mysql_bin_log.is_open())
     DBUG_RETURN(0);
 
   /*
@@ -2726,6 +2731,21 @@ int THD::binlog_query(THD::enum_binlog_q
   DBUG_PRINT("enter", ("qtype=%d, query='%s'", qtype, query));
   DBUG_ASSERT(query && mysql_bin_log.is_open());
 
+  /*
+    If we are not in prelocked mode, mysql_unlock_tables() will be
+    called after this binlog_query(), so we have to flush the pending
+    rows event with the STMT_END_F set to unlock all tables at the
+    slave side as well.
+
+    If we are in prelocked mode, the flushing will be done inside the
+    top-most close_thread_tables().
+  */
+#ifdef HAVE_ROW_BASED_REPLICATION
+  if (this->prelocked_mode == NON_PRELOCKED)
+    if (int error= binlog_flush_pending_rows_event(TRUE))
+      DBUG_RETURN(error);
+#endif /*HAVE_ROW_BASED_REPLICATION*/
+
   switch (qtype) {
   case THD::MYSQL_QUERY_TYPE:
     /*
@@ -2739,25 +2759,7 @@ int THD::binlog_query(THD::enum_binlog_q
   case THD::ROW_QUERY_TYPE:
 #ifdef HAVE_ROW_BASED_REPLICATION
     if (current_stmt_binlog_row_based)
-    {
-      /*
-        If thd->lock is set, then we are not inside a stored function.
-        In that case, mysql_unlock_tables() will be called after this
-        binlog_query(), so we have to flush the pending rows event
-        with the STMT_END_F set to unlock all tables at the slave side
-        as well.
-
-        We will not flush the pending event, if thd->lock is NULL.
-        This means that we are inside a stored function or trigger, so
-        the flushing will be done inside the top-most
-        close_thread_tables().
-       */
-#ifdef HAVE_ROW_BASED_REPLICATION
-      if (this->lock)
-        DBUG_RETURN(binlog_flush_pending_rows_event(TRUE));
-#endif /*HAVE_ROW_BASED_REPLICATION*/
       DBUG_RETURN(0);
-    }
 #endif
     /* Otherwise, we fall through */
   case THD::STMT_QUERY_TYPE:

--- 1.221/sql/sql_insert.cc	2006-09-11 13:35:07 +02:00
+++ 1.222/sql/sql_insert.cc	2006-09-11 13:35:07 +02:00
@@ -2106,8 +2106,6 @@ bool delayed_insert::handle_inserts(void
 
     thd.start_time=row->start_time;
     thd.query_start_used=row->query_start_used;
-    /* for the binlog, forget auto_increment ids generated by previous rows */
-//    thd.auto_inc_intervals_in_cur_stmt_for_binlog.empty();
     thd.first_successful_insert_id_in_prev_stmt= 
       row->first_successful_insert_id_in_prev_stmt;
     thd.stmt_depends_on_first_successful_insert_id_in_prev_stmt= 

--- 1.29/mysql-test/t/mysqlbinlog.test	2006-09-11 13:35:07 +02:00
+++ 1.30/mysql-test/t/mysqlbinlog.test	2006-09-11 13:35:07 +02:00
@@ -1,6 +1,6 @@
 # We are using .opt file since we need small binlog size
 # TODO: Need to look at making a row based version once the new row based client is completed. [jbm]
--- source include/have_binlog_format_statement.inc
+-- source include/have_binlog_format_mixed_or_statement.inc
 
 # Embedded server doesn't support binlogging
 -- source include/not_embedded.inc

--- 1.25/mysql-test/t/date_formats.test	2006-09-11 13:35:07 +02:00
+++ 1.26/mysql-test/t/date_formats.test	2006-09-11 13:35:07 +02:00
@@ -6,9 +6,9 @@
 drop table if exists t1;
 --enable_warnings
 
---replace_result ROW <format> STATEMENT <format>
+--replace_result ROW <format> STATEMENT <format> MIXED <format>
 SHOW GLOBAL VARIABLES LIKE "%_format%";
---replace_result ROW <format> STATEMENT <format>
+--replace_result ROW <format> STATEMENT <format> MIXED <format>
 SHOW SESSION VARIABLES LIKE "%_format%";
 
 #
@@ -36,7 +36,7 @@ set datetime_format= '%H:%i:%s.%f %m-%d-
 set datetime_format= '%h:%i:%s %p %Y-%m-%d';
 set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
 
---replace_result ROW <format> STATEMENT <format>
+--replace_result ROW <format> STATEMENT <format> MIXED <format>
 SHOW SESSION VARIABLES LIKE "%format";
 
 --error 1231

--- 1.13/mysql-test/r/rpl_switch_stm_row_mixed.result	2006-09-11 13:35:07 +02:00
+++ 1.14/mysql-test/r/rpl_switch_stm_row_mixed.result	2006-09-11 13:35:07 +02:00
@@ -7,6 +7,8 @@ start slave;
 drop database if exists mysqltest1;
 create database mysqltest1;
 use mysqltest1;
+set session binlog_format=row;
+set global binlog_format=row;
 show global variables like "binlog_format%";
 Variable_name	Value
 binlog_format	ROW
@@ -358,6 +360,28 @@ count(*)
 select count(*) from t16;
 count(*)
 3
+DROP TABLE IF EXISTS t11;
+SET SESSION BINLOG_FORMAT=STATEMENT;
+CREATE TABLE t11 (song VARCHAR(255));
+LOCK TABLES t11 WRITE;
+SET SESSION BINLOG_FORMAT=ROW;
+INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict');
+SET SESSION BINLOG_FORMAT=STATEMENT;
+INSERT INTO t11 VALUES('Careful With That Axe, Eugene');
+UNLOCK TABLES;
+SELECT * FROM t11;
+song	Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict
+song	Careful With That Axe, Eugene
+USE mysqltest1;
+SELECT * FROM t11;
+song	Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict
+song	Careful With That Axe, Eugene
+DROP TABLE IF EXISTS t12;
+SET SESSION BINLOG_FORMAT=MIXED;
+CREATE TABLE t12 (data LONG);
+LOCK TABLES t12 WRITE;
+INSERT INTO t12 VALUES(UUID());
+UNLOCK TABLES;
 show binlog events from 102;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	1	#	drop database if exists mysqltest1
@@ -659,4 +683,323 @@ master-bin.000001	#	Write_rows	1	#	table
 master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t16)
 master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t16 values("try_66_")
+master-bin.000001	#	Query	1	#	use `mysqltest1`; DROP TABLE IF EXISTS t11
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE TABLE t11 (song VARCHAR(255))
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t11)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; INSERT INTO t11 VALUES('Careful With That Axe, Eugene')
+master-bin.000001	#	Query	1	#	use `mysqltest1`; DROP TABLE IF EXISTS t12
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE TABLE t12 (data LONG)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t12)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+show binlog events from 102;
+Log_name	Pos	Event_type	Server_id	End_log_pos	Info
+master-bin.000001	#	Query	1	#	drop database if exists mysqltest1
+master-bin.000001	#	Query	1	#	create database mysqltest1
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE TABLE t1 (a varchar(100))
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 values("work_8_")
+master-bin.000001	#	User var	1	#	@`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 select @'string'
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 values("work_9_")
+master-bin.000001	#	User var	1	#	@`string`=_latin1 0x656D657267656E63795F375F COLLATE latin1_swedish_ci
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 select @'string'
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 values("for_10_")
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 select "yesterday_11_"
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 values("work_13_")
+master-bin.000001	#	User var	1	#	@`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 select @'string'
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 values("work_14_")
+master-bin.000001	#	User var	1	#	@`string`=_latin1 0x656D657267656E63795F31325F COLLATE latin1_swedish_ci
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 select @'string'
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 values("for_15_")
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 select "yesterday_16_"
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 values("work_18_")
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	User var	1	#	@`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 select @'string'
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 select "yesterday_21_"
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	User var	1	#	@`string`=_latin1 0x656D657267656E63795F31375F COLLATE latin1_swedish_ci
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 select @'string'
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 select "yesterday_24_"
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE TABLE `t2` (
+  `rpad(UUID(),100,' ')` varchar(100) CHARACTER SET utf8 NOT NULL DEFAULT ''
+)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE TABLE `t3` (
+  `1` varbinary(108) NOT NULL DEFAULT ''
+)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t3)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE TABLE `t4` (
+  `a` varchar(100) DEFAULT NULL
+)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t4)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t5)
+master-bin.000001	#	Write_rows	1	#	table_id: #
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo()
+begin
+insert into t1 values("work_25_");
+insert into t1 values(concat("for_26_",UUID()));
+insert into t1 select "yesterday_27_";
+end
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo2()
+begin
+insert into t1 values(concat("emergency_28_",UUID()));
+insert into t1 values("work_29_");
+insert into t1 values(concat("for_30_",UUID()));
+set session binlog_format=row; # accepted for stored procs
+insert into t1 values("more work_31_");
+set session binlog_format=mixed;
+end
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned
+begin
+set session binlog_format=row; # rejected for stored funcs
+insert into t1 values("alarm");
+return 100;
+end
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` procedure foo4(x varchar(100))
+begin
+insert into t1 values(concat("work_250_",x));
+insert into t1 select "yesterday_270_";
+end
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'hello')))
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 select "yesterday_270_"
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 values(concat("work_250_", NAME_CONST('x',_latin1'world')))
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 select "yesterday_270_"
+master-bin.000001	#	Query	1	#	use `mysqltest1`; drop function foo3
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo3() returns bigint unsigned
+begin
+insert into t1 values("foo3_32_");
+call foo();
+return 100;
+end
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: #
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: #
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: #
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo4() returns bigint unsigned
+begin
+insert into t2 select foo3();
+return 100;
+end
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: #
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: #
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: #
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo5() returns bigint unsigned
+begin
+insert into t2 select UUID();
+return 100;
+end
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function foo6(x varchar(100)) returns bigint unsigned
+begin
+insert into t2 select x;
+return 100;
+end
+master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `foo6`(_latin1'foo6_1_')
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select uuid()
+master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t11 (data varchar(255))
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t11)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t11 select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysqltest1' and TABLE_NAME IN ('v1','t11')
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t11_bi before insert on t11 for each row
+begin
+set NEW.data = concat(NEW.data,UUID());
+end
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t11)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t20 select * from t1
+master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t21 select * from t2
+master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t22 select * from t3
+master-bin.000001	#	Query	1	#	use `mysqltest1`; drop table t1,t2,t3
+master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100))
+master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t2 (a int primary key auto_increment, b varchar(100))
+master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t3 (b varchar(100))
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f (x varchar(100)) returns int deterministic
+begin
+insert into t1 values(null,x);
+insert into t2 values(null,x);
+return 1;
+end
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: #
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: #
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Intvar	1	#	INSERT_ID=3
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 values(null,"try_44_")
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: #
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t12 select * from t1
+master-bin.000001	#	Query	1	#	use `mysqltest1`; drop table t1
+master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t1 (a int, b varchar(100), key(a))
+master-bin.000001	#	Intvar	1	#	INSERT_ID=4
+master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `f`(_latin1'try_45_')
+master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t13 select * from t1
+master-bin.000001	#	Query	1	#	use `mysqltest1`; drop table t1
+master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100))
+master-bin.000001	#	Query	1	#	use `mysqltest1`; drop function f
+master-bin.000001	#	Query	1	#	use `mysqltest1`; create table t14 (unique (a)) select * from t2
+master-bin.000001	#	Query	1	#	use `mysqltest1`; truncate table t2
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f1 (x varchar(100)) returns int deterministic
+begin
+insert into t1 values(null,x);
+return 1;
+end
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic
+begin
+insert into t2 values(null,x);
+return 1;
+end
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: #
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: #
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t3)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: #
+master-bin.000001	#	Write_rows	1	#	table_id: #
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; drop function f2
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` function f2 (x varchar(100)) returns int deterministic
+begin
+declare y int;
+insert into t1 values(null,x);
+set y = (select count(*) from t2);
+return y;
+end
+master-bin.000001	#	Intvar	1	#	INSERT_ID=4
+master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `f1`(_latin1'try_53_')
+master-bin.000001	#	Intvar	1	#	INSERT_ID=5
+master-bin.000001	#	Query	1	#	use `mysqltest1`; SELECT `f2`(_latin1'try_54_')
+master-bin.000001	#	Query	1	#	use `mysqltest1`; drop function f2
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row
+begin
+insert into t2 values(null,"try_55_");
+end
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t1)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t2)
+master-bin.000001	#	Write_rows	1	#	table_id: #
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; alter table t1 modify a int, drop primary key
+master-bin.000001	#	Intvar	1	#	INSERT_ID=5
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t1 values(null,"try_57_")
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE TABLE `t16` (
+  `UUID()` varchar(36) CHARACTER SET utf8 NOT NULL DEFAULT ''
+)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t16)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t16)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; insert into t16 values("try_66_")
+master-bin.000001	#	Query	1	#	use `mysqltest1`; DROP TABLE IF EXISTS t11
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE TABLE t11 (song VARCHAR(255))
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t11)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Query	1	#	use `mysqltest1`; INSERT INTO t11 VALUES('Careful With That Axe, Eugene')
+master-bin.000001	#	Query	1	#	use `mysqltest1`; DROP TABLE IF EXISTS t12
+master-bin.000001	#	Query	1	#	use `mysqltest1`; CREATE TABLE t12 (data LONG)
+master-bin.000001	#	Table_map	1	#	table_id: # (mysqltest1.t12)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
 drop database mysqltest1;

--- 1.195/mysql-test/t/disabled.def	2006-09-11 13:35:07 +02:00
+++ 1.196/mysql-test/t/disabled.def	2006-09-11 13:35:07 +02:00
@@ -22,18 +22,27 @@ ndb_load                 : BUG#17233 200
 partition_03ndb          : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
 ps                       : BUG#21524 2006-08-08 pgalbraith 'ps' test fails in --ps-protocol test AMD64 bit
 ps_7ndb                  : BUG#18950 2006-02-16 jmiller create table like does not obtain LOCK_open
-rpl_ndb_2innodb          : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
-rpl_ndb_2myisam          : BUG#19227 Seems to pass currently
-#rpl_ndb_commit_afterflush : BUG#19328 2006-05-04 tomas Slave timeout with COM_REGISTER_SLAVE error causing stop
-rpl_ndb_dd_partitions    : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD
-rpl_ndb_ddl              : BUG#18946 result file needs update + test needs to checked
-rpl_ndb_innodb2ndb       : Bug #19710  Cluster replication to partition table fails on DELETE FROM statement
-#rpl_ndb_log              : BUG#18947 2006-03-21 tomas CRBR: order in binlog of create table and insert (on different table) not determ
-rpl_ndb_myisam2ndb       : Bug #19710  Cluster replication to partition table fails on DELETE FROM statement
+rpl_deadlock_innodb      : BUG#16920 2006-04-12 kent    fails in show slave status (randomly)
+rpl_ndb_2innodb          : BUG#19004 2006-03-22 tomas ndb: partition by range and update hangs
+rpl_ndb_2myisam          : BUG#19004 2006-03-22 tomas ndb: partition by range and update hangs
+rpl_ndb_auto_inc         : BUG#17086 2006-02-16 jmiller CR: auto_increment_increment and auto_increment_offset produce duplicate key er
+rpl_ndb_commit_afterflush : LOCK TABLES cases hang in ndb injector thread
+rpl_ndb_ddl              : result file needs update + test needs to checked
+rpl_ndb_innodb2ndb       : BUG#18094 2006-03-16 mats Slave caches invalid table definition after atlters causes select failure
+rpl_ndb_log              : BUG#18947 2006-03-21 tomas CRBR: order in binlog of create table and insert (on different table) not determ
+rpl_ndb_myisam2ndb       : BUG#18094 2006-03-16 mats   Slave caches invalid table definition after atlters causes select failure
+rpl_ndb_relay_space      : BUG#16993 2006-02-16 jmiller RBR: ALTER TABLE ZEROFILL AUTO_INCREMENT is not replicated correctly
+rpl_switch_stm_row_mixed : BUG#18590 2006-03-28 brian
+rpl_row_basic_7ndb       : BUG#17400 2006-04-09 brian   Cluster Replication: delete & update of rows in table without pk fails on slave.
 rpl_row_blob_innodb      : BUG#18980 2006-04-10 kent    Test fails randomly
-rpl_row_func003          : BUG#19074 2006-13-04 andrei  test failed
+rpl_row_func003		 : BUG#19074 2006-13-04 andrei  test failed
+rpl_row_inexist_tbl      : BUG#18948 2006-03-09 mats    Disabled since patch makes this test wait forever
 rpl_sp                   : BUG#16456 2006-02-16 jmiller
-rpl_sp_effects           : BUG#19862 2006-06-15 mkindahl
+rpl_sp_effects           : BUG#19862 2006-08-22 mats    Bug appear to be fixed
+rpl_until                : BUG#15886 2006-02-16 jmiller Unstable test case
+sp-goto                  : BUG#18949 2006-02-16 jmiller GOTO is currently is disabled - will be fixed in the future
+mysqldump                : BUG#18078 2006-03-10 lars
+udf                      : BUG#18564 2006-03-27 ian     (Permission by Brian)
 
 # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
 #ndb_binlog_ddl_multi     : BUG#18976 2006-04-10 kent    CRBR: multiple binlog, second binlog may miss schema log events

--- 1.4/unittest/README.txt	2006-09-11 13:35:07 +02:00
+++ 1.5/unittest/README.txt	2006-09-11 13:35:07 +02:00
@@ -9,7 +9,9 @@ mytap                 Source for the MyT
 mysys                 Tests for mysys components
   bitmap-t.c          Unit test for MY_BITMAP
   base64-t.c          Unit test for base64 encoding functions
-examples              Example unit tests
+examples              Example unit tests.
+  core-t.c            Example of raising a signal in the middle of the test
+		      THIS TEST WILL STOP ALL FURTHER TESTING!
   simple-t.c          Example of a standard TAP unit test
   skip-t.c            Example where some test points are skipped
   skip_all-t.c        Example of a test where the entire test is skipped
@@ -23,6 +25,9 @@ Executing unit tests
 To make and execute all unit tests in the directory:
 
    make test
+
+Observe that the tests in the examples/ directory are just various
+examples of tests and are not expected to pass.
 
 
 Adding unit tests

--- 1.283.1.1/sql/ha_innodb.cc	2006-09-11 13:35:07 +02:00
+++ 1.292/storage/innobase/handler/ha_innodb.cc	2006-09-11 13:35:07 +02:00
@@ -31,8 +31,7 @@ have disables the InnoDB inlining in thi
 #pragma implementation				// gcc: Class implementation
 #endif
 
-#include "mysql_priv.h"
-#include "slave.h"
+#include <mysql_priv.h>
 
 #include <m_ctype.h>
 #include <hash.h>
@@ -42,8 +41,6 @@ have disables the InnoDB inlining in thi
 
 #define MAX_ULONG_BIT ((ulong) 1 << (sizeof(ulong)*8-1))
 
-#ifdef WITH_INNOBASE_STORAGE_ENGINE
-
 #include "ha_innodb.h"
 
 pthread_mutex_t innobase_share_mutex,	/* to protect innobase_open_files */
@@ -311,7 +308,8 @@ SHOW_VAR innodb_status_variables[]= {
   (char*) &export_vars.innodb_rows_read,		  SHOW_LONG},
   {"rows_updated",
   (char*) &export_vars.innodb_rows_updated,		  SHOW_LONG},
-  {NullS, NullS, SHOW_LONG}};
+  {NullS, NullS, SHOW_LONG}
+};
 
 /* General functions */
 
@@ -1601,21 +1599,6 @@ innobase_init(void)
 	pthread_cond_init(&commit_cond, NULL);
 	innodb_inited= 1;
 
-	/* If this is a replication slave and we needed to do a crash recovery,
-	set the master binlog position to what InnoDB internally knew about
-	how far we got transactions durable inside InnoDB. There is a
-	problem here: if the user used also MyISAM tables, InnoDB might not
-	know the right position for them.
-
-	THIS DOES NOT WORK CURRENTLY because replication seems to initialize
-	glob_mi also after innobase_init. */
-
-/*	if (trx_sys_mysql_master_log_pos != -1) {
-		ut_memcpy(glob_mi.log_file_name, trx_sys_mysql_master_log_name,
-				1 + ut_strlen(trx_sys_mysql_master_log_name));
-		glob_mi.pos = trx_sys_mysql_master_log_pos;
-	}
-*/
 	DBUG_RETURN(FALSE);
 error:
 	have_innodb= SHOW_OPTION_DISABLED;	// If we couldn't use handler
@@ -1690,19 +1673,6 @@ innobase_commit_low(
 		return;
 	}
 
-#ifdef HAVE_REPLICATION
-	THD *thd=current_thd;
-
-	if (thd && thd->slave_thread) {
-		/* Update the replication position info inside InnoDB */
-
-		trx->mysql_master_log_file_name
-					= active_mi->rli.group_master_log_name;
-		trx->mysql_master_log_pos = ((ib_longlong)
-				active_mi->rli.future_group_master_log_pos);
-	}
-#endif /* HAVE_REPLICATION */
-
 	trx_commit_for_mysql(trx);
 }
 
@@ -2364,8 +2334,7 @@ ha_innobase::open(
 				"have forgotten\nto delete the corresponding "
 				".frm files of InnoDB tables, or you\n"
 				"have moved .frm files to another database?\n"
-				"Look from section 15.1 of "
-				"http://www.innodb.com/ibman.html\n"
+				"See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
 				"how you can resolve the problem.\n",
 				norm_name);
 		free_share(share);
@@ -2382,8 +2351,7 @@ ha_innobase::open(
 				"Have you deleted the .ibd file from the "
 				"database directory under\nthe MySQL datadir, "
 				"or have you used DISCARD TABLESPACE?\n"
-				"Look from section 15.1 of "
-				"http://www.innodb.com/ibman.html\n"
+				"See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
 				"how you can resolve the problem.\n",
 				norm_name);
 		free_share(share);
@@ -2916,7 +2884,6 @@ ha_innobase::store_key_val_for_row(
 
 			CHARSET_INFO*	cs;
 			ulint		key_len;
-			ulint		len;
 			ulint		true_len;
 			int		error=0;
 			ulint		blob_len;
@@ -5604,13 +5571,14 @@ ha_innobase::info(
 		for (i = 0; i < table->s->keys; i++) {
 			if (index == NULL) {
 				ut_print_timestamp(stderr);
-				sql_print_error("Table %s contains less "
+				sql_print_error("Table %s contains fewer "
 						"indexes inside InnoDB than "
 						"are defined in the MySQL "
 						".frm file. Have you mixed up "
 						".frm files from different "
-						"installations? See section "
-						"15.1 at http://www.innodb.com/ibman.html",
+						"installations? See "
+"http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n",
+
 						ib_table->name);
 				break;
 			}
@@ -5619,17 +5587,11 @@ ha_innobase::info(
 
 				if (j + 1 > index->n_uniq) {
 					ut_print_timestamp(stderr);
-					sql_print_error("Index %s of %s has "
-							"%lu columns unique "
-							"inside InnoDB, but "
-							"MySQL is asking "
-							"statistics for %lu "
-							"columns. Have you "
-							"mixed up .frm files "
-							"from different "
-							"installations? See "
-							"section 15.1 at "
-							"http://www.innodb.com/ibman.html",
+					sql_print_error(
+"Index %s of %s has %lu columns unique inside InnoDB, but MySQL is asking "
+"statistics for %lu columns. Have you mixed up .frm files from different "
+"installations? "
+"See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n",
 							index->name,
 							ib_table->name,
 							(unsigned long)
@@ -6438,7 +6400,7 @@ ha_innobase::transactional_table_lock(
 "table %s does not exist.\n"
 "Have you deleted the .ibd file from the database directory under\n"
 "the MySQL datadir?"
-"Look from section 15.1 of http://www.innodb.com/ibman.html\n"
+"See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
 "how you can resolve the problem.\n",
 				prebuilt->table->name);
 		DBUG_RETURN(HA_ERR_CRASHED);
@@ -7601,6 +7563,19 @@ bool ha_innobase::check_if_incompatible_
 	return COMPATIBLE_DATA_YES;
 }
 
+static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff)
+{
+  innodb_export_status();
+  var->type= SHOW_ARRAY;
+  var->value= (char *) &innodb_status_variables;
+  return 0;
+}
+
+SHOW_VAR innodb_status_variables_export[]= {
+  {"Innodb",                   (char*) &show_innodb_vars, SHOW_FUNC},
+  {NullS, NullS, SHOW_LONG}
+};
+
 struct st_mysql_storage_engine innobase_storage_engine=
 { MYSQL_HANDLERTON_INTERFACE_VERSION, &innobase_hton};
 
@@ -7614,9 +7589,9 @@ mysql_declare_plugin(innobase)
   innobase_init, /* Plugin Init */
   NULL, /* Plugin Deinit */
   0x0100 /* 1.0 */,
-  0
+  innodb_status_variables_export,/* status variables             */
+  NULL,                       /* system variables                */
+  NULL                        /* config options                  */
 }
 mysql_declare_plugin_end;
-
-#endif
 

--- 1.9/mysql-test/t/rpl_trigger.test	2006-09-11 13:35:07 +02:00
+++ 1.10/mysql-test/t/rpl_trigger.test	2006-09-11 13:35:07 +02:00
@@ -2,7 +2,7 @@
 # Test of triggers with replication
 # Adding statement include due to Bug 12574
 # TODO: Remove statement include once 12574 is patched
---source include/have_binlog_format_statement.inc 
+--source include/have_binlog_format_mixed_or_statement.inc 
 --source include/master-slave.inc
 
 --disable_warnings

--- 1.32/sql/CMakeLists.txt	2006-09-11 13:35:07 +02:00
+++ 1.33/sql/CMakeLists.txt	2006-09-11 13:35:07 +02:00
@@ -52,7 +52,7 @@ ADD_EXECUTABLE(mysqld ../sql-common/clie
                time.cc tztime.cc uniques.cc unireg.cc item_xmlfunc.cc 
                rpl_tblmap.cc sql_binlog.cc event_scheduler.cc event_timed.cc 
                sql_tablespace.cc events.cc ../sql-common/my_user.c 
-               partition_info.cc rpl_injector.cc sql_locale.cc
+               partition_info.cc rpl_utility.cc rpl_injector.cc sql_locale.cc
                ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
   			   ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
 			   ${PROJECT_SOURCE_DIR}/include/mysqld_error.h

--- 1.12/mysql-test/r/binlog_stm_binlog.result	2006-09-11 13:35:07 +02:00
+++ 1.13/mysql-test/r/binlog_stm_binlog.result	2006-09-11 13:35:07 +02:00
@@ -172,8 +172,10 @@ master-bin.000001	#	Intvar	1	#	INSERT_ID
 master-bin.000001	#	Query	1	#	use `test`; insert into t1 values(null)
 master-bin.000001	#	Query	1	#	use `test`; drop table t1
 master-bin.000001	#	Query	1	#	use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
-master-bin.000001	#	Query	1	#	use `test`; insert delayed into t1 values (207)
-master-bin.000001	#	Intvar	1	#	INSERT_ID=208
-master-bin.000001	#	Query	1	#	use `test`; insert delayed into t1 values (null)
-master-bin.000001	#	Query	1	#	use `test`; insert delayed into t1 values (300)
+master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
 drop table t1;

--- 1.12/mysql-test/extra/binlog_tests/binlog.test	2006-09-11 13:35:07 +02:00
+++ 1.13/mysql-test/extra/binlog_tests/binlog.test	2006-09-11 13:35:07 +02:00
@@ -59,24 +59,4 @@ insert into t1 values(null);
 select * from t1;
 drop table t1;
 
-# Test of binlogging of INSERT_ID with INSERT DELAYED
-create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
-# First, avoid BUG#20627:
-set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
-# Verify that only one INSERT_ID event is binlogged.
-insert delayed into t1 values (207);
-
-# We use sleeps between statements, that's the only way to get a
-# repeatable binlog in a normal test run and under Valgrind.
-# It may be that the "binlog missing rows" of BUG#20821 shows up
-# here.
-sleep 2;
-insert delayed into t1 values (null);
-sleep 2;
-insert delayed into t1 values (300);
-sleep 2; # time for the delayed queries to reach disk
-select * from t1;
---replace_column 2 # 5 #
---replace_regex /table_id: [0-9]+/table_id: #/
-show binlog events from 102;
-drop table t1;
+-- source extra/binlog_tests/binlog_insert_delayed.test
Thread
bk commit into 5.1 tree (lars:1.2318)Lars Thalmann11 Sep