diff options
author | unknown <brian@zim.(none)> | 2006-08-14 03:29:17 -0700 |
---|---|---|
committer | unknown <brian@zim.(none)> | 2006-08-14 03:29:17 -0700 |
commit | ba8be73946c35852cf296c2d30bbf2a0fe06f87f (patch) | |
tree | bc2caebf2da50b2545ebd2d4d83e7e9f758fa6d3 /sql/field.h | |
parent | 6071b686b179d1fcc96cd6ccce940d62bd509c70 (diff) | |
download | mariadb-git-ba8be73946c35852cf296c2d30bbf2a0fe06f87f.tar.gz |
Fix for bug#20648 We introduce a new field method for knowing "real size", and we now in archive null unused bits of a row to null before writing.
sql/field.cc:
data_length for field needs to be calculated directly.
sql/field.h:
The new method data_length() returns the "real" length of the field.
sql/ha_archive.cc:
Before a write_row() archive nulls space beyond the size of the row in varchars to make sure that compression only sees NULL.
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/field.h b/sql/field.h index 3306c4123db..2ad564fc753 100644 --- a/sql/field.h +++ b/sql/field.h @@ -144,6 +144,11 @@ public: table, which is located on disk). */ virtual uint32 pack_length_in_rec() const { return pack_length(); } + + /* + data_length() return the "real size" of the data in memory. + */ + virtual uint32 data_length(const char *from) { return pack_length(); } virtual uint32 sort_length() const { return pack_length(); } virtual void reset(void) { bzero(ptr,pack_length()); } virtual void reset_fields() {} @@ -1102,6 +1107,7 @@ public: int key_cmp(const byte *str, uint length); uint packed_col_length(const char *to, uint length); uint max_packed_col_length(uint max_length); + uint data_length(const char *from); uint size_of() const { return sizeof(*this); } enum_field_types real_type() const { return MYSQL_TYPE_VARCHAR; } bool has_charset(void) const |