MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Satya B Date:November 25 2009 6:55am
Subject:bzr commit into mysql-5.1-bugteam branch (satya.bn:3219) Bug#47671
View as plain text  
#At file:///home/satya/WORK/47671/mysql-5.1-bugteam-47671/ based on revid:jimw@stripped

 3219 Satya B	2009-11-25
      Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
      
      mysql client displays wrong character-set of server. When a user changes the
      charset of a server, mysql client 'status' command displays wrong charset but
      the command "SHOW VARIABLES LIKE "%charset%" displayed correct charset results.
      The problem is only with the mysql client's 'status' command output.
      
      In mysql client, the method mysql_store_lazy_result() returns 0 for
      success and non-zero for failure. The method com_status() was using this method
      wrongly. Fixed all such instances according to return value of the method 
      mysql_store_lazy_result().
     @ client/mysql.cc
        Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
        
        Fix com_status() method to use mysql_store_lazy_result() properly.
     @ mysql-test/r/bug47671.result
        Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
        
        Testcase for BUG#47671
     @ mysql-test/t/bug47671-master.opt
        Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
        
        Testcase for BUG#47671
     @ mysql-test/t/bug47671.test
        Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
        
        Testcase for BUG#47671

    added:
      mysql-test/r/bug47671.result
      mysql-test/t/bug47671-master.opt
      mysql-test/t/bug47671.test
    modified:
      client/mysql.cc
=== modified file 'client/mysql.cc'
--- a/client/mysql.cc	2009-11-23 22:46:25 +0000
+++ b/client/mysql.cc	2009-11-25 06:55:49 +0000
@@ -4335,7 +4335,7 @@ com_status(String *buffer __attribute__(
     Don't remove "limit 1",
     it is protection againts SQL_SELECT_LIMIT=0
   */
-  if (mysql_store_result_for_lazy(&result))
+  if (!mysql_store_result_for_lazy(&result))
   {
     MYSQL_ROW cur=mysql_fetch_row(result);
     if (cur)
@@ -4379,7 +4379,7 @@ com_status(String *buffer __attribute__(
     if (mysql_errno(&mysql) == CR_SERVER_GONE_ERROR)
       return 0;
   }
-  if (mysql_store_result_for_lazy(&result))
+  if (!mysql_store_result_for_lazy(&result))
   {
     MYSQL_ROW cur=mysql_fetch_row(result);
     if (cur)

=== added file 'mysql-test/r/bug47671.result'
--- a/mysql-test/r/bug47671.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/bug47671.result	2009-11-25 06:55:49 +0000
@@ -0,0 +1,13 @@
+#
+# Bug#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
+#
+# Extract only charset information from 'status' command output using regex
+--------------
+
+Server characterset:	utf8
+Db     characterset:	utf8
+Client characterset:	utf8
+Conn.  characterset:	utf8
+
+--------------
+

=== added file 'mysql-test/t/bug47671-master.opt'
--- a/mysql-test/t/bug47671-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/bug47671-master.opt	2009-11-25 06:55:49 +0000
@@ -0,0 +1 @@
+--default-character-set=utf8 --skip-character-set-client-handshake

=== added file 'mysql-test/t/bug47671.test'
--- a/mysql-test/t/bug47671.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/bug47671.test	2009-11-25 06:55:49 +0000
@@ -0,0 +1,6 @@
+--echo #
+--echo # Bug#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
+--echo #
+--echo # Extract only charset information from 'status' command output using regex
+--replace_regex /.*mysql.*// /Connection.*// /Current.*//  /SSL.*// /Using.*// /Server version.*// /Protocol.*// /UNIX.*// /Uptime.*// /Threads.*//
+--exec $MYSQL -u root test -e "status";


Attachment: [text/bzr-bundle] bzr/satya.bn@sun.com-20091125065549-1gc8vfa0cjcndox6.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (satya.bn:3219) Bug#47671Satya B25 Nov