List:Commits« Previous MessageNext Message »
From:Tatiana A. Nurnberg Date:June 26 2009 5:29am
Subject:bzr commit into mysql-5.4 branch (azundris:2811) Bug#17903
View as plain text  
#At file:///misc/mysql/forest/60-17903/ based on
revid:alik@stripped

 2811 Tatiana A. Nurnberg	2009-06-26
      Bug#17903: cast to char results in binary
      
      Regression. The character set was not being properly initialized
      for CAST() with a type like CHAR(2) BINARY, which resulted in
      incorrect results or even a server crash.
      
      Added needed initialization. Re-enabled test case, and updated it.
     @ mysql-test/r/cast.result
        update results, Raider is now Twix, and the error's a warning now
     @ mysql-test/t/disabled.def
        re-enable "cast", that shoulda been on as per 5.1 anyway
     @ sql/sql_yacc.yy
        Need to reset charset here, otherwise, we'll get all kinds of random
        carry-overs, leading to wrong data, or even crashes. Do not want!

    modified:
      mysql-test/r/cast.result
      mysql-test/t/disabled.def
      sql/sql_yacc.yy
=== modified file 'mysql-test/r/cast.result'
--- a/mysql-test/r/cast.result	2009-05-21 10:07:43 +0000
+++ b/mysql-test/r/cast.result	2009-06-26 03:29:11 +0000
@@ -380,7 +380,7 @@ select cast(s1 as decimal(7,2)) from t1;
 cast(s1 as decimal(7,2))
 99999.99
 Warnings:
-Error	1264	Out of range value for column 'cast(s1 as decimal(7,2))' at row 1
+Warning	1264	Out of range value for column 'cast(s1 as decimal(7,2))' at row 1
 drop table t1;
 CREATE TABLE t1 (v varchar(10), tt tinytext, t text,
 mt mediumtext, lt longtext);

=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def	2009-06-25 11:50:39 +0000
+++ b/mysql-test/t/disabled.def	2009-06-26 03:29:11 +0000
@@ -9,7 +9,6 @@
 #  Do not use any TAB characters for whitespace.
 #
 ##############################################################################
-cast                 : Bug#35594 2008-03-27 main.cast fails on Windows2003-64
 kill                 : Bug#37780 2008-12-03 HHunger need some changes to be robust enough
for pushbuild.
 innodb_bug39438      : Bug#42383 2009-01-28 lsoares "This fails in embedded and on
windows.  Note that this test is not run on windows and on embedded in PB for main trees
currently"
 query_cache_28249    : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2009-06-12 02:01:08 +0000
+++ b/sql/sql_yacc.yy	2009-06-26 03:29:11 +0000
@@ -5626,7 +5626,11 @@ opt_binary:
         | unicode
         | BYTE_SYM { Lex->charset=&my_charset_bin; }
         | charset charset_name opt_bin_mod { Lex->charset=$2; }
-        | BINARY { Lex->type|= BINCMP_FLAG; }
+        | BINARY
+          {
+            Lex->charset= NULL;
+            Lex->type|= BINCMP_FLAG;
+          }
         | BINARY charset charset_name
           {
             Lex->charset= $3;


Attachment: [text/bzr-bundle] bzr/azundris@mysql.com-20090626032911-yl5vvy09057v7dgl.bundle
Thread
bzr commit into mysql-5.4 branch (azundris:2811) Bug#17903Tatiana A. Nurnberg26 Jun 2009