diff options
Diffstat (limited to 'sql-common/client.c')
-rw-r--r-- | sql-common/client.c | 7 |
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); |