summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2004-03-23 17:57:14 +0400
committerunknown <hf@deer.(none)>2004-03-23 17:57:14 +0400
commitb7b69c5d2fe953d2ffe5645e994a1d9c572098dc (patch)
tree9d21220431fe6e44974cb0d6254ce2dbbe7afebb /sql
parenta25455eea533974a2106be75605ca3ee8377da76 (diff)
downloadmariadb-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.cc4
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();