summaryrefslogtreecommitdiff
path: root/sql/rpl_record.cc
diff options
context:
space:
mode:
authorunknown <mats@kindahl-laptop.dnsalias.net>2007-10-12 09:40:24 +0200
committerunknown <mats@kindahl-laptop.dnsalias.net>2007-10-12 09:40:24 +0200
commit589ef1a7d2b406ef14c8a5ef0eeedffaa48ee0a8 (patch)
treee2f2754e09749cc68a75e0f08acb5bf894414d62 /sql/rpl_record.cc
parent96ec459dba8e58c298a0b7fa6271b44d46d6ab73 (diff)
parent38b24c7a586b36f4246e815e69ad36b0e723cca3 (diff)
downloadmariadb-git-589ef1a7d2b406ef14c8a5ef0eeedffaa48ee0a8.tar.gz
Merge kindahl-laptop.dnsalias.net:/home/bkroot/mysql-5.1-rpl
into kindahl-laptop.dnsalias.net:/home/bk/b29549-mysql-5.1-target-5.1.22 mysql-test/suite/rpl/t/disabled.def: Auto merged mysql-test/suite/rpl_ndb/t/disabled.def: Auto merged sql/log.cc: Auto merged sql/rpl_record.cc: Auto merged sql/sql_show.cc: Auto merged BitKeeper/deleted/.del-rpl_ndb_innodb2ndb.result~1: Delete: mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result BitKeeper/deleted/.del-rpl_ndb_myisam2ndb.result~1: Delete: mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt: Manual merge mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test: Manual merge mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt: Manual merge mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test: Manual merge sql/log_event.cc: Manual merge sql/field.cc: Manual merge and adding comment. sql/field.h: Manual merge.
Diffstat (limited to 'sql/rpl_record.cc')
-rw-r--r--sql/rpl_record.cc54
1 files changed, 22 insertions, 32 deletions
diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc
index 65c8e106112..e492a5fccb4 100644
--- a/sql/rpl_record.cc
+++ b/sql/rpl_record.cc
@@ -65,6 +65,8 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
my_ptrdiff_t const rec_offset= record - table->record[0];
my_ptrdiff_t const def_offset= table->s->default_values - table->record[0];
+ DBUG_ENTER("pack_row");
+
/*
We write the null bits and the packed records using one pass
through all the fields. The null bytes are written little-endian,
@@ -96,26 +98,14 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
For big-endian machines, we have to make sure that the
length is stored in little-endian format, since this is the
format used for the binlog.
-
- We do this by setting the db_low_byte_first, which is used
- inside some store_length() to decide what order to write the
- bytes in.
-
- In reality, db_log_byte_first is only set for legacy table
- type Isam, but in the event of a bug, we need to guarantee
- the endianess when writing to the binlog.
-
- This is currently broken for NDB due to BUG#29549, so we
- will fix it when NDB has fixed their way of handling BLOBs.
*/
-#if 0
- bool save= table->s->db_low_byte_first;
- table->s->db_low_byte_first= TRUE;
-#endif
- pack_ptr= field->pack(pack_ptr, field->ptr + offset);
-#if 0
- table->s->db_low_byte_first= save;
-#endif
+ const uchar *old_pack_ptr= pack_ptr;
+ pack_ptr= field->pack(pack_ptr, field->ptr + offset,
+ field->max_data_length(), TRUE);
+ DBUG_PRINT("debug", ("field: %s; pack_ptr: 0x%lx;"
+ " pack_ptr':0x%lx; bytes: %d",
+ field->field_name, (ulong) old_pack_ptr,
+ (ulong) pack_ptr, pack_ptr - old_pack_ptr));
}
null_mask <<= 1;
@@ -143,8 +133,8 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
packed data. If it doesn't, something is very wrong.
*/
DBUG_ASSERT(null_ptr == row_data + null_byte_count);
-
- return static_cast<size_t>(pack_ptr - row_data);
+ DBUG_DUMP("row_data", row_data, pack_ptr - row_data);
+ DBUG_RETURN(static_cast<size_t>(pack_ptr - row_data));
}
#endif
@@ -242,18 +232,14 @@ unpack_row(Relay_log_info const *rli,
Use the master's size information if available else call
normal unpack operation.
*/
-#if 0
- bool save= table->s->db_low_byte_first;
- table->s->db_low_byte_first= TRUE;
-#endif
uint16 const metadata= tabledef->field_metadata(i);
- if (tabledef && metadata)
- pack_ptr= f->unpack(f->ptr, pack_ptr, metadata);
- else
- pack_ptr= f->unpack(f->ptr, pack_ptr);
-#if 0
- table->s->db_low_byte_first= save;
-#endif
+ uchar const *const old_pack_ptr= pack_ptr;
+ pack_ptr= f->unpack(f->ptr, pack_ptr, metadata, TRUE);
+ DBUG_PRINT("debug", ("field: %s; metadata: 0x%x;"
+ " pack_ptr: 0x%lx; pack_ptr': 0x%lx; bytes: %d",
+ f->field_name, metadata,
+ (ulong) old_pack_ptr, (ulong) pack_ptr,
+ pack_ptr - old_pack_ptr));
}
null_mask <<= 1;
@@ -265,6 +251,7 @@ unpack_row(Relay_log_info const *rli,
throw away master's extra fields
*/
uint max_cols= min(tabledef->size(), cols->n_bits);
+ DBUG_PRINT("debug", ("Master has %u fields, slave %u", tabledef->size(), cols->n_bits));
for (; i < max_cols; i++)
{
if (bitmap_is_set(cols, i))
@@ -279,6 +266,7 @@ unpack_row(Relay_log_info const *rli,
if (!((null_bits & null_mask) && tabledef->maybe_null(i)))
pack_ptr+= tabledef->calc_field_size(i, (uchar *) pack_ptr);
+ DBUG_PRINT("debug", ("pack_ptr: 0x%lx", (ulong) pack_ptr));
null_mask <<= 1;
}
}
@@ -289,6 +277,8 @@ unpack_row(Relay_log_info const *rli,
*/
DBUG_ASSERT(null_ptr == row_data + master_null_byte_count);
+ DBUG_DUMP("row_data", row_data, pack_ptr - row_data);
+
*row_end = pack_ptr;
if (master_reclength)
{