Below is the list of changes that have just been committed into a local
5.1 repository of cbell. When cbell 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-09-07 13:31:38-04:00, cbell@mysql_cab_desk. +2 -0
BUG#30790 : Suspicious code in rpl_utility.cc
This patch clarifies some of the coding choices with documentationa and
removes a limitation in the code for future expansion of the CHAR and
BINARY fields to length > 255.
sql/log_event.cc@stripped, 2007-09-07 13:31:26-04:00, cbell@mysql_cab_desk. +10 -0
BUG#30790 : Suspicious code in rpl_utility.cc
This patch adds comments to help explain the choice of variable types.
sql/rpl_utility.cc@stripped, 2007-09-07 13:31:26-04:00, cbell@mysql_cab_desk. +5 -1
BUG#30790 : Suspicious code in rpl_utility.cc
This patch removes the mask to allow length to be > 255. This is a
future expansion measure since CHAR fields are limited to 255 characters.
The code mirrors that of the packing methods in field.cc that are written
to permit > 255 characters for CHAR -type fields should that change be
made in the future.
diff -Nrup a/sql/log_event.cc b/sql/log_event.cc
--- a/sql/log_event.cc 2007-08-27 14:27:42 -04:00
+++ b/sql/log_event.cc 2007-09-07 13:31:26 -04:00
@@ -6469,6 +6469,16 @@ void Rows_log_event::print_helper(FILE *
data) in the table map are initialized as zero (0). The array size is the
same as the columns for the table on the slave.
+ Additionally, values saved for field metadata on the master are saved as a
+ string of bytes (uchar) in the binlog. A field may require 1 or more bytes
+ to store the information. In cases where values require multiple bytes
+ (e.g. values > 255), the endian-safe methods are used to properly encode
+ the values on the master and decode them on the slave. When the field
+ metadata values are captured on the slave, they are stored in an array of
+ type uint16. This allows the least number of casts to prevent casting bugs
+ when the field metadata is used in comparisons of field attributes. When
+ the field metadata is used for calculating addresses in pointer math, the
+ type used is uint32.
*/
/**
diff -Nrup a/sql/rpl_utility.cc b/sql/rpl_utility.cc
--- a/sql/rpl_utility.cc 2007-08-27 07:43:58 -04:00
+++ b/sql/rpl_utility.cc 2007-09-07 13:31:26 -04:00
@@ -47,7 +47,11 @@ uint32 table_def::calc_field_size(uint c
length= m_field_metadata[col] & 0x00ff;
else
{
- length= m_field_metadata[col] & 0x00ff;
+ /*
+ Currently, MYSQL_TYPE_STRING is limited to 255 characters. The
+ following code is implemented to allow the expansion of that
+ restriction.
+ */
DBUG_ASSERT(length > 0);
if (length > 255)
{