summaryrefslogtreecommitdiff
path: root/sql/rpl_record.cc
diff options
context:
space:
mode:
authorcbell/Chuck@mysql_cab_desk. <>2007-08-02 16:15:52 -0400
committercbell/Chuck@mysql_cab_desk. <>2007-08-02 16:15:52 -0400
commite8aff507905cd4940d5e2fc6556d41f04013ad2f (patch)
treec4fbe3d1ef77a826ef6815de683872302b6463fc /sql/rpl_record.cc
parentdc2cab6561e751c22175bddaeeaf0de866e2bee3 (diff)
downloadmariadb-git-e8aff507905cd4940d5e2fc6556d41f04013ad2f.tar.gz
WL#3228 (NDB) : RBR using different table defs on slave/master
This patch corrects a problem found during testing on Solaris. The code changes how length values are retrieved on big endian machines. The patch allows the rpl_extraColmaster tests to run on these machines.
Diffstat (limited to 'sql/rpl_record.cc')
-rw-r--r--sql/rpl_record.cc31
1 files changed, 30 insertions, 1 deletions
diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc
index 094ccbcdd7d..8772729763f 100644
--- a/sql/rpl_record.cc
+++ b/sql/rpl_record.cc
@@ -92,8 +92,30 @@ pack_row(TABLE *table, MY_BITMAP const* cols,
/*
We only store the data of the field if it is non-null
- */
+
+ 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
}
null_mask <<= 1;
@@ -229,10 +251,17 @@ 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
if (tabledef && tabledef->field_metadata(i))
pack_ptr= f->unpack(f->ptr, pack_ptr, tabledef->field_metadata(i));
else
pack_ptr= f->unpack(f->ptr, pack_ptr);
+#if 0
+ table->s->db_low_byte_first= save;
+#endif
}
bitmap_set_bit(rw_set, f->field_index);