diff options
author | unknown <cbell/Chuck@mysql_cab_desk.> | 2007-09-14 11:22:41 -0400 |
---|---|---|
committer | unknown <cbell/Chuck@mysql_cab_desk.> | 2007-09-14 11:22:41 -0400 |
commit | d458d941f9b81fccbb82e6b9a249f888b22031b1 (patch) | |
tree | 842348f926dc278b89c6761445c922cfa60b6090 /sql/field.cc | |
parent | cb96787d6667c9e702846dc6be5f59262d816597 (diff) | |
download | mariadb-git-d458d941f9b81fccbb82e6b9a249f888b22031b1.tar.gz |
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/field.cc:
BUG#30790 : Suspicious code in rpl_utility.cc
This patch adds an assertion to ensure we are not attempting to encode
negative values.
sql/log_event.cc:
BUG#30790 : Suspicious code in rpl_utility.cc
This patch adds comments to help explain the choice of variable types.
sql/rpl_utility.cc:
BUG#30790 : Suspicious code in rpl_utility.cc
This patch removes code from the calc_field_size that is not needed and
was ambiguous. Originally intended to future expansion, the code was
not needed.
Also added are comments to help explain some portions of the code.
A change was made to the korr method to use the unsigned version to
avoid extended sign problems.
sql/rpl_utility.h:
BUG#30790 : Suspicious code in rpl_utility.cc
This patch corrects some type discrepencies and removes an extra cast.
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/field.cc b/sql/field.cc index 1b01d626512..9e86e405512 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -6732,6 +6732,7 @@ const uint Field_varstring::MAX_SIZE= UINT_MAX16; int Field_varstring::do_save_field_metadata(uchar *metadata_ptr) { char *ptr= (char *)metadata_ptr; + DBUG_ASSERT(field_length <= 65535); int2store(ptr, field_length); return 2; } |