List:Commits« Previous MessageNext Message »
From:Mats Kindahl Date:March 20 2007 8:36am
Subject:bk commit into 5.1 tree (mats:1.2477)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of mats. When mats 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-03-20 09:35:56+01:00, mats@romeo.(none) +12 -0
  Merge romeo.(none):/home/bkroot/mysql-5.1-new-rpl
  into  romeo.(none):/home/bk/b22583-mysql-5.1-new-rpl
  MERGE: 1.2409.44.41

  mysql-test/extra/rpl_tests/rpl_log.test@stripped, 2007-03-20 09:25:54+01:00, mats@romeo.(none) +0 -0
    Auto merged
    MERGE: 1.41.1.1

  mysql-test/r/rpl_ndb_log.result@stripped, 2007-03-20 09:25:54+01:00, mats@romeo.(none) +0 -0
    Auto merged
    MERGE: 1.16.1.1

  mysql-test/r/rpl_row_basic_11bugs.result@stripped, 2007-03-20 09:35:51+01:00, mats@romeo.(none) +0 -1
    Manual merge.
    MERGE: 1.12.1.1

  mysql-test/r/rpl_row_log.result@stripped, 2007-03-20 09:25:54+01:00, mats@romeo.(none) +0 -0
    Auto merged
    MERGE: 1.12.1.1

  mysql-test/r/rpl_row_log_innodb.result@stripped, 2007-03-20 09:25:54+01:00, mats@romeo.(none) +0 -0
    Auto merged
    MERGE: 1.12.1.1

  mysql-test/r/rpl_stm_log.result@stripped, 2007-03-20 09:25:54+01:00, mats@romeo.(none) +0 -0
    Auto merged
    MERGE: 1.73.1.1

  mysql-test/r/rpl_switch_stm_row_mixed.result@stripped, 2007-03-20 09:25:54+01:00, mats@romeo.(none) +0 -0
    Auto merged
    MERGE: 1.17.1.1

  mysql-test/t/mysqlbinlog.test@stripped, 2007-03-20 09:25:54+01:00, mats@romeo.(none) +0 -0
    Auto merged
    MERGE: 1.35.1.4

  mysql-test/t/rpl_row_basic_11bugs.test@stripped, 2007-03-20 09:35:51+01:00, mats@romeo.(none) +0 -4
    Manual merge.
    MERGE: 1.11.1.1

  mysql-test/t/rpl_switch_stm_row_mixed.test@stripped, 2007-03-20 09:25:54+01:00, mats@romeo.(none) +0 -0
    Auto merged
    MERGE: 1.14.1.1

  sql/log_event.cc@stripped, 2007-03-20 09:25:55+01:00, mats@romeo.(none) +0 -0
    Auto merged
    MERGE: 1.273.1.2

  sql/sql_class.cc@stripped, 2007-03-20 09:25:55+01:00, mats@romeo.(none) +0 -0
    Auto merged
    MERGE: 1.312.2.7

# 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:	mats
# Host:	romeo.(none)
# Root:	/home/bk/b22583-mysql-5.1-new-rpl/RESYNC

--- 1.274/sql/log_event.cc	2007-03-20 09:36:06 +01:00
+++ 1.275/sql/log_event.cc	2007-03-20 09:36:06 +01:00
@@ -1000,7 +1000,8 @@
     ev = new Execute_load_query_log_event(buf, event_len, description_event);
     break;
   default:
-    DBUG_PRINT("error",("Unknown evernt code: %d",(int) buf[EVENT_TYPE_OFFSET]));
+    DBUG_PRINT("error",("Unknown event code: %d",
+                        (int) buf[EVENT_TYPE_OFFSET]));
     ev= NULL;
     break;
   }
@@ -5595,10 +5596,10 @@
     row_end Pointer to variable that will hold the value of the
             one-after-end position for the row
     master_reclength
