diff options
author | gshchepa/uchum@gleb.loc <> | 2007-07-13 19:36:10 +0500 |
---|---|---|
committer | gshchepa/uchum@gleb.loc <> | 2007-07-13 19:36:10 +0500 |
commit | 1674d8dc35865888a84e8712bfee0cba14be7618 (patch) | |
tree | ae381d395c7ae8ceab1ab3c80e277730c30de334 /sql/field_conv.cc | |
parent | ccfab37b71547195038b47094142002b03659cbd (diff) | |
parent | d6ad4e6eb91b88145090f03d2e1338d065f775ca (diff) | |
download | mariadb-git-1674d8dc35865888a84e8712bfee0cba14be7618.tar.gz |
Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into gleb.loc:/home/uchum/work/bk/5.1-opt
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r-- | sql/field_conv.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 44aea9acee0..33c7897c3db 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -795,11 +795,18 @@ int field_conv(Field *to,Field *from) blob->value.copy(); return blob->store(blob->value.ptr(),blob->value.length(),from->charset()); } - if ((from->result_type() == STRING_RESULT && - (to->result_type() == STRING_RESULT || - (from->real_type() != MYSQL_TYPE_ENUM && - from->real_type() != MYSQL_TYPE_SET))) || - to->type() == MYSQL_TYPE_DECIMAL) + if (from->real_type() == MYSQL_TYPE_ENUM && + to->real_type() == MYSQL_TYPE_ENUM && + from->val_int() == 0) + { + ((Field_enum *)(to))->store_type(0); + return 0; + } + else if ((from->result_type() == STRING_RESULT && + (to->result_type() == STRING_RESULT || + (from->real_type() != MYSQL_TYPE_ENUM && + from->real_type() != MYSQL_TYPE_SET))) || + to->type() == MYSQL_TYPE_DECIMAL) { char buff[MAX_FIELD_WIDTH]; String result(buff,sizeof(buff),from->charset()); |