From 806e6cda27cb4b333725d797a04ae8199fe97244 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 6 Mar 2013 13:30:40 +0100 Subject: MDEV-4249 : when autodetecting default client charset on Windows, fallback to GetACP() whenever GetConsoleCP() returns 0 (i.e appkication does not have a console , which is the case for GUI apps, Windows services etc) --- sql-common/client.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sql-common/client.c') diff --git a/sql-common/client.c b/sql-common/client.c index c8ec031c95c..c257c7c96a7 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -2198,7 +2198,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) -- cgit v1.2.1 From 102a7a2a763dc5f2da8dd1f9ca9a53664c5aad6a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 26 Mar 2013 19:17:26 +0100 Subject: MDEV-4307 Support at least 48 utf8 characters in username in server and PAM Extend plugin auth api to support up to 512 bytes in the user names. Use the API versioning to support old auth plugins too! --- sql-common/client.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'sql-common/client.c') diff --git a/sql-common/client.c b/sql-common/client.c index c257c7c96a7..3119236ef2d 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -2572,8 +2572,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); -- cgit v1.2.1