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.cc | |
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.cc')
-rw-r--r-- | sql/field.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/field.cc b/sql/field.cc index 2c484bb0979..8395b8c6145 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -6412,6 +6412,11 @@ void Field_varstring::sql_type(String &res) const } +uint Field_varstring::data_length(const char *from) +{ + return length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr); +} + /* Functions to create a packed row. Here the number of length bytes are depending on the given max_length |