-            Pointer to variable that will be set to the length of the
-            record on the master side
-    rw_set  Pointer to bitmap that holds either the read_set or the
-            write_set of the table
+             Pointer to variable that will be set to the length of the
+             record on the master side
+    rw_set   Pointer to bitmap that holds either the read_set or the
+             write_set of the table
 
   DESCRIPTION
 
@@ -5626,68 +5627,81 @@
 static int
 unpack_row(RELAY_LOG_INFO *rli,
            TABLE *table, uint const colcnt,
-           char const *row, MY_BITMAP const *cols,
-           char const **row_end, ulong *master_reclength,
+           char const *const row_data, MY_BITMAP const *cols,
+           char const **const row_end, ulong *const master_reclength,
            MY_BITMAP* const rw_set, Log_event_type const event_type)
 {
-  byte *const record= table->record[0];
   DBUG_ENTER("unpack_row");
-  DBUG_ASSERT(record && row);
-  DBUG_PRINT("enter", ("row: 0x%lx  table->record[0]: 0x%lx", (long) row, (long) record));
-  my_size_t master_null_bytes= table->s->null_bytes;
-
-  if (colcnt != table->s->fields)
-  {
-    Field **fptr= &table->field[colcnt-1];
-    do
-      master_null_bytes= (*fptr)->last_null_byte();
-    while (master_null_bytes == Field::LAST_NULL_BYTE_UNDEF &&
-           fptr-- > table->field);
-
-    /*
-      If master_null_bytes is LAST_NULL_BYTE_UNDEF (0) at this time,
-      there were no nullable fields nor BIT fields at all in the
-      columns that are common to the master and the slave. In that
-      case, there is only one null byte holding the X bit.
+  DBUG_ASSERT(row_data);
+  my_size_t const master_null_byte_count= (bitmap_bits_set(cols) + 7) / 8;
+  int error= 0;
 
-      OBSERVE! There might still be nullable columns following the
-      common columns, so table->s->null_bytes might be greater than 1.
-     */
-    if (master_null_bytes == Field::LAST_NULL_BYTE_UNDEF)
-      master_null_bytes= 1;
-  }
+  char const *null_ptr= row_data;
+  char const *pack_ptr= row_data + master_null_byte_count;
 
-  DBUG_ASSERT(master_null_bytes <= table->s->null_bytes);
-  memcpy(record, row, master_null_bytes);            // [1]
-  int error= 0;
+  bitmap_clear_all(rw_set);
 
-  bitmap_set_all(rw_set);
+  empty_record(table);
 
   Field **const begin_ptr = table->field;
   Field **field_ptr;
-  char const *ptr= row + master_null_bytes;
   Field **const end_ptr= begin_ptr + colcnt;
+
+  DBUG_ASSERT(null_ptr < row_data + master_null_byte_count);
+
+  // Mask to mask out the correct bit among the null bits
+  unsigned int null_mask= 1U;
+  // The "current" null bits
+  unsigned int null_bits= *null_ptr++;
   for (field_ptr= begin_ptr ; field_ptr < end_ptr ; ++field_ptr)
   {
     Field *const f= *field_ptr;
 
+    /*
+      No need to bother about columns that does not exist: they have
+      gotten default values when being emptied above.
+     */
     if (bitmap_is_set(cols, field_ptr -  begin_ptr))
     {
-      DBUG_ASSERT((const char *)table->record[0] <= f->ptr);
-      DBUG_ASSERT(f->ptr < (char*)(table->record[0] + table->s->reclength +
-                                   (f->pack_length_in_rec() == 0)));
-
-      DBUG_PRINT("info", ("unpacking column '%s' to 0x%lx", f->field_name,
-                          (long) f->ptr));
-      ptr= f->unpack(f->ptr, ptr);
+      if ((null_mask & 0xFF) == 0)
+      {
+        DBUG_ASSERT(null_ptr < row_data + master_null_byte_count);
+        null_mask= 1U;
+        null_bits= *null_ptr++;
+      }
+
+      DBUG_ASSERT(null_mask & 0xFF); // One of the 8 LSB should be set
+
       /* Field...::unpack() cannot return 0 */
-      DBUG_ASSERT(ptr != NULL);
+      DBUG_ASSERT(pack_ptr != NULL);
+
+      if ((null_bits & null_mask) && f->maybe_null())
+        f->set_null();
+      else
+      {
+        f->set_notnull();
+
+        /*
+          We only unpack the field if it was non-null
+        */
+        const char *const old_ptr= pack_ptr;
+        pack_ptr= f->unpack(f->ptr, pack_ptr);
+        DBUG_PRINT("debug", ("Unpacking field '%s' from %d bytes",
+                             f->field_name, pack_ptr - old_ptr));
+      }
+
+      bitmap_set_bit(rw_set, f->field_index);
+      null_mask <<= 1;
     }
-    else
-      bitmap_clear_bit(rw_set, field_ptr - begin_ptr);
   }
 
-  *row_end = ptr;
+  /*
+    We should now have read all the null bytes, otherwise something is
+    really wrong.
+   */
+  DBUG_ASSERT(null_ptr == row_data + master_null_byte_count);
+
+  *row_end = pack_ptr;
   if (master_reclength)
   {
     if (*field_ptr)
@@ -5712,9 +5726,8 @@
     uint32 const mask= NOT_NULL_FLAG | NO_DEFAULT_VALUE_FLAG;
     Field *const f= *field_ptr;
 
-    DBUG_PRINT("info", ("processing column '%s' @ 0x%lx", f->field_name,
-                        (long) f->ptr));
-    if (event_type == WRITE_ROWS_EVENT && (f->flags & mask) == mask)
+    if (event_type == WRITE_ROWS_EVENT &&
+        ((*field_ptr)->flags & mask) == mask)
     {
       slave_print_msg(ERROR_LEVEL, rli, ER_NO_DEFAULT_FOR_FIELD,
                       "Field `%s` of table `%s`.`%s` "
@@ -6778,6 +6791,15 @@
   return 0;                                     // All OK
 }
 
+#define DBUG_PRINT_BITSET(N,FRM,BS)              \
+  do {         \
+    char buf[256];                                 \
+    for (uint i = 0 ; i < (BS)->n_bits ; ++i)      \
+      buf[i] = bitmap_is_set((BS), i) ? '1' : '0'; \
+    buf[(BS)->n_bits] = '\0';                      \
+    DBUG_PRINT((N), ((FRM), buf));                 \
+  } while (0)
+
 /*
   Replace the provided record in the database.
 
@@ -6810,6 +6832,12 @@
   int keynum;
   auto_afree_ptr<char> key(NULL);
 
+#ifndef DBUG_OFF
+  DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
+  DBUG_PRINT_BITSET("debug", "write_set = %s", table->write_set);
+  DBUG_PRINT_BITSET("debug", "read_set = %s", table->read_set);
+#endif
+
   while ((error= table->file->ha_write_row(table->record[0])))
   {
     if (error == HA_ERR_LOCK_DEADLOCK || error == HA_ERR_LOCK_WAIT_TIMEOUT)
@@ -6931,20 +6959,75 @@
 */
 static bool record_compare(TABLE *table)
 {
+  /*
+    Need to set the X bit and the filler bits in both records since
+    there are engines that do not set it correctly.
+
+    In addition, since MyISAM checks that one hasn't tampered with the
+    record, it is necessary to restore the old bytes into the record
+    after doing the comparison.
+
+    TODO[record format ndb]: Remove it once NDB returns correct
+    records. Check that the other engines also return correct records.
+   */
+
+  bool result= FALSE;
+  byte saved_x[2], saved_filler[2];
+
+  if (table->s->null_bytes > 0)
+  {
+    for (int i = 0 ; i < 2 ; ++i)
+    {
+      saved_x[i]= table->record[i][0];
+      saved_filler[i]= table->record[i][table->s->null_bytes - 1];
+      table->record[i][0]|= 1U;
+      table->record[i][table->s->null_bytes - 1]|=
+        256U - (1U << table->s->last_null_bit_pos);
+    }
+  }
+
   if (table->s->blob_fields + table->s->varchar_fields == 0)
-    return cmp_record(table,record[1]);
+  {
+    result= cmp_record(table,record[1]);
+    goto record_compare_exit;
+  }
+
   /* Compare null bits */
   if (memcmp(table->null_flags,
 	     table->null_flags+table->s->rec_buff_length,
 	     table->s->null_bytes))
-    return TRUE;				// Diff in NULL value
+  {
+    result= TRUE;				// Diff in NULL value
+    goto record_compare_exit;
+  }
+
   /* Compare updated fields */
   for (Field **ptr=table->field ; *ptr ; ptr++)
   {
     if ((*ptr)->cmp_binary_offset(table->s->rec_buff_length))
-      return TRUE;
+    {
+      result= TRUE;
+      goto record_compare_exit;
+    }
   }
-  return FALSE;
+
+record_compare_exit:
+  /*
+    Restore the saved bytes.
+
+    TODO[record format ndb]: Remove this code once NDB returns the
+    correct record format.
+  */
+  if (table->s->null_bytes > 0)
+  {
+    for (int i = 0 ; i < 2 ; ++i)
+    {
+      table->record[i][0]= saved_x[i];
+      table->record[i][table->s->null_bytes - 1]= saved_filler[i];
+    }
+  }
+
+  return result;
 }
 
 
@@ -6980,6 +7063,8 @@
 
   DBUG_ASSERT(table->in_use != NULL);
 
+  DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
+
   if ((table->file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_POSITION) &&
       table->s->primary_key < MAX_KEY)
   {
@@ -7080,15 +7165,22 @@
     while (record_compare(table))
     {
       int error;
+
       /*
         We need to set the null bytes to ensure that the filler bit
         are all set when returning.  There are storage engines that
         just set the necessary bits on the bytes and don't set the
         filler bits correctly.
+
+        TODO[record format ndb]: Remove this code once NDB returns the
+        correct record format.
       */
-      my_ptrdiff_t const pos=
-        table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0;
-      table->record[1][pos]= 0xFF;
+      if (table->s->null_bytes > 0)
+      {
+        table->record[1][table->s->null_bytes - 1]|=
+          256U - (1U << table->s->last_null_bit_pos);
+      }
+
       if ((error= table->file->index_next(table->record[1])))
       {
 	table->file->print_error(error, MYF(0));
@@ -7114,17 +7206,11 @@
     /* Continue until we find the right record or have made a full loop */
     do
     {
-      /*
-        We need to set the null bytes to ensure that the filler bit
-        are all set when returning.  There are storage engines that
-        just set the necessary bits on the bytes and don't set the
-        filler bits correctly.
-      */
-      my_ptrdiff_t const pos=
-        table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0;
-      table->record[1][pos]= 0xFF;
       error= table->file->rnd_next(table->record[1]);
 
+      DBUG_DUMP("record[0]", table->record[0], table->s->reclength);
+      DBUG_DUMP("record[1]", table->record[1], table->s->reclength);
+
       switch (error)
       {
       case 0:
@@ -7138,6 +7224,7 @@
 
       default:
 	table->file->print_error(error, MYF(0));
+        DBUG_PRINT("info", ("Record not found"));
         table->file->ha_rnd_end();
 	DBUG_RETURN(error);
       }
@@ -7147,6 +7234,7 @@
     /*
       Have to restart the scan to be able to fetch the next row.
     */
+    DBUG_PRINT("info", ("Record %sfound", restart_count == 2 ? "not " : ""));
     table->file->ha_rnd_end();
 
     DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == 0);

--- 1.319/sql/sql_class.cc	2007-03-20 09:36:06 +01:00
+++ 1.320/sql/sql_class.cc	2007-03-20 09:36:06 +01:00
@@ -2544,30 +2544,113 @@
 }
 
 
-my_size_t THD::pack_row(TABLE *table, MY_BITMAP const* cols, byte *row_data, 
-                        const byte *record) const
+/*
+  Pack a record of data for a table into a format suitable for
+  transfer via the binary log.
+
+  SYNOPSIS
+    THD::pack_row()
+    table     Table describing the format of the record
+    cols      Bitmap with a set bit for each column that should be
+              stored in the row
+    row_data  Pointer to memory where row will be written
+    record    Pointer to record that should be packed. It is assumed
+              that the pointer refers to either record[0] or
+              record[1], but no such check is made since the code does
+              not rely on that.
+
+  DESCRIPTION
+
+    The format for a row in transfer with N fields is the following:
+
+    ceil(N/8) null bytes:
+        One null bit for every column *regardless of whether it can be
+        null or not*. This simplifies the decoding. Observe that the
+        number of null bits is equal to the number of set bits in the
+        'cols' bitmap. The number of null bytes is the smallest number
+        of bytes necessary to store the null bits.
+
+        Padding bits are 1.
+
+    N packets:
+        Each field is stored in packed format.
+
+
+  RETURN VALUE
+
+    The number of bytes written at 'row_data'.
+ */
+my_size_t
+THD::pack_row(TABLE *table, MY_BITMAP const* cols,
+              byte *const row_data, const byte *record) const
 {
   Field **p_field= table->field, *field;
-  int n_null_bytes= table->s->null_bytes;
-  byte *ptr;
-  uint i;
+  int const null_byte_count= (bitmap_bits_set(cols) + 7) / 8;
+  byte *pack_ptr = row_data + null_byte_count;
+  byte *null_ptr = row_data;
   my_ptrdiff_t const rec_offset= record - table->record[0];
   my_ptrdiff_t const def_offset= table->s->default_values - table->record[0];
-  memcpy(row_data, record, n_null_bytes);
-  ptr= row_data+n_null_bytes;
 
-  for (i= 0 ; (field= *p_field) ; i++, p_field++)
+  /*
+    We write the null bits and the packed records using one pass
+    through all the fields. The null bytes are written little-endian,
+    i.e., the first fields are in the first byte.
+   */
+  unsigned int null_bits= (1U << 8) - 1;
+  // Mask to mask out the correct but among the null bits
+  unsigned int null_mask= 1U;
+  for ( ; (field= *p_field) ; p_field++)
   {
-    if (bitmap_is_set(cols,i))
+    DBUG_PRINT("debug", ("null_mask=%d; null_ptr=%p; row_data=%p; null_byte_count=%d",
+                         null_mask, null_ptr, row_data, null_byte_count));
+    if (bitmap_is_set(cols, p_field - table->field))
     {
-      my_ptrdiff_t const offset=
-        field->is_null((uint) rec_offset) ? def_offset : rec_offset;
-      field->move_field_offset(offset);
-      ptr= (byte*)field->pack((char *) ptr, field->ptr);
-      field->move_field_offset(-offset);
+      my_ptrdiff_t offset;
+      if (field->is_null(rec_offset))
+      {
+        offset= def_offset;
+        null_bits |= null_mask;
+      }
+      else
+      {
+        offset= rec_offset;
+        null_bits &= ~null_mask;
+
+        /*
+          We only store the data of the field if it is non-null
+         */
+        field->move_field_offset(offset);
+        pack_ptr= (byte*)field->pack((char *) pack_ptr, field->ptr);
+        field->move_field_offset(-offset);
+      }
+
+      null_mask <<= 1;
+      if ((null_mask & 0xFF) == 0)
+      {
+        DBUG_ASSERT(null_ptr < row_data + null_byte_count);
+        null_mask = 1U;
+        *null_ptr++ = null_bits;
+        null_bits= (1U << 8) - 1;
+      }
     }
   }
-  return (static_cast<my_size_t>(ptr - row_data));
+
+  /*
+    Write the last (partial) byte, if there is one
+  */
+  if ((null_mask & 0xFF) > 1)
+  {
+    DBUG_ASSERT(null_ptr < row_data + null_byte_count);
+    *null_ptr++ = null_bits;
+  }
+
+  /*
+    The null pointer should now point to the first byte of the
+    packed data. If it doesn't, something is very wrong.
+  */
+  DBUG_ASSERT(null_ptr == row_data + null_byte_count);
+
+  return static_cast<my_size_t>(pack_ptr - row_data);
 }
 
 

--- 1.42/mysql-test/t/mysqlbinlog.test	2007-03-20 09:36:06 +01:00
+++ 1.43/mysql-test/t/mysqlbinlog.test	2007-03-20 09:36:06 +01:00
@@ -65,7 +65,7 @@
 select "--- --position --" as "";
 --enable_query_log
 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=235 $MYSQLTEST_VARDIR/log/master-bin.000002
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=238 $MYSQLTEST_VARDIR/log/master-bin.000002
 
 # These are tests for remote binlog.
 # They should return the same as previous test.
@@ -97,7 +97,7 @@
 select "--- --position --" as "";
 --enable_query_log
 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=235 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=238 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
 
 # Bug#7853 (mysqlbinlog does not accept input from stdin)
 --disable_query_log

--- 1.18/mysql-test/r/rpl_switch_stm_row_mixed.result	2007-03-20 09:36:06 +01:00
+++ 1.19/mysql-test/r/rpl_switch_stm_row_mixed.result	2007-03-20 09:36:06 +01:00
@@ -7,6 +7,7 @@
 drop database if exists mysqltest1;
 create database mysqltest1;
 use mysqltest1;
+set @my_binlog_format= @@global.binlog_format;
 set session binlog_format=mixed;
 show session variables like "binlog_format%";
 Variable_name	Value
@@ -1025,3 +1026,4 @@
 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;
+set global binlog_format =@my_binlog_format;

--- 1.15/mysql-test/t/rpl_switch_stm_row_mixed.test	2007-03-20 09:36:06 +01:00
+++ 1.16/mysql-test/t/rpl_switch_stm_row_mixed.test	2007-03-20 09:36:06 +01:00
@@ -19,6 +19,8 @@
 --enable_warnings
 use mysqltest1;
 
+# Save binlog format
+set @my_binlog_format= @@global.binlog_format;
 
 #  play with switching
 set session binlog_format=mixed;
@@ -531,7 +533,7 @@
 # will be created. You will need to go to the mysql-test dir and diff
 # the files your self to see what is not matching
 
---exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
 
 connection master;
 --replace_column 2 # 5 #
@@ -559,8 +561,12 @@
 --exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info mysqltest1 > $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql
 # the old mysqldump output on slave is the same as what it was on
 # master before restoring on master.
---exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
+diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql;
 }
 
 drop database mysqltest1;
 sync_slave_with_master;
+
+connection master;
+# Restore binlog format setting
+set global binlog_format =@my_binlog_format;

--- 1.17/mysql-test/r/rpl_ndb_log.result	2007-03-20 09:36:06 +01:00
+++ 1.18/mysql-test/r/rpl_ndb_log.result	2007-03-20 09:36:06 +01:00
@@ -32,16 +32,17 @@
 master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
 master-bin.000001	#	Table_map	1	#	table_id: # (mysql.ndb_apply_status)
 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	#	COMMIT
-show binlog events from 102 limit 1;
+show binlog events from 105 limit 1;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	1	#	use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB
-show binlog events from 102 limit 2;
+show binlog events from 105 limit 2;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	1	#	use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB
 master-bin.000001	#	Query	1	#	BEGIN
-show binlog events from 102 limit 2,1;
+show binlog events from 105 limit 2,1;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
 flush logs;
@@ -71,6 +72,7 @@
 master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
 master-bin.000001	#	Table_map	1	#	table_id: # (mysql.ndb_apply_status)
 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	#	COMMIT
 master-bin.000001	#	Rotate	1	#	master-bin.000002;pos=4
@@ -87,13 +89,13 @@
 master-bin.000002	#	Query	1	#	COMMIT
 show binary logs;
 Log_name	File_size
-master-bin.000001	1702
-master-bin.000002	593
+master-bin.000001	1734
+master-bin.000002	596
 start slave;
 show binary logs;
 Log_name	File_size
-slave-bin.000001	1797
-slave-bin.000002	198
+slave-bin.000001	1829
+slave-bin.000002	201
 show binlog events in 'slave-bin.000001' from 4;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 slave-bin.000001	#	Format_desc	2	#	Server ver: VERSION, Binlog ver: 4
@@ -110,6 +112,7 @@
 slave-bin.000001	#	Table_map	2	#	table_id: # (test.t1)
 slave-bin.000001	#	Table_map	2	#	table_id: # (mysql.ndb_apply_status)
 slave-bin.000001	#	Write_rows	2	#	table_id: #
+slave-bin.000001	#	Write_rows	2	#	table_id: #
 slave-bin.000001	#	Write_rows	2	#	table_id: # flags: STMT_END_F
 slave-bin.000001	#	Query	2	#	COMMIT
 slave-bin.000001	#	Query	1	#	use `test`; create table t3 (a int)ENGINE=NDB
@@ -126,7 +129,7 @@
 slave-bin.000002	#	Query	2	#	COMMIT
 show slave status;
 Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master
-#	127.0.0.1	root	MASTER_PORT	1	master-bin.000002	593	#	#	master-bin.000002	Yes	Yes				#			0		0	593	#	None		0	No						#
+#	127.0.0.1	root	MASTER_PORT	1	master-bin.000002	596	#	#	master-bin.000002	Yes	Yes				#			0		0	596	#	None		0	No						#
 show binlog events in 'slave-bin.000005' from 4;
 ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
 DROP TABLE t1;

--- 1.13/mysql-test/r/rpl_row_log_innodb.result	2007-03-20 09:36:06 +01:00
+++ 1.14/mysql-test/r/rpl_row_log_innodb.result	2007-03-20 09:36:06 +01:00
@@ -115,9 +115,9 @@
 insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
 show binlog events;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-slave-bin.000001	#	Format_desc	2	#	Server ver: VERSION, Binlog ver: 4
-slave-bin.000001	#	Table_map	2	#	table_id: # (test.t1)
-slave-bin.000001	#	Write_rows	2	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Format_desc	1	#	Server ver: VERSION, Binlog ver: 4
+master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
 select * from t1;
 a	b
 1	1

--- 1.13/mysql-test/r/rpl_row_log.result	2007-03-20 09:36:06 +01:00
+++ 1.14/mysql-test/r/rpl_row_log.result	2007-03-20 09:36:06 +01:00
@@ -107,9 +107,9 @@
 insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
 show binlog events;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
-slave-bin.000001	#	Format_desc	2	#	Server ver: VERSION, Binlog ver: 4
-slave-bin.000001	#	Table_map	2	#	table_id: # (test.t1)
-slave-bin.000001	#	Write_rows	2	#	table_id: # flags: STMT_END_F
+master-bin.000001	#	Format_desc	1	#	Server ver: VERSION, Binlog ver: 4
+master-bin.000001	#	Table_map	1	#	table_id: # (test.t1)
+master-bin.000001	#	Write_rows	1	#	table_id: # flags: STMT_END_F
 select * from t1;
 a	b
 1	1

--- 1.13/mysql-test/r/rpl_row_basic_11bugs.result	2007-03-20 09:36:06 +01:00
+++ 1.14/mysql-test/r/rpl_row_basic_11bugs.result	2007-03-20 09:36:06 +01:00
@@ -97,6 +97,7 @@
 7
 8
 9
+SET GLOBAL QUERY_CACHE_SIZE=0;
 ================ Test for BUG#22550 ================
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 reset master;

--- 1.12/mysql-test/t/rpl_row_basic_11bugs.test	2007-03-20 09:36:06 +01:00
+++ 1.13/mysql-test/t/rpl_row_basic_11bugs.test	2007-03-20 09:36:06 +01:00
@@ -92,6 +92,8 @@
 sync_slave_with_master;
 SELECT * FROM t1;
 
+SET GLOBAL QUERY_CACHE_SIZE=0;
+
 # Bug#22550: Replication of BIT columns failing
 --echo ================ Test for BUG#22550 ================
 --disable_query_log

--- 1.74/mysql-test/r/rpl_stm_log.result	2007-03-20 09:36:06 +01:00
+++ 1.75/mysql-test/r/rpl_stm_log.result	2007-03-20 09:36:06 +01:00
@@ -26,14 +26,14 @@
 master-bin.000001	#	Query	1	#	use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
 master-bin.000001	#	Begin_load_query	1	#	;file_id=1;block_len=581
 master-bin.000001	#	Execute_load_query	1	#	use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
-show binlog events from 102 limit 1;
+show binlog events from 105 limit 1;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	1	#	use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
-show binlog events from 102 limit 2;
+show binlog events from 105 limit 2;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	1	#	use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
 master-bin.000001	#	Intvar	1	#	INSERT_ID=1
-show binlog events from 102 limit 2,1;
+show binlog events from 105 limit 2,1;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 master-bin.000001	#	Query	1	#	use `test`; insert into t1 values (NULL)
 flush logs;
@@ -66,13 +66,13 @@
 master-bin.000002	#	Query	1	#	use `test`; insert into t2 values (1)
 show binary logs;
 Log_name	File_size
-master-bin.000001	1343
-master-bin.000002	388
+master-bin.000001	1346
+master-bin.000002	391
 start slave;
 show binary logs;
 Log_name	File_size
-slave-bin.000001	1443
-slave-bin.000002	289
+slave-bin.000001	1446
+slave-bin.000002	292
 show binlog events in 'slave-bin.000001' from 4;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 slave-bin.000001	#	Format_desc	2	#	Server ver: VERSION, Binlog ver: 4
@@ -92,7 +92,7 @@
 slave-bin.000002	#	Query	1	#	use `test`; insert into t2 values (1)
 show slave status;
 Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master
-#	127.0.0.1	root	MASTER_PORT	1	master-bin.000002	388	#	#	master-bin.000002	Yes	Yes				#			0		0	388	#	None		0	No						#
+#	127.0.0.1	root	MASTER_PORT	1	master-bin.000002	391	#	#	master-bin.000002	Yes	Yes				#			0		0	391	#	None		0	No						#
 show binlog events in 'slave-bin.000005' from 4;
 ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
 DROP TABLE t1;

--- 1.42/mysql-test/extra/rpl_tests/rpl_log.test	2007-03-20 09:36:06 +01:00
+++ 1.43/mysql-test/extra/rpl_tests/rpl_log.test	2007-03-20 09:36:06 +01:00
@@ -125,6 +125,8 @@
 --error 1220
 show binlog events in 'slave-bin.000005' from 4;
 
+connection master;
+
 # The table drops caused Cluster Replication wrapper to fail as event ID would never be the same.# Moving drops here.
 
 DROP TABLE t1;
@@ -148,4 +150,6 @@
 drop table t1;
 
 # End of 4.1 tests
+
+sync_with_master;
 
Thread
bk commit into 5.1 tree (mats:1.2477)Mats Kindahl20 Mar