diff options
author | unknown <hf@deer.(none)> | 2004-03-23 17:57:14 +0400 |
---|---|---|
committer | unknown <hf@deer.(none)> | 2004-03-23 17:57:14 +0400 |
commit | b7b69c5d2fe953d2ffe5645e994a1d9c572098dc (patch) | |
tree | 9d21220431fe6e44974cb0d6254ce2dbbe7afebb /sql | |
parent | a25455eea533974a2106be75605ca3ee8377da76 (diff) | |
download | mariadb-git-b7b69c5d2fe953d2ffe5645e994a1d9c572098dc.tar.gz |
Fix for #3266 (garbled TEXT fields as a result of CREATE TABLE SELECT)
Problem is that Item::save_in_field modifies str_value member
before it calls val_str but Item_copy_string::val_str just returns
this str_value as the result.
I added local String variable to the Item::save_in_field
mysql-test/r/create.result:
appropriate test result
mysql-test/t/create.test:
test case
sql/item.cc:
local variable added to keep the result
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item.cc b/sql/item.cc index 7549bac71b8..59f3bc7077e 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1282,8 +1282,8 @@ int Item::save_in_field(Field *field, bool no_conversions) String *result; CHARSET_INFO *cs= collation.collation; char buff[MAX_FIELD_WIDTH]; // Alloc buffer for small columns - str_value.set_quick(buff,sizeof(buff),cs); - result=val_str(&str_value); + String loc_value(buff, sizeof(buff), cs); + result=val_str(&loc_value); if (null_value) return set_field_to_null_with_conversions(field, no_conversions); field->set_notnull(); |