|
|||||||||||
|
bk commit into 4.1 tree (gshchepa:1.2670) BUG#29251
From: <gshchepa(at)mysql.com>
Date: Tue Jun 26 2007 - 18:33:55 EDT
ChangeSet@1.2670, 2007-06-27 03:33:51+05:00, gshchepa@gleb.loc +3 -0
Fixed bug #29251.
Special 0 ENUM value has the same string representation as normal ENUM value defined as '' (empty string). The do_field_string function was used to conver ENUM data during the ALTER TABLE request, but that function doesn't care about numerical "indices" of ENUM values, i.e. do_field_string doesn't distinguish special 0 value from normal empty string value. New copy function (do_field_enum) has been added to copy special 0 ENUM values without conversion to string. mysql-test/r/type_enum.result@1.28, 2007-06-27 03:32:41+05:00, gshchepa@gleb.loc +23 -0 Updated test case for bug #29251. mysql-test/t/type_enum.test@1.18, 2007-06-27 03:32:38+05:00, gshchepa@gleb.loc +17 -0 Updated test case for bug #29251.
sql/field_conv.cc@1.40, 2007-06-27 03:32:35+05:00, gshchepa@gleb.loc +16 -1
Fixed bug #29251.
diff -Nrup a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result --- a/mysql-test/r/type_enum.result 2007-02-12 17:31:43 +04:00@@ -1778,4 +1778,27 @@ drop table t1; create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ',' !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\','zz ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ')); ERROR 42000: Field separator argument is not what is expected; check the manual +CREATE TABLE t1 ( +id INT AUTO_INCREMENT PRIMARY KEY, +c1 ENUM('a', '', 'b') +); +INSERT INTO t1 (c1) VALUES (0), ('a'), (''), ('b'); +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +SELECT id, c1 + 0, c1 FROM t1; +id c1 + 0 c1 +1 0 +2 1 a +3 2 +4 3 b +ALTER TABLE t1 CHANGE c1 c1 ENUM('a', '') NOT NULL; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 4 +SELECT id, c1 + 0, c1 FROM t1; +id c1 + 0 c1 +1 0 +2 1 a +3 2 +4 0 +DROP TABLE t1; End of 4.1 tests diff -Nrup a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test --- a/mysql-test/t/type_enum.test 2007-02-12 17:31:43 +04:00@@ -156,4 +156,21 @@ drop table t1; create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ',' !"','#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~','xx\','yy\','zz ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ')); +# --- a/sql/field_conv.cc 2007-02-01 18:00:23 +04:00@@ -311,6 +311,15 @@ static void do_field_string(Copy_field * } +static void do_field_enum(Copy_field *copy)
to->real_type() == FIELD_TYPE_SET)
{
if (!to->eq_def(from))
- return do_field_string;
-- MySQL Code Commits Mailing List For list archives: http://lists.mysql.com/commits To unsubscribe: http://lists.mysql.com/commits?unsub=lists@pantek.comReceived on Tue Jun 26 22:53:08 2007 This archive was generated by hypermail 2.1.8 : Tue Jun 26 2007 - 23:00:02 EDT |
||||||||||
|
|||||||||||