From 969391784f305027466d0d79b271311f22bc583b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 31 Aug 2005 13:03:24 +0500 Subject: [PATCH 1/4] bug#9948 changed client-charset behavior in 4.1.x libmysql, which issue BC prob sql_parse.cc: mysqld.cc: Added --skip-client-character-set-handshake. When this option is activated, client side character set (which is sent in handshake) is ignored, and server side default-character-set value is used for character_set_client and character_set_results, thus reprodicing 4.0 behaviour. sql/mysqld.cc: bug#9948 changed client-charset behavior in 4.1.x libmysql, which issue BC prob Added --skip-client-character-set-handshake, to reproduce 4.0 behaviour. sql/sql_parse.cc: bug#9948 changed client-charset behavior in 4.1.x libmysql, which issue BC prob Added --skip-client-character-set-handshake, to reproduce 4.0 behaviour. --- sql/mysqld.cc | 7 +++++++ sql/sql_parse.cc | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 865f494bbc9..59b733b594c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -271,6 +271,7 @@ arg_cmp_func Arg_comparator::comparator_matrix[4][2] = bool opt_log, opt_update_log, opt_bin_log, opt_slow_log; bool opt_error_log= IF_WIN(1,0); bool opt_disable_networking=0, opt_skip_show_db=0; +bool opt_skip_character_set_client_handshake= 0; bool lower_case_table_names_used= 0; bool server_id_supplied = 0; bool opt_endinfo,using_udf_functions, locked_in_memory; @@ -4216,6 +4217,7 @@ enum options_mysqld OPT_EXPIRE_LOGS_DAYS, OPT_GROUP_CONCAT_MAX_LEN, OPT_DEFAULT_COLLATION, + OPT_CHARACTER_SET_CLIENT_HANDSHAKE, OPT_INIT_CONNECT, OPT_INIT_SLAVE, OPT_SECURE_AUTH, @@ -4753,6 +4755,11 @@ Can't be set to 1 if --log-slave-updates is used.", "Show user and password in SHOW SLAVE HOSTS on this master", (gptr*) &opt_show_slave_auth_info, (gptr*) &opt_show_slave_auth_info, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"skip-character-set-client-handshake", OPT_CHARACTER_SET_CLIENT_HANDSHAKE, + "Don't use client side character set value sent during handshake.", + (gptr*) &opt_skip_character_set_client_handshake, + (gptr*) &opt_skip_character_set_client_handshake, + 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"skip-grant-tables", OPT_SKIP_GRANT, "Start without grant tables. This gives all users FULL ACCESS to all tables!", (gptr*) &opt_noacl, (gptr*) &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index caf76b19eb2..b8eae3aac74 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -811,11 +811,13 @@ static int check_connection(THD *thd) DBUG_PRINT("info", ("client_character_set: %d", (uint) net->read_pos[8])); /* Use server character set and collation if + - opt_skip_character_set_client_handshake is 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 */ - if (!(thd->variables.character_set_client= + if (opt_skip_character_set_client_handshake || + !(thd->variables.character_set_client= get_charset((uint) net->read_pos[8], MYF(0))) || !my_strcasecmp(&my_charset_latin1, global_system_variables.character_set_client->name, From 50c44c9b529aaa694faaacf4353e1815b6133941 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Sep 2005 20:00:11 +0500 Subject: [PATCH 2/4] mysqld.cc, mysql_priv.h, sql_parse.cc: bug#9948 changed client-charset behavior in 4.1.x libmysql, which issue BC prob after review fixes sql/mysql_priv.h: bug#9948 changed client-charset behavior in 4.1.x libmysql, which issue BC prob after review fixes sql/mysqld.cc: bug#9948 changed client-charset behavior in 4.1.x libmysql, which issue BC prob after review fixes --- sql/mysql_priv.h | 1 + sql/mysqld.cc | 12 ++++++------ sql/sql_parse.cc | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 0af3ea3af63..81224bdf54d 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -931,6 +931,7 @@ extern bool opt_using_transactions, mysqld_embedded; extern bool using_update_log, opt_large_files, server_id_supplied; extern bool opt_log, opt_update_log, opt_bin_log, opt_slow_log, opt_error_log; extern bool opt_disable_networking, opt_skip_show_db; +extern bool opt_character_set_client_handshake; extern bool volatile abort_loop, shutdown_in_progress, grant_option; extern uint volatile thread_count, thread_running, global_read_lock; extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 59b733b594c..2d232986997 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -271,7 +271,7 @@ arg_cmp_func Arg_comparator::comparator_matrix[4][2] = bool opt_log, opt_update_log, opt_bin_log, opt_slow_log; bool opt_error_log= IF_WIN(1,0); bool opt_disable_networking=0, opt_skip_show_db=0; -bool opt_skip_character_set_client_handshake= 0; +bool opt_character_set_client_handshake= 1; bool lower_case_table_names_used= 0; bool server_id_supplied = 0; bool opt_endinfo,using_udf_functions, locked_in_memory; @@ -4297,6 +4297,11 @@ Disable with --skip-bdb (will save memory).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"bootstrap", OPT_BOOTSTRAP, "Used by mysql installation scripts.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"character-set-client-handshake", OPT_CHARACTER_SET_CLIENT_HANDSHAKE, + "Don't use client side character set value sent during handshake.", + (gptr*) &opt_character_set_client_handshake, + (gptr*) &opt_character_set_client_handshake, + 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"character-set-server", 'C', "Set the default character set.", (gptr*) &default_character_set_name, (gptr*) &default_character_set_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, @@ -4755,11 +4760,6 @@ Can't be set to 1 if --log-slave-updates is used.", "Show user and password in SHOW SLAVE HOSTS on this master", (gptr*) &opt_show_slave_auth_info, (gptr*) &opt_show_slave_auth_info, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"skip-character-set-client-handshake", OPT_CHARACTER_SET_CLIENT_HANDSHAKE, - "Don't use client side character set value sent during handshake.", - (gptr*) &opt_skip_character_set_client_handshake, - (gptr*) &opt_skip_character_set_client_handshake, - 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"skip-grant-tables", OPT_SKIP_GRANT, "Start without grant tables. This gives all users FULL ACCESS to all tables!", (gptr*) &opt_noacl, (gptr*) &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index b8eae3aac74..a52e6daa698 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -811,12 +811,12 @@ static int check_connection(THD *thd) DBUG_PRINT("info", ("client_character_set: %d", (uint) net->read_pos[8])); /* Use server character set and collation if - - opt_skip_character_set_client_handshake is set + - 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 */ - if (opt_skip_character_set_client_handshake || + if (!opt_character_set_client_handshake || !(thd->variables.character_set_client= get_charset((uint) net->read_pos[8], MYF(0))) || !my_strcasecmp(&my_charset_latin1, From 103458544bc3c07100dac2f22c3f857f7cff2618 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Sep 2005 09:36:32 +0200 Subject: [PATCH 3/4] comment out innochecksum until fixed --- extra/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/Makefile.am b/extra/Makefile.am index 457fddce673..9fac05d0160 100644 --- a/extra/Makefile.am +++ b/extra/Makefile.am @@ -38,7 +38,7 @@ $(top_builddir)/include/mysqld_ername.h: $(top_builddir)/include/mysqld_error.h $(top_builddir)/include/sql_state.h: $(top_builddir)/include/mysqld_error.h bin_PROGRAMS = replace comp_err perror resolveip my_print_defaults \ - resolve_stack_dump mysql_waitpid innochecksum + resolve_stack_dump mysql_waitpid # innochecksum noinst_PROGRAMS = charset2html # Don't update the files from bitkeeper From 94c98b516aab22f13f2c5fb4a86546edd201eeba Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Sep 2005 15:23:03 +0500 Subject: [PATCH 4/4] mysqld.cc: after merge fix sql/mysqld.cc: after merge fix --- sql/mysqld.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 919f7c3d2e2..76ee08d73a3 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -339,7 +339,6 @@ bool opt_log, opt_update_log, opt_bin_log, opt_slow_log; bool opt_error_log= IF_WIN(1,0); bool opt_disable_networking=0, opt_skip_show_db=0; bool opt_character_set_client_handshake= 1; -bool lower_case_table_names_used= 0; bool server_id_supplied = 0; bool opt_endinfo,using_udf_functions, locked_in_memory; bool opt_using_transactions, using_update_log;