Commit dacd32f9 authored by Satya B's avatar Satya B

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().
parent 049dc018
...@@ -4335,7 +4335,7 @@ com_status(String *buffer __attribute__((unused)), ...@@ -4335,7 +4335,7 @@ com_status(String *buffer __attribute__((unused)),
Don't remove "limit 1", Don't remove "limit 1",
it is protection againts SQL_SELECT_LIMIT=0 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); MYSQL_ROW cur=mysql_fetch_row(result);
if (cur) if (cur)
...@@ -4379,7 +4379,7 @@ com_status(String *buffer __attribute__((unused)), ...@@ -4379,7 +4379,7 @@ com_status(String *buffer __attribute__((unused)),
if (mysql_errno(&mysql) == CR_SERVER_GONE_ERROR) if (mysql_errno(&mysql) == CR_SERVER_GONE_ERROR)
return 0; return 0;
} }
if (mysql_store_result_for_lazy(&result)) if (!mysql_store_result_for_lazy(&result))
{ {
MYSQL_ROW cur=mysql_fetch_row(result); MYSQL_ROW cur=mysql_fetch_row(result);
if (cur) if (cur)
......
#
# 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
--------------
--default-character-set=utf8 --skip-character-set-client-handshake
--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";
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment