[Commits] Rev 4479: MDEV-6805 one can set character_set_client to utf32 in lp:~maria-captains/maria/10.0

Sergei Golubchik serg at mariadb.org
Mon Nov 17 10:38:40 EET 2014


At lp:~maria-captains/maria/10.0

------------------------------------------------------------
revno: 4479
revision-id: sergii at pisem.net-20141117083839-wc43tap4n4frx9qo
parent: sergii at pisem.net-20141113124042-dd4iqcwgcazjy9d2
fixes bug: https://mariadb.atlassian.net/browse/MDEV-6805
committer: Sergei Golubchik <sergii at pisem.net>
branch nick: 10.0
timestamp: Mon 2014-11-17 09:38:39 +0100
message:
  MDEV-6805 one can set character_set_client to utf32
  
  use the same restriction for character_set_client on the command line
  and from SQL.
=== modified file 'mysql-test/r/ctype_ucs2_def.result'
--- a/mysql-test/r/ctype_ucs2_def.result	2009-10-15 12:23:43 +0000
+++ b/mysql-test/r/ctype_ucs2_def.result	2014-11-17 08:38:39 +0000
@@ -1,3 +1,4 @@
+call mtr.add_suppression("Cannot use ucs2 as character_set_client");
 show variables like 'collation_server';
 Variable_name	Value
 collation_server	ucs2_unicode_ci

=== modified file 'mysql-test/r/ctype_ucs2_query_cache.result'
--- a/mysql-test/r/ctype_ucs2_query_cache.result	2014-04-15 13:09:58 +0000
+++ b/mysql-test/r/ctype_ucs2_query_cache.result	2014-11-17 08:38:39 +0000
@@ -1,3 +1,4 @@
+call mtr.add_suppression("Cannot use ucs2 as character_set_client");
 #
 # Start of 5.5 tests
 #

=== modified file 'mysql-test/r/ctype_utf16_def.result'
--- a/mysql-test/r/ctype_utf16_def.result	2010-08-19 06:00:43 +0000
+++ b/mysql-test/r/ctype_utf16_def.result	2014-11-17 08:38:39 +0000
@@ -1,3 +1,4 @@
+call mtr.add_suppression("Cannot use utf16 as character_set_client");
 SHOW VARIABLES LIKE 'collation_server';
 Variable_name	Value
 collation_server	utf16_general_ci

=== modified file 'mysql-test/t/ctype_ucs2_def.test'
--- a/mysql-test/t/ctype_ucs2_def.test	2008-01-16 12:53:43 +0000
+++ b/mysql-test/t/ctype_ucs2_def.test	2014-11-17 08:38:39 +0000
@@ -1,5 +1,7 @@
 -- source include/have_ucs2.inc
 
+call mtr.add_suppression("Cannot use ucs2 as character_set_client");
+
 #
 # MySQL Bug#15276: MySQL ignores collation-server
 #

=== modified file 'mysql-test/t/ctype_ucs2_query_cache.test'
--- a/mysql-test/t/ctype_ucs2_query_cache.test	2014-04-15 13:09:58 +0000
+++ b/mysql-test/t/ctype_ucs2_query_cache.test	2014-11-17 08:38:39 +0000
@@ -1,6 +1,8 @@
 -- source include/have_query_cache.inc
 -- source include/have_ucs2.inc
 
+call mtr.add_suppression("Cannot use ucs2 as character_set_client");
+
 --echo #
 --echo # Start of 5.5 tests
 --echo #

=== modified file 'mysql-test/t/ctype_utf16_def.test'
--- a/mysql-test/t/ctype_utf16_def.test	2010-08-19 06:00:43 +0000
+++ b/mysql-test/t/ctype_utf16_def.test	2014-11-17 08:38:39 +0000
@@ -1,4 +1,5 @@
 --source include/have_utf16.inc
+call mtr.add_suppression("Cannot use utf16 as character_set_client");
 
 #
 # Bug #32391  	Character sets: crash with --character-set-server

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2014-10-09 08:30:11 +0000
+++ b/sql/mysqld.cc	2014-11-17 08:38:39 +0000
@@ -4268,7 +4268,15 @@ static int init_common_variables()
   global_system_variables.collation_database=	 default_charset_info;
   global_system_variables.collation_connection=  default_charset_info;
   global_system_variables.character_set_results= default_charset_info;
-  global_system_variables.character_set_client=  default_charset_info;
+  if (default_charset_info->mbminlen > 1)
+  {
+    global_system_variables.character_set_client=  &my_charset_latin1;
+    sql_print_warning("Cannot use %s as character_set_client, %s will be used instead",
+                      default_charset_info->csname,
+                      global_system_variables.character_set_client->csname);
+  }
+  else
+    global_system_variables.character_set_client=  default_charset_info;
 
   if (!(character_set_filesystem=
         get_charset_by_csname(character_set_filesystem_name,

=== modified file 'sql/sql_connect.cc'
--- a/sql/sql_connect.cc	2014-09-30 17:31:14 +0000
+++ b/sql/sql_connect.cc	2014-11-17 08:38:39 +0000
@@ -837,13 +837,15 @@ bool thd_init_client_charset(THD *thd, u
    Use server character set and collation if
    - opt_character_set_client_handshake is not set
    - client has not specified a character set
-   - client character set is the same as the servers
    - client character set doesn't exists in server
+   - client character set is the same as collation_connection
+     (because we want to keep collation_connection, say, utf8_unicode_ci
+     and not change to the default utf8_general_ci when utf8 client connects)
   */
   if (!opt_character_set_client_handshake ||
       !(cs= get_charset(cs_number, MYF(0))) ||
       !my_strcasecmp(&my_charset_latin1,
-                     global_system_variables.character_set_client->name,
+                     global_system_variables.collation_connection->name,
                      cs->name))
   {
     thd->variables.character_set_client=



More information about the commits mailing list