summaryrefslogtreecommitdiff
path: root/sql-common/client.c
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-03-27 23:41:02 +0100
committerSergei Golubchik <sergii@pisem.net>2013-03-27 23:41:02 +0100
commit993ea79f2df42292eceeee394e8ece9f4a3f6cf2 (patch)
treed105c8288a89a25d412e9006b740c756db6326d6 /sql-common/client.c
parent1827d9591e24ee469527021771088d842ab18374 (diff)
parent6599fd3e9c23a8957a63146cbe6a0ffc4c292a3d (diff)
downloadmariadb-git-993ea79f2df42292eceeee394e8ece9f4a3f6cf2.tar.gz
5.5 merge
Diffstat (limited to 'sql-common/client.c')
-rw-r--r--sql-common/client.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index 96fc8cf71a2..64010919fe3 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -2200,7 +2200,10 @@ mysql_autodetect_character_set(MYSQL *mysql)
#ifdef __WIN__
char cpbuf[64];
{
- my_snprintf(cpbuf, sizeof(cpbuf), "cp%d", (int) GetConsoleCP());
+ UINT cp= GetConsoleCP();
+ if (cp == 0)
+ cp= GetACP();
+ my_snprintf(cpbuf, sizeof(cpbuf), "cp%d", (int)cp);
csname= my_os_charset_to_mysql_charset(cpbuf);
}
#elif defined(HAVE_SETLOCALE) && defined(HAVE_NL_LANGINFO)
@@ -2571,8 +2574,6 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
mysql->server_version, mysql->server_capabilities,
mysql->server_status, mysql->client_flag));
- compile_time_assert(MYSQL_USERNAME_LENGTH == USERNAME_LENGTH);
-
/* This needs to be changed as it's not useful with big packets */
if (mysql->user[0])
strmake(end, mysql->user, USERNAME_LENGTH);