summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/t/outfile.test6
-rw-r--r--sql/field.cc1
-rw-r--r--sql/item.cc2
3 files changed, 5 insertions, 4 deletions
diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test
index 3d524cb35a2..a944df01051 100644
--- a/mysql-test/t/outfile.test
+++ b/mysql-test/t/outfile.test
@@ -22,7 +22,7 @@
#select load_file("/tmp/select-test.not-exist");
#drop table t1;
#drop table if exists t;
-#CREATE TABLE t ( t timestamp NOT NULL, c char(200) character set latin1 NOT NULL default '', KEY t (t)) TYPE=MyISAM;
-#INSERT INTO t VALUES ('2002-12-20 12:01:20','');
-#select * from t into outfile "fdg";
+#CREATE TABLE t ( t timestamp NOT NULL, c char(200) character set latin1 NOT NULL default '', i int(11), v varchar(200), b blob, KEY t (t)) TYPE=MyISAM;
+#INSERT INTO t VALUES ('2002-12-20 12:01:20','',1,"aaa","bbb");
+#select * from t into outfile "check";
#drop table if exists t;
diff --git a/sql/field.cc b/sql/field.cc
index 1a0b5d496b2..13bf50a91f5 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -2844,7 +2844,6 @@ String *Field_timestamp::val_str(String *val_buffer,
val_buffer->alloc(field_length+1);
char *to=(char*) val_buffer->ptr(),*end=to+field_length;
val_buffer->length(field_length);
- val_buffer->set_charset(val_ptr->charset());
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
diff --git a/sql/item.cc b/sql/item.cc
index c6cce9a5b48..b0b56bf9101 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -193,6 +193,7 @@ String *Item_field::val_str(String *str)
{
if ((null_value=field->is_null()))
return 0;
+ str->set_charset(str_value.charset());
return field->val_str(str,&str_value);
}
@@ -215,6 +216,7 @@ String *Item_field::str_result(String *str)
{
if ((null_value=result_field->is_null()))
return 0;
+ str->set_charset(str_value.charset());
return result_field->val_str(str,&str_value);
}