From 83f688baa214b0e2696d1ae9ba0d400b92fa2e0c Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Fri, 22 Apr 2022 11:12:33 +0200 Subject: [PATCH] Bug #34025412 Rename utf8_xxx functions and data structures to utf8mb3_xxx [noclose] For better code readability/maintainability, rename functions and data structures used for handling utf8mb3 charsets and collations. This patch renames my_charset_utf8_xxx to my_charset_utf8mb3_xxx. Change-Id: I7f198007b365e780e814f8b5b9ddbfdf06a50c67 --- include/m_ctype.h | 8 +- mysys/charset-def.cc | 108 +++++++++--------- mysys/charset.cc | 4 +- .../sql_service/sql_service_interface.h | 6 +- plugin/group_replication/src/plugin_utils.cc | 2 +- .../test_session_attach.cc | 2 +- .../test_session_detach.cc | 6 +- .../test_service_sql_api/test_session_info.cc | 18 +-- .../test_sql_2_sessions.cc | 4 +- .../test_sql_9_sessions.cc | 2 +- .../test_sql_all_col_types.cc | 4 +- .../test_service_sql_api/test_sql_cmds_1.cc | 26 ++--- .../test_service_sql_api/test_sql_commit.cc | 4 +- .../test_service_sql_api/test_sql_complex.cc | 4 +- .../test_service_sql_api/test_sql_errors.cc | 4 +- plugin/test_service_sql_api/test_sql_lock.cc | 4 +- .../test_sql_processlist.cc | 4 +- .../test_sql_replication.cc | 4 +- .../test_sql_reset_connection.cc | 4 +- .../test_service_sql_api/test_sql_shutdown.cc | 6 +- .../test_sql_sleep_is_connected.cc | 6 +- .../test_service_sql_api/test_sql_sqlmode.cc | 4 +- plugin/test_service_sql_api/test_sql_stmt.cc | 2 +- .../test_sql_stored_procedures_functions.cc | 4 +- .../test_sql_views_triggers.cc | 4 +- .../test_x_sessions_init.cc | 2 +- sql/auth/acl_table_user.cc | 2 +- sql/auth/password_policy_service.cc | 7 +- sql/auth/sql_authorization.cc | 2 +- sql/auth/sql_user.cc | 2 +- sql/dd/dd_schema.cc | 2 +- sql/dd/impl/tables/character_sets.cc | 2 +- sql/dd/impl/tables/check_constraints.cc | 2 +- sql/dd/impl/tables/collations.cc | 2 +- sql/dd/impl/tables/columns.cc | 2 +- sql/dd/impl/tables/events.cc | 2 +- sql/dd/impl/tables/foreign_keys.cc | 2 +- sql/dd/impl/tables/indexes.cc | 2 +- sql/dd/impl/tables/parameters.cc | 2 +- sql/dd/impl/tables/resource_groups.cc | 2 +- sql/dd/impl/tables/routines.cc | 2 +- .../impl/tables/spatial_reference_systems.cc | 2 +- sql/dd/impl/tables/table_partitions.cc | 2 +- sql/dd/impl/tables/triggers.cc | 2 +- .../impl/types/object_table_definition_impl.h | 8 +- sql/dd/impl/types/routine_impl.cc | 2 +- sql/events.cc | 2 +- sql/item.h | 5 +- sql/item_json_func.cc | 2 +- sql/item_pfs_func.cc | 8 +- sql/item_timefunc.cc | 6 +- sql/mysqld.cc | 20 ++-- sql/opt_costconstantcache.cc | 6 +- sql/opt_costconstants.cc | 23 ++-- sql/opt_trace.cc | 2 +- sql/parse_tree_nodes.cc | 16 +-- sql/protocol_classic.cc | 2 +- sql/resourcegroups/resource_group_mgr.cc | 6 +- sql/rpl_gtid.h | 2 +- sql/rules_table_service.cc | 2 +- sql/server_component/log_builtins.cc | 2 +- .../mysql_thd_attributes_imp.cc | 2 +- sql/sql_db.cc | 2 +- sql/sql_digest.cc | 2 +- sql/sql_error.cc | 44 +++---- sql/sql_get_diagnostics.cc | 2 +- sql/sql_lex.cc | 6 +- sql/sql_signal.cc | 7 +- sql/srv_session.cc | 2 +- sql/string_service.cc | 2 +- sql/sys_vars.cc | 2 +- storage/innobase/handler/ha_innodb.cc | 2 +- storage/perfschema/table_session_connect.cc | 2 +- .../perfschema/unittest/pfs_connect_attr-t.cc | 8 +- strings/ctype-uca.cc | 104 ++++++++--------- strings/ctype-utf8.cc | 72 ++++++------ strings/ctype.cc | 2 +- unittest/gunit/explain_filename-t.cc | 2 +- unittest/gunit/item-t.cc | 4 +- unittest/gunit/mdl-t.cc | 4 +- unittest/gunit/opt_costconstants-t.cc | 7 +- unittest/gunit/strings_utf8-t.cc | 2 +- unittest/gunit/test_utils.cc | 2 +- 83 files changed, 345 insertions(+), 338 deletions(-) diff --git a/include/m_ctype.h b/include/m_ctype.h index 53b831244480..3baed31b0af3 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -417,10 +417,10 @@ extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8mb4_0900_bin; extern CHARSET_INFO my_charset_latin1_bin; extern CHARSET_INFO my_charset_utf32_unicode_ci; -extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8_general_ci; -extern CHARSET_INFO my_charset_utf8_tolower_ci; -extern CHARSET_INFO my_charset_utf8_unicode_ci; -extern CHARSET_INFO my_charset_utf8_bin; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8mb3_general_ci; +extern CHARSET_INFO my_charset_utf8mb3_tolower_ci; +extern CHARSET_INFO my_charset_utf8mb3_unicode_ci; +extern CHARSET_INFO my_charset_utf8mb3_bin; extern CHARSET_INFO my_charset_utf8mb4_bin; extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8mb4_general_ci; diff --git a/mysys/charset-def.cc b/mysys/charset-def.cc index 818ef0521c09..2723a9e50706 100644 --- a/mysys/charset-def.cc +++ b/mysys/charset-def.cc @@ -148,32 +148,32 @@ extern CHARSET_INFO my_charset_utf16_sinhala_uca_ci; extern CHARSET_INFO my_charset_utf16_unicode_520_ci; extern CHARSET_INFO my_charset_utf16_vietnamese_ci; -extern CHARSET_INFO my_charset_utf8_tolower_ci; -extern CHARSET_INFO my_charset_utf8_bin; -extern CHARSET_INFO my_charset_utf8_general_mysql500_ci; -extern CHARSET_INFO my_charset_utf8_german2_uca_ci; -extern CHARSET_INFO my_charset_utf8_icelandic_uca_ci; -extern CHARSET_INFO my_charset_utf8_latvian_uca_ci; -extern CHARSET_INFO my_charset_utf8_romanian_uca_ci; -extern CHARSET_INFO my_charset_utf8_slovenian_uca_ci; -extern CHARSET_INFO my_charset_utf8_polish_uca_ci; -extern CHARSET_INFO my_charset_utf8_estonian_uca_ci; -extern CHARSET_INFO my_charset_utf8_spanish_uca_ci; -extern CHARSET_INFO my_charset_utf8_swedish_uca_ci; -extern CHARSET_INFO my_charset_utf8_turkish_uca_ci; -extern CHARSET_INFO my_charset_utf8_czech_uca_ci; -extern CHARSET_INFO my_charset_utf8_danish_uca_ci; -extern CHARSET_INFO my_charset_utf8_lithuanian_uca_ci; -extern CHARSET_INFO my_charset_utf8_slovak_uca_ci; -extern CHARSET_INFO my_charset_utf8_spanish2_uca_ci; -extern CHARSET_INFO my_charset_utf8_roman_uca_ci; -extern CHARSET_INFO my_charset_utf8_persian_uca_ci; -extern CHARSET_INFO my_charset_utf8_esperanto_uca_ci; -extern CHARSET_INFO my_charset_utf8_hungarian_uca_ci; -extern CHARSET_INFO my_charset_utf8_croatian_uca_ci; -extern CHARSET_INFO my_charset_utf8_sinhala_uca_ci; -extern CHARSET_INFO my_charset_utf8_unicode_520_ci; -extern CHARSET_INFO my_charset_utf8_vietnamese_ci; +extern CHARSET_INFO my_charset_utf8mb3_tolower_ci; +extern CHARSET_INFO my_charset_utf8mb3_bin; +extern CHARSET_INFO my_charset_utf8mb3_general_mysql500_ci; +extern CHARSET_INFO my_charset_utf8mb3_german2_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_icelandic_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_latvian_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_romanian_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_slovenian_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_polish_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_estonian_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_spanish_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_swedish_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_turkish_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_czech_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_danish_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_lithuanian_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_slovak_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_spanish2_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_roman_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_persian_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_esperanto_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_hungarian_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_croatian_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_sinhala_uca_ci; +extern CHARSET_INFO my_charset_utf8mb3_unicode_520_ci; +extern CHARSET_INFO my_charset_utf8mb3_vietnamese_ci; extern CHARSET_INFO my_charset_utf8mb4_general_ci; extern CHARSET_INFO my_charset_utf8mb4_unicode_ci; @@ -339,34 +339,34 @@ bool init_compiled_charsets(myf flags [[maybe_unused]]) { add_compiled_collation(&my_charset_ujis_japanese_ci); add_compiled_collation(&my_charset_ujis_bin); - add_compiled_collation(&my_charset_utf8_general_ci); - add_compiled_collation(&my_charset_utf8_tolower_ci); - add_compiled_collation(&my_charset_utf8_bin); - add_compiled_collation(&my_charset_utf8_general_mysql500_ci); - add_compiled_collation(&my_charset_utf8_unicode_ci); - add_compiled_collation(&my_charset_utf8_german2_uca_ci); - add_compiled_collation(&my_charset_utf8_icelandic_uca_ci); - add_compiled_collation(&my_charset_utf8_latvian_uca_ci); - add_compiled_collation(&my_charset_utf8_romanian_uca_ci); - add_compiled_collation(&my_charset_utf8_slovenian_uca_ci); - add_compiled_collation(&my_charset_utf8_polish_uca_ci); - add_compiled_collation(&my_charset_utf8_estonian_uca_ci); - add_compiled_collation(&my_charset_utf8_spanish_uca_ci); - add_compiled_collation(&my_charset_utf8_swedish_uca_ci); - add_compiled_collation(&my_charset_utf8_turkish_uca_ci); - add_compiled_collation(&my_charset_utf8_czech_uca_ci); - add_compiled_collation(&my_charset_utf8_danish_uca_ci); - add_compiled_collation(&my_charset_utf8_lithuanian_uca_ci); - add_compiled_collation(&my_charset_utf8_slovak_uca_ci); - add_compiled_collation(&my_charset_utf8_spanish2_uca_ci); - add_compiled_collation(&my_charset_utf8_roman_uca_ci); - add_compiled_collation(&my_charset_utf8_persian_uca_ci); - add_compiled_collation(&my_charset_utf8_esperanto_uca_ci); - add_compiled_collation(&my_charset_utf8_hungarian_uca_ci); - add_compiled_collation(&my_charset_utf8_croatian_uca_ci); - add_compiled_collation(&my_charset_utf8_sinhala_uca_ci); - add_compiled_collation(&my_charset_utf8_unicode_520_ci); - add_compiled_collation(&my_charset_utf8_vietnamese_ci); + add_compiled_collation(&my_charset_utf8mb3_general_ci); + add_compiled_collation(&my_charset_utf8mb3_tolower_ci); + add_compiled_collation(&my_charset_utf8mb3_bin); + add_compiled_collation(&my_charset_utf8mb3_general_mysql500_ci); + add_compiled_collation(&my_charset_utf8mb3_unicode_ci); + add_compiled_collation(&my_charset_utf8mb3_german2_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_icelandic_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_latvian_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_romanian_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_slovenian_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_polish_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_estonian_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_spanish_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_swedish_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_turkish_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_czech_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_danish_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_lithuanian_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_slovak_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_spanish2_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_roman_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_persian_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_esperanto_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_hungarian_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_croatian_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_sinhala_uca_ci); + add_compiled_collation(&my_charset_utf8mb3_unicode_520_ci); + add_compiled_collation(&my_charset_utf8mb3_vietnamese_ci); // utf8mb4 is the only character set with more than two binary collations. For // backward compatibility, we want the deprecated BINARY type attribute to use diff --git a/mysys/charset.cc b/mysys/charset.cc index 385796d8f31c..a9ef3aea9cf2 100644 --- a/mysys/charset.cc +++ b/mysys/charset.cc @@ -256,8 +256,8 @@ static int add_collation(CHARSET_INFO *cs) { newcs->state |= MY_CS_AVAILABLE | MY_CS_LOADED | MY_CS_NONASCII; } else if (!strcmp(cs->csname, "utf8") || !strcmp(cs->csname, "utf8mb3")) { - copy_uca_collation(newcs, &my_charset_utf8_unicode_ci); - newcs->ctype = my_charset_utf8_unicode_ci.ctype; + copy_uca_collation(newcs, &my_charset_utf8mb3_unicode_ci); + newcs->ctype = my_charset_utf8mb3_unicode_ci.ctype; if (init_state_maps(newcs)) return MY_XML_ERROR; } else if (!strcmp(cs->csname, "utf8mb4")) { copy_uca_collation(newcs, &my_charset_utf8mb4_unicode_ci); diff --git a/plugin/group_replication/include/sql_service/sql_service_interface.h b/plugin/group_replication/include/sql_service/sql_service_interface.h index 52a044fe2127..7d4f1e240d15 100644 --- a/plugin/group_replication/include/sql_service/sql_service_interface.h +++ b/plugin/group_replication/include/sql_service/sql_service_interface.h @@ -101,7 +101,7 @@ class Sql_service_interface { */ Sql_service_interface( enum cs_text_or_binary cs_txt_bin = CS_TEXT_REPRESENTATION, - const CHARSET_INFO *cs_charset = &my_charset_utf8_general_ci); + const CHARSET_INFO *cs_charset = &my_charset_utf8mb3_general_ci); /** Sql_service_interface destructor @@ -162,7 +162,7 @@ class Sql_service_interface { long execute_query( std::string sql_string, Sql_resultset *rset, enum cs_text_or_binary cs_txt_bin = CS_TEXT_REPRESENTATION, - const CHARSET_INFO *cs_charset = &my_charset_utf8_general_ci); + const CHARSET_INFO *cs_charset = &my_charset_utf8mb3_general_ci); /** Executes a server command in a session. @@ -185,7 +185,7 @@ class Sql_service_interface { long execute(COM_DATA cmd, enum enum_server_command cmd_type, Sql_resultset *rset, enum cs_text_or_binary cs_txt_bin = CS_TEXT_REPRESENTATION, - const CHARSET_INFO *cs_charset = &my_charset_utf8_general_ci); + const CHARSET_INFO *cs_charset = &my_charset_utf8mb3_general_ci); /** Set send result type to CS_TEXT_REPRESENTATION or diff --git a/plugin/group_replication/src/plugin_utils.cc b/plugin/group_replication/src/plugin_utils.cc index 3b2864609cf3..39bee6436ca2 100644 --- a/plugin/group_replication/src/plugin_utils.cc +++ b/plugin/group_replication/src/plugin_utils.cc @@ -100,7 +100,7 @@ void plugin_escape_string(std::string &string_to_escape) { size_t length = string_to_escape.length(); char *end_string = (char *)my_malloc(PSI_NOT_INSTRUMENTED, 2 * length + 1, MYF(0)); - escape_string_for_mysql(&my_charset_utf8_general_ci, end_string, + escape_string_for_mysql(&my_charset_utf8mb3_general_ci, end_string, 2 * length + 1, string_to_escape.c_str(), length); string_to_escape.assign(end_string); my_free(end_string); diff --git a/plugin/test_service_sql_api/test_session_attach.cc b/plugin/test_service_sql_api/test_session_attach.cc index 77e5ae60dcda..413fa4f4c37b 100644 --- a/plugin/test_service_sql_api/test_session_attach.cc +++ b/plugin/test_service_sql_api/test_session_attach.cc @@ -94,7 +94,7 @@ static void exec_test_cmd(MYSQL_SESSION session, const char *test_cmd) { const bool failed = 0 != command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, + &my_charset_utf8mb3_general_ci, &sql_cbs, CS_BINARY_REPRESENTATION, nullptr); if (failed) { diff --git a/plugin/test_service_sql_api/test_session_detach.cc b/plugin/test_service_sql_api/test_session_detach.cc index 21b88feda308..bb61edfe3594 100644 --- a/plugin/test_service_sql_api/test_session_detach.cc +++ b/plugin/test_service_sql_api/test_session_detach.cc @@ -588,9 +588,9 @@ static void exec_test_cmd(MYSQL_SESSION session, const char *test_cmd, memset(&cmd, 0, sizeof(cmd)); cmd.com_query.query = test_cmd; cmd.com_query.length = strlen(cmd.com_query.query); - int fail = command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, - CS_BINARY_REPRESENTATION, ctx); + int fail = command_service_run_command( + session, COM_QUERY, &cmd, &my_charset_utf8mb3_general_ci, &sql_cbs, + CS_BINARY_REPRESENTATION, ctx); if (fail) LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, diff --git a/plugin/test_service_sql_api/test_session_info.cc b/plugin/test_service_sql_api/test_session_info.cc index 1d9d25600603..d8ca945bbfec 100644 --- a/plugin/test_service_sql_api/test_session_info.cc +++ b/plugin/test_service_sql_api/test_session_info.cc @@ -545,8 +545,8 @@ static void exec_test_cmd(MYSQL_SESSION session, const char *query, cmd.com_query.length = strlen(cmd.com_query.query); WRITE_VAL("%s\n", query); int fail = command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, - CS_TEXT_REPRESENTATION, ctx); + &my_charset_utf8mb3_general_ci, + &sql_cbs, CS_TEXT_REPRESENTATION, ctx); if (fail) { srv_session_close(session); if (!expect_error) @@ -584,9 +584,9 @@ static void test_com_init_db(void *p [[maybe_unused]], MYSQL_SESSION st_session, cmd.com_init_db.db_name = db_name; cmd.com_init_db.length = strlen(db_name); - int fail = command_service_run_command(st_session, COM_INIT_DB, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, - CS_TEXT_REPRESENTATION, plugin_ctx); + int fail = command_service_run_command( + st_session, COM_INIT_DB, &cmd, &my_charset_utf8mb3_general_ci, &sql_cbs, + CS_TEXT_REPRESENTATION, plugin_ctx); if (fail) { LogPluginErr(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "run_statement code: %d\n", @@ -931,9 +931,9 @@ static void test_sql(void *p) { cmd.com_query.query = buffer_query; cmd.com_query.length = strlen(buffer_query); - int fail = command_service_run_command(session_2, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, - CS_TEXT_REPRESENTATION, plugin_ctx); + int fail = command_service_run_command( + session_2, COM_QUERY, &cmd, &my_charset_utf8mb3_general_ci, &sql_cbs, + CS_TEXT_REPRESENTATION, plugin_ctx); if (fail) { LogPluginErr(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "run_statement code: %d\n", @@ -953,7 +953,7 @@ static void test_sql(void *p) { cmd.com_query.length = strlen(buffer_query); fail = command_service_run_command(session_2, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, + &my_charset_utf8mb3_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, plugin_ctx); if (fail) { diff --git a/plugin/test_service_sql_api/test_sql_2_sessions.cc b/plugin/test_service_sql_api/test_sql_2_sessions.cc index 9dcb69a905ae..1b01ea59112a 100644 --- a/plugin/test_service_sql_api/test_sql_2_sessions.cc +++ b/plugin/test_service_sql_api/test_sql_2_sessions.cc @@ -641,8 +641,8 @@ static void exec_test_cmd(MYSQL_SESSION session, const char *test_cmd, cmd.com_query.query = test_cmd; cmd.com_query.length = strlen(cmd.com_query.query); int fail = command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, - CS_TEXT_REPRESENTATION, ctx); + &my_charset_utf8mb3_general_ci, + &sql_cbs, CS_TEXT_REPRESENTATION, ctx); if (fail) { if (!srv_session_close(session)) LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, diff --git a/plugin/test_service_sql_api/test_sql_9_sessions.cc b/plugin/test_service_sql_api/test_sql_9_sessions.cc index 4a2e467815bb..81dbe9479f57 100644 --- a/plugin/test_service_sql_api/test_sql_9_sessions.cc +++ b/plugin/test_service_sql_api/test_sql_9_sessions.cc @@ -442,7 +442,7 @@ static void exec_test_cmd(MYSQL_SESSION session, const char *test_cmd, cmd.com_query.query = (char *)test_cmd; cmd.com_query.length = strlen(cmd.com_query.query); fail = command_service_run_command(session, select_prot, COM_QUERY, &cmd, - &my_charset_utf8_general_ci); + &my_charset_utf8mb3_general_ci); if (fail) LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "test_sql_9_sessions - ret code : %d", fail); diff --git a/plugin/test_service_sql_api/test_sql_all_col_types.cc b/plugin/test_service_sql_api/test_sql_all_col_types.cc index d40c7a88f2c0..89451b8931da 100644 --- a/plugin/test_service_sql_api/test_sql_all_col_types.cc +++ b/plugin/test_service_sql_api/test_sql_all_col_types.cc @@ -775,8 +775,8 @@ static void exec_test_cmd(MYSQL_SESSION session, const char *test_cmd, cmd.com_query.query = test_cmd; cmd.com_query.length = strlen(cmd.com_query.query); int fail = command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, - text_or_binary, ctx); + &my_charset_utf8mb3_general_ci, + &sql_cbs, text_or_binary, ctx); if (fail) LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "test_sql_all_col_types - ret code : %d", fail); diff --git a/plugin/test_service_sql_api/test_sql_cmds_1.cc b/plugin/test_service_sql_api/test_sql_cmds_1.cc index f216cd7a2270..2b1015cf0781 100644 --- a/plugin/test_service_sql_api/test_sql_cmds_1.cc +++ b/plugin/test_service_sql_api/test_sql_cmds_1.cc @@ -359,7 +359,7 @@ static void test_com_query(void *p [[maybe_unused]]) { cmd.com_query.length = strlen(cmd.com_query.query); WRITE_VAL("%s\n", cmd.com_query.query); fail = command_service_run_command(st_session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, + &my_charset_utf8mb3_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, &cbd); if (fail) LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "sql_simple ret code: %d\n", @@ -400,7 +400,7 @@ static void test_com_query(void *p [[maybe_unused]]) { WRITE_VAL("%s\n", cmd.com_query.query); cbd.reset(); fail = command_service_run_command(st_session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, + &my_charset_utf8mb3_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, &cbd); if (fail) LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "sql_simple ret code: %d\n", @@ -435,7 +435,7 @@ static void test_com_query(void *p [[maybe_unused]]) { cmd.com_query.length = strlen(cmd.com_query.query); ENSURE_API_OK(command_service_run_command( - st_session, COM_QUERY, &cmd, &my_charset_utf8_general_ci, &sql_cbs, + st_session, COM_QUERY, &cmd, &my_charset_utf8mb3_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, &cbd)); WRITE_VAL("error after bad SQL: %i: %s\n", cbd.err, cbd.errmsg.c_str()); @@ -464,7 +464,7 @@ static int test_com_init_db(void *p) { cmd.com_init_db.length = strlen("mysql"); Callback_data cbd; ENSURE_API_OK(command_service_run_command( - st_session, COM_INIT_DB, &cmd, &my_charset_utf8_general_ci, &sql_cbs, + st_session, COM_INIT_DB, &cmd, &my_charset_utf8mb3_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, &cbd)); db_name = srv_session_info_get_current_db(st_session); @@ -489,7 +489,7 @@ static int test_com_list_fields(void *p) cmd.com_init_db.db_name = "mysql"; cmd.com_init_db.length = strlen("mysql"); ENSURE_API_OK(command_service_run_command(st_session, COM_INIT_DB, &cmd, -&my_charset_utf8_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, p)); +&my_charset_utf8mb3_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, p)); WRITE_VAL("switched default db to: %s\n", srv_session_info_get_current_db(st_session)); @@ -502,7 +502,7 @@ char*)cmd.com_field_list.table_name); cmd.com_field_list.query = (unsigned char*)"%"; cmd.com_field_list.query_length = strlen((const char*)cmd.com_field_list.query); ENSURE_API_OK(command_service_run_command(st_session, COM_FIELD_LIST, &cmd, -&my_charset_utf8_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, p)); +&my_charset_utf8mb3_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, p)); WRITE_STR("-----------------------------------------------------------------\n"); for (uint row_count=0;row_count < sql_num_rows;row_count++){ @@ -570,7 +570,7 @@ static void *test_session_thread(Test_data *tdata) { tdata->go(); int r = command_service_run_command(tdata->session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, + &my_charset_utf8mb3_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, &cbdata); WRITE_VAL("Killed run_command return value: %i\n", r); @@ -644,7 +644,7 @@ static int test_query_kill(void *p) { cmd.com_query.query = buffer; cmd.com_query.length = strlen(buffer); ENSURE_API_OK(command_service_run_command( - st_session, COM_QUERY, &cmd, &my_charset_utf8_general_ci, &sql_cbs, + st_session, COM_QUERY, &cmd, &my_charset_utf8mb3_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, &cbd)); void *ret; @@ -679,8 +679,8 @@ static int test_com_process_kill(void *p) { cmd.com_kill.id = srv_session_info_get_session_id(st_session_victim); ENSURE_API_OK(command_service_run_command( - st_session, COM_PROCESS_KILL, &cmd, &my_charset_utf8_general_ci, &sql_cbs, - CS_TEXT_REPRESENTATION, &cbd)); + st_session, COM_PROCESS_KILL, &cmd, &my_charset_utf8mb3_general_ci, + &sql_cbs, CS_TEXT_REPRESENTATION, &cbd)); WRITE_VAL("session is dead now? %i\n", thd_killed(srv_session_info_get_thd(st_session_victim))); @@ -708,7 +708,7 @@ static int test_priv(void *p) { cmd.com_query.query = "create user ordinary@localhost"; cmd.com_query.length = strlen(cmd.com_query.query); ENSURE_API_OK(command_service_run_command( - root_session, COM_QUERY, &cmd, &my_charset_utf8_general_ci, &sql_cbs, + root_session, COM_QUERY, &cmd, &my_charset_utf8mb3_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, &cbd)); WRITE_VAL("create user as root: %i %s\n", cbd.err, cbd.errmsg.c_str()); @@ -723,7 +723,7 @@ static int test_priv(void *p) { cmd.com_query.query = "create user bogus@localhost"; cmd.com_query.length = strlen(cmd.com_query.query); ENSURE_API_OK(command_service_run_command( - ordinary_session, COM_QUERY, &cmd, &my_charset_utf8_general_ci, + ordinary_session, COM_QUERY, &cmd, &my_charset_utf8mb3_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, &cbd)); WRITE_VAL("create user supposed to fail: %i %s\n", cbd.err, @@ -737,7 +737,7 @@ static int test_priv(void *p) { cmd.com_query.query = "drop user ordinary@localhost"; cmd.com_query.length = strlen(cmd.com_query.query); ENSURE_API_OK(command_service_run_command( - root_session, COM_QUERY, &cmd, &my_charset_utf8_general_ci, &sql_cbs, + root_session, COM_QUERY, &cmd, &my_charset_utf8mb3_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, &cbd)); WRITE_VAL("drop user as root: %i %s\n", cbd.err, cbd.errmsg.c_str()); diff --git a/plugin/test_service_sql_api/test_sql_commit.cc b/plugin/test_service_sql_api/test_sql_commit.cc index 7b488c3bf231..47b191de0a9a 100644 --- a/plugin/test_service_sql_api/test_sql_commit.cc +++ b/plugin/test_service_sql_api/test_sql_commit.cc @@ -686,7 +686,7 @@ static void run_statement(MYSQL_SESSION session, const char *query, ctx->reset(); WRITE_STR("[protocol init]\n"); int fail = command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, + &my_charset_utf8mb3_general_ci, &protocol_callbacks, txt_or_bin, ctx); if (fail) { LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "run_statement code: %d\n", @@ -721,7 +721,7 @@ void static change_current_db(MYSQL_SESSION session, const char *db, WRITE_DASHED_LINE(); WRITE_VAL("EXECUTING:[COM_INIT_DB][%s]\n", db); int fail = command_service_run_command( - session, COM_INIT_DB, &cmd, &my_charset_utf8_general_ci, + session, COM_INIT_DB, &cmd, &my_charset_utf8mb3_general_ci, &protocol_callbacks, CS_TEXT_REPRESENTATION, ctx); if (fail) LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "change db code: %d\n", diff --git a/plugin/test_service_sql_api/test_sql_complex.cc b/plugin/test_service_sql_api/test_sql_complex.cc index 67c95e7f00f4..f72ec8604051 100644 --- a/plugin/test_service_sql_api/test_sql_complex.cc +++ b/plugin/test_service_sql_api/test_sql_complex.cc @@ -793,7 +793,7 @@ static void run_statement(MYSQL_SESSION session, const char *query, again: ctx->reset(); int fail = command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, + &my_charset_utf8mb3_general_ci, &protocol_callbacks, txt_or_bin, ctx); if (fail) { LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "run_statement code: %d\n", @@ -825,7 +825,7 @@ void static change_current_db(MYSQL_SESSION session, const char *db, ctx->reset(); int fail = command_service_run_command( - session, COM_INIT_DB, &cmd, &my_charset_utf8_general_ci, + session, COM_INIT_DB, &cmd, &my_charset_utf8mb3_general_ci, &protocol_callbacks, CS_TEXT_REPRESENTATION, ctx); if (fail) LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "change db code: %d\n", diff --git a/plugin/test_service_sql_api/test_sql_errors.cc b/plugin/test_service_sql_api/test_sql_errors.cc index 7c2a99966f88..5c0b9ef442b8 100644 --- a/plugin/test_service_sql_api/test_sql_errors.cc +++ b/plugin/test_service_sql_api/test_sql_errors.cc @@ -643,8 +643,8 @@ static void exec_test_cmd(MYSQL_SESSION session, const char *test_cmd, cmd.com_query.query = test_cmd; cmd.com_query.length = strlen(cmd.com_query.query); int fail = command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, - CS_TEXT_REPRESENTATION, ctx); + &my_charset_utf8mb3_general_ci, + &sql_cbs, CS_TEXT_REPRESENTATION, ctx); if (fail) { if (!srv_session_close(session)) LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, diff --git a/plugin/test_service_sql_api/test_sql_lock.cc b/plugin/test_service_sql_api/test_sql_lock.cc index c1ff78489135..3f930cc8f759 100644 --- a/plugin/test_service_sql_api/test_sql_lock.cc +++ b/plugin/test_service_sql_api/test_sql_lock.cc @@ -518,8 +518,8 @@ static void exec_test_cmd(MYSQL_SESSION session, const char *test_cmd, ctx->reset(); int fail = command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, - CS_TEXT_REPRESENTATION, ctx); + &my_charset_utf8mb3_general_ci, + &sql_cbs, CS_TEXT_REPRESENTATION, ctx); if (fail) LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, diff --git a/plugin/test_service_sql_api/test_sql_processlist.cc b/plugin/test_service_sql_api/test_sql_processlist.cc index 4234c2a19578..26e08f51768c 100644 --- a/plugin/test_service_sql_api/test_sql_processlist.cc +++ b/plugin/test_service_sql_api/test_sql_processlist.cc @@ -602,8 +602,8 @@ static void exec_test_cmd(MYSQL_SESSION session, const char *test_cmd, cmd.com_query.query = test_cmd; cmd.com_query.length = strlen(cmd.com_query.query); int fail = command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, - CS_TEXT_REPRESENTATION, ctx); + &my_charset_utf8mb3_general_ci, + &sql_cbs, CS_TEXT_REPRESENTATION, ctx); if (fail) LogPluginErr(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "test_sql_processlist: ret code: %d", fail); diff --git a/plugin/test_service_sql_api/test_sql_replication.cc b/plugin/test_service_sql_api/test_sql_replication.cc index d318707f22b9..04285c945e7e 100644 --- a/plugin/test_service_sql_api/test_sql_replication.cc +++ b/plugin/test_service_sql_api/test_sql_replication.cc @@ -693,7 +693,7 @@ static void run_statement(MYSQL_SESSION session, const char *query, again: ctx->reset(); int fail = command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, + &my_charset_utf8mb3_general_ci, &protocol_callbacks, txt_or_bin, ctx); if (fail) { LogPluginErr(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "run_statement code: %d\n", @@ -728,7 +728,7 @@ void static change_current_db(MYSQL_SESSION session, const char *db, WRITE_VAL("EXECUTING:[COM_INIT_DB][%s]\n", db); ctx->reset(); int fail = command_service_run_command( - session, COM_INIT_DB, &cmd, &my_charset_utf8_general_ci, + session, COM_INIT_DB, &cmd, &my_charset_utf8mb3_general_ci, &protocol_callbacks, CS_TEXT_REPRESENTATION, ctx); if (fail) LogPluginErr(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "change db code: %d\n", fail); diff --git a/plugin/test_service_sql_api/test_sql_reset_connection.cc b/plugin/test_service_sql_api/test_sql_reset_connection.cc index 87e73e8f8478..231236cd599c 100644 --- a/plugin/test_service_sql_api/test_sql_reset_connection.cc +++ b/plugin/test_service_sql_api/test_sql_reset_connection.cc @@ -501,7 +501,7 @@ static void query_execute(MYSQL_SESSION session, st_plugin_ctx *pctx, cmd.com_query.query = query.c_str(); cmd.com_query.length = query.size(); if (command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, + &my_charset_utf8mb3_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, pctx)) { LogPluginErr(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "fail query execution - %d:%s", pctx->sql_errno, pctx->err_msg); @@ -565,7 +565,7 @@ static void ensure_api_not_null(const char *function, void *result) { static void reset_connection(MYSQL_SESSION st_session, st_plugin_ctx *pctx) { COM_DATA cmd; ENSURE_API_OK(command_service_run_command( - st_session, COM_RESET_CONNECTION, &cmd, &my_charset_utf8_general_ci, + st_session, COM_RESET_CONNECTION, &cmd, &my_charset_utf8mb3_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, pctx)); } diff --git a/plugin/test_service_sql_api/test_sql_shutdown.cc b/plugin/test_service_sql_api/test_sql_shutdown.cc index a3282c3ee5c3..065b494e54fb 100644 --- a/plugin/test_service_sql_api/test_sql_shutdown.cc +++ b/plugin/test_service_sql_api/test_sql_shutdown.cc @@ -540,9 +540,9 @@ static void exec_test_cmd(MYSQL_SESSION session, const char *test_cmd, memset(&cmd, 0, sizeof(cmd)); cmd.com_query.query = test_cmd; cmd.com_query.length = strlen(cmd.com_query.query); - int fail = command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, - CS_BINARY_REPRESENTATION, ctx); + int fail = command_service_run_command( + session, COM_QUERY, &cmd, &my_charset_utf8mb3_general_ci, &sql_cbs, + CS_BINARY_REPRESENTATION, ctx); if (fail) { if (callback_called == false) LogPluginErr(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "Callback not called"); diff --git a/plugin/test_service_sql_api/test_sql_sleep_is_connected.cc b/plugin/test_service_sql_api/test_sql_sleep_is_connected.cc index ca87b0e40939..0ee8172e1b0f 100644 --- a/plugin/test_service_sql_api/test_sql_sleep_is_connected.cc +++ b/plugin/test_service_sql_api/test_sql_sleep_is_connected.cc @@ -263,9 +263,9 @@ static void run_cmd(MYSQL_SESSION session, const std::string &query, com.com_query.query = query.c_str(); com.com_query.length = query.length(); - int fail = command_service_run_command(session, COM_QUERY, &com, - &my_charset_utf8_general_ci, &sql_cbs, - CS_TEXT_REPRESENTATION, ctxt); + int fail = command_service_run_command( + session, COM_QUERY, &com, &my_charset_utf8mb3_general_ci, &sql_cbs, + CS_TEXT_REPRESENTATION, ctxt); if (fail) { test_context->log_error("run_statement code: ", fail); diff --git a/plugin/test_service_sql_api/test_sql_sqlmode.cc b/plugin/test_service_sql_api/test_sql_sqlmode.cc index 8cfff3cc5862..e1447b50c80d 100644 --- a/plugin/test_service_sql_api/test_sql_sqlmode.cc +++ b/plugin/test_service_sql_api/test_sql_sqlmode.cc @@ -772,7 +772,7 @@ static void run_statement(MYSQL_SESSION session, const char *query, again: ctx->reset(); int fail = command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, + &my_charset_utf8mb3_general_ci, &protocol_callbacks, txt_or_bin, ctx); if (fail) { LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "run_statement code: %d\n", @@ -807,7 +807,7 @@ void static change_current_db(MYSQL_SESSION session, const char *db, WRITE_VAL("EXECUTING:[COM_INIT_DB][%s]\n", db); ctx->reset(); int fail = command_service_run_command( - session, COM_INIT_DB, &cmd, &my_charset_utf8_general_ci, + session, COM_INIT_DB, &cmd, &my_charset_utf8mb3_general_ci, &protocol_callbacks, CS_TEXT_REPRESENTATION, ctx); if (fail) LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "change db code: %d\n", diff --git a/plugin/test_service_sql_api/test_sql_stmt.cc b/plugin/test_service_sql_api/test_sql_stmt.cc index 5d9025396890..b4d885c7f52c 100644 --- a/plugin/test_service_sql_api/test_sql_stmt.cc +++ b/plugin/test_service_sql_api/test_sql_stmt.cc @@ -738,7 +738,7 @@ static void run_cmd(MYSQL_SESSION session, enum_server_command cmd, print_cmd(cmd, data); ctx->cmd = cmd; int fail = command_service_run_command(session, cmd, data, - &my_charset_utf8_general_ci, + &my_charset_utf8mb3_general_ci, &protocol_callbacks, txt_or_bin, ctx); if (fail) { LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "run_statement code: %d\n", diff --git a/plugin/test_service_sql_api/test_sql_stored_procedures_functions.cc b/plugin/test_service_sql_api/test_sql_stored_procedures_functions.cc index 0ebc45329445..78ca80fa5f62 100644 --- a/plugin/test_service_sql_api/test_sql_stored_procedures_functions.cc +++ b/plugin/test_service_sql_api/test_sql_stored_procedures_functions.cc @@ -725,7 +725,7 @@ static void run_statement(MYSQL_SESSION session, const char *query, again: ctx->reset(); int fail = command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, + &my_charset_utf8mb3_general_ci, &protocol_callbacks, txt_or_bin, ctx); if (fail) { LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "run_statement code: %d\n", @@ -760,7 +760,7 @@ void static change_current_db(MYSQL_SESSION session, const char *db, WRITE_VAL("EXECUTING:[COM_INIT_DB][%s]\n", db); ctx->reset(); int fail = command_service_run_command( - session, COM_INIT_DB, &cmd, &my_charset_utf8_general_ci, + session, COM_INIT_DB, &cmd, &my_charset_utf8mb3_general_ci, &protocol_callbacks, CS_TEXT_REPRESENTATION, ctx); if (fail) LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "change db code: %d\n", diff --git a/plugin/test_service_sql_api/test_sql_views_triggers.cc b/plugin/test_service_sql_api/test_sql_views_triggers.cc index 7a58b02cf210..4e38c15e9f96 100644 --- a/plugin/test_service_sql_api/test_sql_views_triggers.cc +++ b/plugin/test_service_sql_api/test_sql_views_triggers.cc @@ -725,7 +725,7 @@ static void run_statement(MYSQL_SESSION session, const char *query, again: ctx->reset(); int fail = command_service_run_command(session, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, + &my_charset_utf8mb3_general_ci, &protocol_callbacks, txt_or_bin, ctx); if (fail) { LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "run_statement code: %d\n", @@ -760,7 +760,7 @@ void static change_current_db(MYSQL_SESSION session, const char *db, WRITE_VAL("EXECUTING:[COM_INIT_DB][%s]\n", db); ctx->reset(); int fail = command_service_run_command( - session, COM_INIT_DB, &cmd, &my_charset_utf8_general_ci, + session, COM_INIT_DB, &cmd, &my_charset_utf8mb3_general_ci, &protocol_callbacks, CS_TEXT_REPRESENTATION, ctx); if (fail) LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG, "change db code: %d\n", diff --git a/plugin/test_service_sql_api/test_x_sessions_init.cc b/plugin/test_service_sql_api/test_x_sessions_init.cc index 3d3b286e1151..d5e9eeb10bd2 100644 --- a/plugin/test_service_sql_api/test_x_sessions_init.cc +++ b/plugin/test_service_sql_api/test_x_sessions_init.cc @@ -197,7 +197,7 @@ static void test_session_only_open(void *p [[maybe_unused]]) { cmd.com_query.query = "SELECT * FROM test.t_int"; cmd.com_query.length = strlen(cmd.com_query.query); command_service_run_command(NULL, COM_QUERY, &cmd, - &my_charset_utf8_general_ci, &sql_cbs, + &my_charset_utf8mb3_general_ci, &sql_cbs, CS_TEXT_REPRESENTATION, ctx); delete ctx; } diff --git a/sql/auth/acl_table_user.cc b/sql/auth/acl_table_user.cc index 12c8104a13b0..967187d20cbe 100644 --- a/sql/auth/acl_table_user.cc +++ b/sql/auth/acl_table_user.cc @@ -797,7 +797,7 @@ bool Acl_table_user_writer::update_authentication_info( m_table->field[m_table_schema->plugin_idx()]->set_notnull(); m_table->field[m_table_schema->authentication_string_idx()]->store( m_combo->first_factor_auth_info.auth.str, - m_combo->first_factor_auth_info.auth.length, &my_charset_utf8_bin); + m_combo->first_factor_auth_info.auth.length, &my_charset_utf8mb3_bin); m_table->field[m_table_schema->authentication_string_idx()] ->set_notnull(); } else { diff --git a/sql/auth/password_policy_service.cc b/sql/auth/password_policy_service.cc index 7eb9e6d5da7c..0c90aec5635c 100644 --- a/sql/auth/password_policy_service.cc +++ b/sql/auth/password_policy_service.cc @@ -24,7 +24,7 @@ #include #include "lex_string.h" -#include "m_ctype.h" /* my_charset_utf8_bin */ +#include "m_ctype.h" /* my_charset_utf8mb3_bin */ #include "m_string.h" /* assert */ #include "my_inttypes.h" @@ -78,7 +78,7 @@ int my_validate_password_policy(const char *password, int res = 0; if (password) { - String tmp_str(password, password_len, &my_charset_utf8_bin); + String tmp_str(password, password_len, &my_charset_utf8mb3_bin); password_str = tmp_str; } if (!srv_registry->acquire("validate_password", &h_pv_svc)) { @@ -137,7 +137,8 @@ int my_calculate_password_strength(const char *password, SERVICE_TYPE(validate_password) * ret; String password_str; - if (password) password_str.set(password, password_len, &my_charset_utf8_bin); + if (password) + password_str.set(password, password_len, &my_charset_utf8mb3_bin); if (!srv_registry->acquire("validate_password", &h_pv_svc)) { ret = reinterpret_cast(h_pv_svc); if (!ret->get_strength((void *)current_thd, (my_h_string)&password_str, diff --git a/sql/auth/sql_authorization.cc b/sql/auth/sql_authorization.cc index 519046cc2f3a..5436d9c95ea4 100644 --- a/sql/auth/sql_authorization.cc +++ b/sql/auth/sql_authorization.cc @@ -5316,7 +5316,7 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name, */ next_it = next(it); GRANT_NAME *grant_proc = it->second.get(); - if (!my_strcasecmp(&my_charset_utf8_bin, grant_proc->db, sp_db) && + if (!my_strcasecmp(&my_charset_utf8mb3_bin, grant_proc->db, sp_db) && !my_strcasecmp(system_charset_info, grant_proc->tname, sp_name)) { LEX_USER lex_user; lex_user.user.str = grant_proc->user; diff --git a/sql/auth/sql_user.cc b/sql/auth/sql_user.cc index 1b579a75acb9..102ce7d10e6a 100644 --- a/sql/auth/sql_user.cc +++ b/sql/auth/sql_user.cc @@ -676,7 +676,7 @@ static bool auth_verify_password_history( table->field[MYSQL_PASSWORD_HISTORY_FIELD_PASSWORD_TIMESTAMP]->store_time( &tm_now); table->field[MYSQL_PASSWORD_HISTORY_FIELD_PASSWORD]->store( - cred_hash, cred_hash_length, &my_charset_utf8_bin); + cred_hash, cred_hash_length, &my_charset_utf8mb3_bin); table->field[MYSQL_PASSWORD_HISTORY_FIELD_PASSWORD]->set_notnull(); if (0 != (error = table->file->ha_write_row(table->record[0]))) { diff --git a/sql/dd/dd_schema.cc b/sql/dd/dd_schema.cc index 1908e8dc02ff..4042607506c0 100644 --- a/sql/dd/dd_schema.cc +++ b/sql/dd/dd_schema.cc @@ -91,7 +91,7 @@ bool mdl_lock_schema(THD *thd, const char *schema_name, // Lower case table names == 2 is tested on OSX. /* purecov: begin tested */ my_stpcpy(name_buf, converted_name); - my_casedn_str(&my_charset_utf8_tolower_ci, name_buf); + my_casedn_str(&my_charset_utf8mb3_tolower_ci, name_buf); converted_name = name_buf; /* purecov: end */ } diff --git a/sql/dd/impl/tables/character_sets.cc b/sql/dd/impl/tables/character_sets.cc index 00ebfce3287a..68b640844c63 100644 --- a/sql/dd/impl/tables/character_sets.cc +++ b/sql/dd/impl/tables/character_sets.cc @@ -55,7 +55,7 @@ const Character_sets &Character_sets::instance() { /////////////////////////////////////////////////////////////////////////// const CHARSET_INFO *Character_sets::name_collation() { - return &my_charset_utf8_general_ci; + return &my_charset_utf8mb3_general_ci; } /////////////////////////////////////////////////////////////////////////// diff --git a/sql/dd/impl/tables/check_constraints.cc b/sql/dd/impl/tables/check_constraints.cc index f1f481977604..255799d2ac86 100644 --- a/sql/dd/impl/tables/check_constraints.cc +++ b/sql/dd/impl/tables/check_constraints.cc @@ -43,7 +43,7 @@ const Check_constraints &Check_constraints::instance() { /////////////////////////////////////////////////////////////////////////// const CHARSET_INFO *Check_constraints::name_collation() { - return &my_charset_utf8_tolower_ci; + return &my_charset_utf8mb3_tolower_ci; } /////////////////////////////////////////////////////////////////////////// diff --git a/sql/dd/impl/tables/collations.cc b/sql/dd/impl/tables/collations.cc index 4d1d4475d751..5c8bf6527588 100644 --- a/sql/dd/impl/tables/collations.cc +++ b/sql/dd/impl/tables/collations.cc @@ -55,7 +55,7 @@ const Collations &Collations::instance() { /////////////////////////////////////////////////////////////////////////// const CHARSET_INFO *Collations::name_collation() { - return &my_charset_utf8_general_ci; + return &my_charset_utf8mb3_general_ci; } /////////////////////////////////////////////////////////////////////////// diff --git a/sql/dd/impl/tables/columns.cc b/sql/dd/impl/tables/columns.cc index 9e03097e056d..72e686946a74 100644 --- a/sql/dd/impl/tables/columns.cc +++ b/sql/dd/impl/tables/columns.cc @@ -39,7 +39,7 @@ const Columns &Columns::instance() { /////////////////////////////////////////////////////////////////////////// const CHARSET_INFO *Columns::name_collation() { - return &my_charset_utf8_tolower_ci; + return &my_charset_utf8mb3_tolower_ci; } /////////////////////////////////////////////////////////////////////////// diff --git a/sql/dd/impl/tables/events.cc b/sql/dd/impl/tables/events.cc index 1a98caa8d9bd..7eccb9d51897 100644 --- a/sql/dd/impl/tables/events.cc +++ b/sql/dd/impl/tables/events.cc @@ -44,7 +44,7 @@ const Events &Events::instance() { /////////////////////////////////////////////////////////////////////////// const CHARSET_INFO *Events::name_collation() { - return &my_charset_utf8_general_ci; + return &my_charset_utf8mb3_general_ci; } /////////////////////////////////////////////////////////////////////////// diff --git a/sql/dd/impl/tables/foreign_keys.cc b/sql/dd/impl/tables/foreign_keys.cc index 6a48f3e6a130..2009f1a62b3f 100644 --- a/sql/dd/impl/tables/foreign_keys.cc +++ b/sql/dd/impl/tables/foreign_keys.cc @@ -44,7 +44,7 @@ const Foreign_keys &Foreign_keys::instance() { /////////////////////////////////////////////////////////////////////////// const CHARSET_INFO *Foreign_keys::name_collation() { - return &my_charset_utf8_general_ci; + return &my_charset_utf8mb3_general_ci; } /////////////////////////////////////////////////////////////////////////// diff --git a/sql/dd/impl/tables/indexes.cc b/sql/dd/impl/tables/indexes.cc index 4f01adb358f5..d46f94508692 100644 --- a/sql/dd/impl/tables/indexes.cc +++ b/sql/dd/impl/tables/indexes.cc @@ -39,7 +39,7 @@ const Indexes &Indexes::instance() { /////////////////////////////////////////////////////////////////////////// const CHARSET_INFO *Indexes::name_collation() { - return &my_charset_utf8_tolower_ci; + return &my_charset_utf8mb3_tolower_ci; } /////////////////////////////////////////////////////////////////////////// diff --git a/sql/dd/impl/tables/parameters.cc b/sql/dd/impl/tables/parameters.cc index b7635d4fb5bb..59db19198855 100644 --- a/sql/dd/impl/tables/parameters.cc +++ b/sql/dd/impl/tables/parameters.cc @@ -39,7 +39,7 @@ const Parameters &Parameters::instance() { /////////////////////////////////////////////////////////////////////////// const CHARSET_INFO *Parameters::name_collation() { - return &my_charset_utf8_general_ci; + return &my_charset_utf8mb3_general_ci; } /////////////////////////////////////////////////////////////////////////// diff --git a/sql/dd/impl/tables/resource_groups.cc b/sql/dd/impl/tables/resource_groups.cc index 6c17a17eff00..bdfae823e6dd 100644 --- a/sql/dd/impl/tables/resource_groups.cc +++ b/sql/dd/impl/tables/resource_groups.cc @@ -60,7 +60,7 @@ const Resource_groups &Resource_groups::instance() { } const CHARSET_INFO *Resource_groups::name_collation() { - return &my_charset_utf8_general_ci; + return &my_charset_utf8mb3_general_ci; } bool Resource_groups::update_object_key(Global_name_key *key, diff --git a/sql/dd/impl/tables/routines.cc b/sql/dd/impl/tables/routines.cc index 46ab9ff79b47..443ba2c57e79 100644 --- a/sql/dd/impl/tables/routines.cc +++ b/sql/dd/impl/tables/routines.cc @@ -43,7 +43,7 @@ const Routines &Routines::instance() { /////////////////////////////////////////////////////////////////////////// const CHARSET_INFO *Routines::name_collation() { - return &my_charset_utf8_general_ci; + return &my_charset_utf8mb3_general_ci; } /////////////////////////////////////////////////////////////////////////// diff --git a/sql/dd/impl/tables/spatial_reference_systems.cc b/sql/dd/impl/tables/spatial_reference_systems.cc index e182257683f6..1c2b64701e16 100644 --- a/sql/dd/impl/tables/spatial_reference_systems.cc +++ b/sql/dd/impl/tables/spatial_reference_systems.cc @@ -44,7 +44,7 @@ const Spatial_reference_systems &Spatial_reference_systems::instance() { /////////////////////////////////////////////////////////////////////////// const CHARSET_INFO *Spatial_reference_systems::name_collation() { - return &my_charset_utf8_general_ci; + return &my_charset_utf8mb3_general_ci; } /////////////////////////////////////////////////////////////////////////// diff --git a/sql/dd/impl/tables/table_partitions.cc b/sql/dd/impl/tables/table_partitions.cc index c46c62d6b4df..2b0916fe1d9a 100644 --- a/sql/dd/impl/tables/table_partitions.cc +++ b/sql/dd/impl/tables/table_partitions.cc @@ -47,7 +47,7 @@ const Table_partitions &Table_partitions::instance() { /////////////////////////////////////////////////////////////////////////// const CHARSET_INFO *Table_partitions::name_collation() { - return &my_charset_utf8_tolower_ci; + return &my_charset_utf8mb3_tolower_ci; } /////////////////////////////////////////////////////////////////////////// diff --git a/sql/dd/impl/tables/triggers.cc b/sql/dd/impl/tables/triggers.cc index 10368924d09c..e0fc72087d95 100644 --- a/sql/dd/impl/tables/triggers.cc +++ b/sql/dd/impl/tables/triggers.cc @@ -42,7 +42,7 @@ namespace tables { /////////////////////////////////////////////////////////////////////////// const CHARSET_INFO *Triggers::name_collation() { - return &my_charset_utf8_general_ci; + return &my_charset_utf8mb3_general_ci; } /////////////////////////////////////////////////////////////////////////// diff --git a/sql/dd/impl/types/object_table_definition_impl.h b/sql/dd/impl/types/object_table_definition_impl.h index 2da83c122255..eef31b382b42 100644 --- a/sql/dd/impl/types/object_table_definition_impl.h +++ b/sql/dd/impl/types/object_table_definition_impl.h @@ -158,8 +158,8 @@ class Object_table_definition_impl : public Object_table_definition { */ static const CHARSET_INFO *fs_name_collation() { - if (lower_case_table_names == 0) return &my_charset_utf8_bin; - return &my_charset_utf8_tolower_ci; + if (lower_case_table_names == 0) return &my_charset_utf8mb3_bin; + return &my_charset_utf8mb3_tolower_ci; } /** @@ -175,7 +175,9 @@ class Object_table_definition_impl : public Object_table_definition { @return Pointer to CHARSET_INFO. */ - static const CHARSET_INFO *name_collation() { return &my_charset_utf8_bin; } + static const CHARSET_INFO *name_collation() { + return &my_charset_utf8mb3_bin; + } /** Convert to lowercase if lower_case_table_names == 2. This is needed diff --git a/sql/dd/impl/types/routine_impl.cc b/sql/dd/impl/types/routine_impl.cc index b7cd305e2e25..55b7715b55ec 100644 --- a/sql/dd/impl/types/routine_impl.cc +++ b/sql/dd/impl/types/routine_impl.cc @@ -290,7 +290,7 @@ void Routine::create_mdl_key(enum_routine_type type, tables::Schemata::name_collation())); DBUG_EXECUTE_IF("simulate_lctn_two_case_for_schema_case_compare", { assert((lower_case_table_names == 2) || - is_string_in_lowercase(schema_name, &my_charset_utf8_tolower_ci)); + is_string_in_lowercase(schema_name, &my_charset_utf8mb3_tolower_ci)); }); #endif diff --git a/sql/events.cc b/sql/events.cc index b7e21e2c2618..975eb68f0ba5 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -1168,7 +1168,7 @@ static bool load_events_from_db(THD *thd, Event_queue *event_queue) { if (lower_case_table_names == 2) { // Lower case table names == 2 is tested on OSX. my_stpcpy(name_buf, converted_schema_name); - my_casedn_str(&my_charset_utf8_tolower_ci, name_buf); + my_casedn_str(&my_charset_utf8mb3_tolower_ci, name_buf); converted_schema_name = name_buf; } diff --git a/sql/item.h b/sql/item.h index 5c8003849b19..9afbe7b9ce66 100644 --- a/sql/item.h +++ b/sql/item.h @@ -5395,8 +5395,9 @@ class Item_empty_string : public Item_partition_func_safe_string { public: Item_empty_string(const char *header, size_t length, const CHARSET_INFO *cs = nullptr) - : Item_partition_func_safe_string(Name_string(header, strlen(header)), 0, - cs ? cs : &my_charset_utf8_general_ci) { + : Item_partition_func_safe_string( + Name_string(header, strlen(header)), 0, + cs ? cs : &my_charset_utf8mb3_general_ci) { max_length = static_cast(length * collation.collation->mbmaxlen); } void make_field(Send_field *field) override; diff --git a/sql/item_json_func.cc b/sql/item_json_func.cc index 646ad0033d3b..ee46e573f5b2 100644 --- a/sql/item_json_func.cc +++ b/sql/item_json_func.cc @@ -91,7 +91,7 @@ bool ensure_utf8mb4(const String &val, String *buf, const char **resptr, size_t ss = val.length(); if (my_charset_same(cs, &my_charset_utf8mb4_bin) || - my_charset_same(cs, &my_charset_utf8_bin) || + my_charset_same(cs, &my_charset_utf8mb3_bin) || !std::strcmp(cs->csname, "ascii")) { /* Character data is directly converted to JSON if the character diff --git a/sql/item_pfs_func.cc b/sql/item_pfs_func.cc index 384b61d874e5..75e09ca5391c 100644 --- a/sql/item_pfs_func.cc +++ b/sql/item_pfs_func.cc @@ -154,7 +154,7 @@ longlong Item_func_pfs_thread_id::val_int() { bool Item_func_pfs_format_bytes::resolve_type(THD *) { /* Format is 'AAAA.BB UUU' = 11 characters or 'AAAA bytes' = 10 characters. */ - set_data_type_string(11U, &my_charset_utf8_general_ci); + set_data_type_string(11U, &my_charset_utf8mb3_general_ci); return false; } @@ -216,7 +216,7 @@ String *Item_func_pfs_format_bytes::val_str(String *) { } } - m_value.set(m_value_buffer, len, &my_charset_utf8_general_ci); + m_value.set(m_value_buffer, len, &my_charset_utf8mb3_general_ci); return &m_value; } @@ -225,7 +225,7 @@ String *Item_func_pfs_format_bytes::val_str(String *) { bool Item_func_pfs_format_pico_time::resolve_type(THD *) { set_nullable(true); /* Format is 'AAAA.BB UUU' = 11 characters or 'AAA ps' = 6 characters. */ - set_data_type_string(11U, &my_charset_utf8_general_ci); + set_data_type_string(11U, &my_charset_utf8mb3_general_ci); return false; } @@ -292,6 +292,6 @@ String *Item_func_pfs_format_pico_time::val_str(String *) { } } - m_value.set(m_value_buffer, len, &my_charset_utf8_general_ci); + m_value.set(m_value_buffer, len, &my_charset_utf8mb3_general_ci); return &m_value; } diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 221820aea39b..06d85b8f3eab 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -984,7 +984,7 @@ bool Item_func_at_time_zone::resolve_type(THD *thd) { bool Item_func_at_time_zone::set_time_zone(THD *thd) { String s(m_specifier_string, strlen(m_specifier_string), - &my_charset_utf8_bin); + &my_charset_utf8mb3_bin); m_tz = my_tz_find(thd, &s); if (m_tz == nullptr) { my_error(ER_UNKNOWN_TIME_ZONE, MYF(0), m_specifier_string); @@ -1283,7 +1283,7 @@ String *Item_func_monthname::val_str(String *str) { return (String *)nullptr; month_name = locale->month_names->type_names[ltime.month - 1]; - str->copy(month_name, strlen(month_name), &my_charset_utf8_bin, + str->copy(month_name, strlen(month_name), &my_charset_utf8mb3_bin, collation.collation, &err); return str; } @@ -1483,7 +1483,7 @@ String *Item_func_dayname::val_str(String *str) { if (null_value) return (String *)nullptr; day_name = locale->day_names->type_names[weekday]; - str->copy(day_name, strlen(day_name), &my_charset_utf8_bin, + str->copy(day_name, strlen(day_name), &my_charset_utf8mb3_bin, collation.collation, &err); return str; } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 841f1b1f51dd..2c3fab914c6d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5186,8 +5186,8 @@ int init_common_variables() { } /* Reset table_alias_charset, now that lower_case_table_names is set. */ - table_alias_charset = - (lower_case_table_names ? &my_charset_utf8_tolower_ci : &my_charset_bin); + table_alias_charset = (lower_case_table_names ? &my_charset_utf8mb3_tolower_ci + : &my_charset_bin); /* Build do_table and ignore_table rules to hashes @@ -6886,12 +6886,12 @@ static void test_lc_time_sz() { for (const char **month = (*loc)->month_names->type_names; *month; month++) { max_month_len = std::max( - max_month_len, my_numchars_mb(&my_charset_utf8_general_ci, *month, + max_month_len, my_numchars_mb(&my_charset_utf8mb3_general_ci, *month, *month + strlen(*month))); } for (const char **day = (*loc)->day_names->type_names; *day; day++) { max_day_len = - std::max(max_day_len, my_numchars_mb(&my_charset_utf8_general_ci, + std::max(max_day_len, my_numchars_mb(&my_charset_utf8mb3_general_ci, *day, *day + strlen(*day))); } if ((*loc)->max_month_name_length != max_month_len || @@ -7131,7 +7131,7 @@ int mysqld_main(int argc, char **argv) sizeof(mysql_real_data_home) - 1); /* Must be initialized early for comparison of options name */ - system_charset_info = &my_charset_utf8_general_ci; + system_charset_info = &my_charset_utf8mb3_general_ci; /* Write mysys error messages to the error log. */ local_message_hook = error_log_print; @@ -7398,7 +7398,7 @@ int mysqld_main(int argc, char **argv) { /* Must be initialized early because it is required by dynamic loader */ - files_charset_info = &my_charset_utf8_general_ci; + files_charset_info = &my_charset_utf8mb3_general_ci; auto keyring_helper = std::make_unique( remaining_argc, remaining_argv); @@ -8314,7 +8314,7 @@ int mysqld_main(int argc, char **argv) { } /* Must be initialized early for comparison of service name */ - system_charset_info = &my_charset_utf8_general_ci; + system_charset_info = &my_charset_utf8mb3_general_ci; if (mysqld_early_option || !mysqld_monitor) { #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE @@ -9964,9 +9964,9 @@ static int mysql_init_variables() { server_uuid[0] = 0; /* Character sets */ - system_charset_info = &my_charset_utf8_general_ci; - files_charset_info = &my_charset_utf8_general_ci; - national_charset_info = &my_charset_utf8_general_ci; + system_charset_info = &my_charset_utf8mb3_general_ci; + files_charset_info = &my_charset_utf8mb3_general_ci; + national_charset_info = &my_charset_utf8mb3_general_ci; table_alias_charset = &my_charset_bin; character_set_filesystem = &my_charset_bin; diff --git a/sql/opt_costconstantcache.cc b/sql/opt_costconstantcache.cc index c71951aec079..9d47c4b4da86 100644 --- a/sql/opt_costconstantcache.cc +++ b/sql/opt_costconstantcache.cc @@ -264,7 +264,7 @@ static void read_server_cost_constants(THD *thd, TABLE *table, if (!table->field[1]->is_null()) { char cost_name_buf[MAX_FIELD_WIDTH]; String cost_name(cost_name_buf, sizeof(cost_name_buf), - &my_charset_utf8_general_ci); + &my_charset_utf8mb3_general_ci); // Read the name of the cost constant table->field[0]->val_str(&cost_name); @@ -329,10 +329,10 @@ static void read_engine_cost_constants(THD *thd, TABLE *table, if (!table->field[3]->is_null()) { char engine_name_buf[MAX_FIELD_WIDTH]; String engine_name(engine_name_buf, sizeof(engine_name_buf), - &my_charset_utf8_general_ci); + &my_charset_utf8mb3_general_ci); char cost_name_buf[MAX_FIELD_WIDTH]; String cost_name(cost_name_buf, sizeof(cost_name_buf), - &my_charset_utf8_general_ci); + &my_charset_utf8mb3_general_ci); // Read the name of the storage engine table->field[0]->val_str(&engine_name); diff --git a/sql/opt_costconstants.cc b/sql/opt_costconstants.cc index 949d592e7ed9..ac84ec67189b 100644 --- a/sql/opt_costconstants.cc +++ b/sql/opt_costconstants.cc @@ -97,37 +97,37 @@ cost_constant_error Server_cost_constants::set(const LEX_CSTRING &name, if (value <= 0.0) return INVALID_COST_VALUE; // ROW_EVALUATE_COST - if (my_strcasecmp(&my_charset_utf8_general_ci, "ROW_EVALUATE_COST", + if (my_strcasecmp(&my_charset_utf8mb3_general_ci, "ROW_EVALUATE_COST", name.str) == 0) { m_row_evaluate_cost = value; return COST_CONSTANT_OK; } // KEY_COMPARE_COST - if (my_strcasecmp(&my_charset_utf8_general_ci, "KEY_COMPARE_COST", + if (my_strcasecmp(&my_charset_utf8mb3_general_ci, "KEY_COMPARE_COST", name.str) == 0) { m_key_compare_cost = value; return COST_CONSTANT_OK; } // MEMORY_TEMPTABLE_CREATE_COST - if (my_strcasecmp(&my_charset_utf8_general_ci, "MEMORY_TEMPTABLE_CREATE_COST", - name.str) == 0) { + if (my_strcasecmp(&my_charset_utf8mb3_general_ci, + "MEMORY_TEMPTABLE_CREATE_COST", name.str) == 0) { m_memory_temptable_create_cost = value; return COST_CONSTANT_OK; } // MEMORY_TEMPTABLE_ROW_COST - if (my_strcasecmp(&my_charset_utf8_general_ci, "MEMORY_TEMPTABLE_ROW_COST", + if (my_strcasecmp(&my_charset_utf8mb3_general_ci, "MEMORY_TEMPTABLE_ROW_COST", name.str) == 0) { m_memory_temptable_row_cost = value; return COST_CONSTANT_OK; } // DISK_TEMPTABLE_CREATE_COST - if (my_strcasecmp(&my_charset_utf8_general_ci, "DISK_TEMPTABLE_CREATE_COST", - name.str) == 0) { + if (my_strcasecmp(&my_charset_utf8mb3_general_ci, + "DISK_TEMPTABLE_CREATE_COST", name.str) == 0) { m_disk_temptable_create_cost = value; return COST_CONSTANT_OK; } // DISK_TEMPTABLE_ROW_COST - if (my_strcasecmp(&my_charset_utf8_general_ci, "DISK_TEMPTABLE_ROW_COST", + if (my_strcasecmp(&my_charset_utf8mb3_general_ci, "DISK_TEMPTABLE_ROW_COST", name.str) == 0) { m_disk_temptable_row_cost = value; return COST_CONSTANT_OK; @@ -165,14 +165,14 @@ cost_constant_error SE_cost_constants::set(const LEX_CSTRING &name, if (value <= 0.0) return INVALID_COST_VALUE; // MEMORY_BLOCK_READ_COST - if (my_strcasecmp(&my_charset_utf8_general_ci, "MEMORY_BLOCK_READ_COST", + if (my_strcasecmp(&my_charset_utf8mb3_general_ci, "MEMORY_BLOCK_READ_COST", name.str) == 0) { update_cost_value(&m_memory_block_read_cost, &m_memory_block_read_cost_default, value, default_value); return COST_CONSTANT_OK; } // IO_BLOCK_READ_COST - if (my_strcasecmp(&my_charset_utf8_general_ci, "IO_BLOCK_READ_COST", + if (my_strcasecmp(&my_charset_utf8mb3_general_ci, "IO_BLOCK_READ_COST", name.str) == 0) { update_cost_value(&m_io_block_read_cost, &m_io_block_read_cost_default, value, default_value); @@ -294,7 +294,8 @@ cost_constant_error Cost_model_constants::update_engine_cost_constant( if (storage_category >= MAX_STORAGE_CLASSES) return INVALID_DEVICE_TYPE; // Check if this is a default value - if (my_strcasecmp(&my_charset_utf8_general_ci, "default", se_name.str) == 0) { + if (my_strcasecmp(&my_charset_utf8mb3_general_ci, "default", se_name.str) == + 0) { retval = update_engine_default_cost(name, storage_category, value); } else { // Look up the handler's slot id by using the storage engine name diff --git a/sql/opt_trace.cc b/sql/opt_trace.cc index d2dff6465f12..e43b2d997647 100644 --- a/sql/opt_trace.cc +++ b/sql/opt_trace.cc @@ -414,7 +414,7 @@ Opt_trace_stmt::Opt_trace_stmt(Opt_trace_context *ctx_arg) unknown_key_count(0) { // Trace is always in UTF8. This is the only charset which JSON accepts. trace_buffer.set_charset(system_charset_info); - assert(system_charset_info == &my_charset_utf8_general_ci); + assert(system_charset_info == &my_charset_utf8mb3_general_ci); } void Opt_trace_stmt::end() { diff --git a/sql/parse_tree_nodes.cc b/sql/parse_tree_nodes.cc index 698ab3214d87..b4a90951b0c6 100644 --- a/sql/parse_tree_nodes.cc +++ b/sql/parse_tree_nodes.cc @@ -4049,7 +4049,7 @@ Sql_cmd *PT_create_srs::make_cmd(THD *thd) { return nullptr; } MYSQL_LEX_STRING srs_name_utf8 = {nullptr, 0}; - if (thd->convert_string(&srs_name_utf8, &my_charset_utf8_bin, + if (thd->convert_string(&srs_name_utf8, &my_charset_utf8mb3_bin, m_attributes.srs_name.str, m_attributes.srs_name.length, thd->charset())) { /* purecov: begin inspected */ @@ -4067,7 +4067,7 @@ Sql_cmd *PT_create_srs::make_cmd(THD *thd) { return nullptr; } String srs_name_str(srs_name_utf8.str, srs_name_utf8.length, - &my_charset_utf8_bin); + &my_charset_utf8mb3_bin); if (srs_name_str.numchars() > 80) { my_error(ER_SRS_ATTRIBUTE_STRING_TOO_LONG, MYF(0), "NAME", 80); return nullptr; @@ -4078,7 +4078,7 @@ Sql_cmd *PT_create_srs::make_cmd(THD *thd) { return nullptr; } MYSQL_LEX_STRING definition_utf8 = {nullptr, 0}; - if (thd->convert_string(&definition_utf8, &my_charset_utf8_bin, + if (thd->convert_string(&definition_utf8, &my_charset_utf8mb3_bin, m_attributes.definition.str, m_attributes.definition.length, thd->charset())) { /* purecov: begin inspected */ @@ -4087,7 +4087,7 @@ Sql_cmd *PT_create_srs::make_cmd(THD *thd) { /* purecov: end */ } String definition_str(definition_utf8.str, definition_utf8.length, - &my_charset_utf8_bin); + &my_charset_utf8mb3_bin); if (contains_control_char(definition_utf8.str, definition_utf8.length)) { my_error(ER_SRS_INVALID_CHARACTER_IN_ATTRIBUTE, MYF(0), "DEFINITION"); return nullptr; @@ -4099,7 +4099,7 @@ Sql_cmd *PT_create_srs::make_cmd(THD *thd) { MYSQL_LEX_STRING organization_utf8 = {nullptr, 0}; if (m_attributes.organization.str != nullptr) { - if (thd->convert_string(&organization_utf8, &my_charset_utf8_bin, + if (thd->convert_string(&organization_utf8, &my_charset_utf8mb3_bin, m_attributes.organization.str, m_attributes.organization.length, thd->charset())) { /* purecov: begin inspected */ @@ -4114,7 +4114,7 @@ Sql_cmd *PT_create_srs::make_cmd(THD *thd) { return nullptr; } String organization_str(organization_utf8.str, organization_utf8.length, - &my_charset_utf8_bin); + &my_charset_utf8mb3_bin); if (contains_control_char(organization_utf8.str, organization_utf8.length)) { my_error(ER_SRS_INVALID_CHARACTER_IN_ATTRIBUTE, MYF(0), "ORGANIZATION"); @@ -4136,7 +4136,7 @@ Sql_cmd *PT_create_srs::make_cmd(THD *thd) { MYSQL_LEX_STRING description_utf8 = {nullptr, 0}; if (m_attributes.description.str != nullptr) { - if (thd->convert_string(&description_utf8, &my_charset_utf8_bin, + if (thd->convert_string(&description_utf8, &my_charset_utf8mb3_bin, m_attributes.description.str, m_attributes.description.length, thd->charset())) { /* purecov: begin inspected */ @@ -4145,7 +4145,7 @@ Sql_cmd *PT_create_srs::make_cmd(THD *thd) { /* purecov: end */ } String description_str(description_utf8.str, description_utf8.length, - &my_charset_utf8_bin); + &my_charset_utf8mb3_bin); if (contains_control_char(description_utf8.str, description_utf8.length)) { my_error(ER_SRS_INVALID_CHARACTER_IN_ATTRIBUTE, MYF(0), "DESCRIPTION"); return nullptr; diff --git a/sql/protocol_classic.cc b/sql/protocol_classic.cc index 5c4c3e7d4022..0c180ccdc5ec 100644 --- a/sql/protocol_classic.cc +++ b/sql/protocol_classic.cc @@ -405,7 +405,7 @@ Number | Hex | Character Set Name -------|-------|------------------- 8 | 0x08 | @ref my_charset_latin1 "latin1_swedish_ci" - 33 | 0x21 | @ref my_charset_utf8_general_ci "utf8mb3_general_ci" + 33 | 0x21 | @ref my_charset_utf8mb3_general_ci "utf8mb3_general_ci" 63 | 0x3f | @ref my_charset_bin "binary" diff --git a/sql/resourcegroups/resource_group_mgr.cc b/sql/resourcegroups/resource_group_mgr.cc index c34f8ae372a9..74bd3dc96cd9 100644 --- a/sql/resourcegroups/resource_group_mgr.cc +++ b/sql/resourcegroups/resource_group_mgr.cc @@ -160,11 +160,11 @@ static bool deserialize_resource_groups(THD *thd) { auto res_grp_mgr = Resource_group_mgr::instance(); for (const auto &resource_group : resource_group_vec) { - if (my_strcasecmp(&my_charset_utf8_general_ci, + if (my_strcasecmp(&my_charset_utf8mb3_general_ci, resource_group->name().c_str(), USR_DEFAULT_RESOURCE_GROUP_NAME) == 0) usr_default_in_dd = true; - else if (my_strcasecmp(&my_charset_utf8_general_ci, + else if (my_strcasecmp(&my_charset_utf8mb3_general_ci, resource_group->name().c_str(), SYS_DEFAULT_RESOURCE_GROUP_NAME) == 0) sys_default_in_dd = true; @@ -375,7 +375,7 @@ bool Resource_group_mgr::init() { m_resource_group_hash = new collation_unordered_map>( - &my_charset_utf8_tolower_ci, PSI_INSTRUMENT_ME); + &my_charset_utf8mb3_tolower_ci, PSI_INSTRUMENT_ME); if (m_resource_group_hash == nullptr) { LogErr(ERROR_LEVEL, ER_FAILED_TO_ALLOCATE_MEMORY_FOR_RESOURCE_GROUP_HASH); return true; diff --git a/sql/rpl_gtid.h b/sql/rpl_gtid.h index a2873bc533b9..dde099c34dd5 100644 --- a/sql/rpl_gtid.h +++ b/sql/rpl_gtid.h @@ -73,7 +73,7 @@ extern PSI_memory_key key_memory_Gtid_state_group_commit_sidno; character pointer, is a space or not. */ #define SKIP_WHITESPACE() \ - while (my_isspace(&my_charset_utf8_general_ci, *s)) s++ + while (my_isspace(&my_charset_utf8mb3_general_ci, *s)) s++ /* This macro must be used to filter out parts of the code that is not used now but may be useful in future. In other words, diff --git a/sql/rules_table_service.cc b/sql/rules_table_service.cc index b991381f36f8..a2ff78b73e50 100644 --- a/sql/rules_table_service.cc +++ b/sql/rules_table_service.cc @@ -164,7 +164,7 @@ void Cursor::set(int colno, const char *str, size_t length) { TABLE *table = m_table_list->table; Field *field = table->field[colno]; - const CHARSET_INFO *charset = &my_charset_utf8_unicode_ci; + const CHARSET_INFO *charset = &my_charset_utf8mb3_unicode_ci; if (str == nullptr) field->set_null(0); else { diff --git a/sql/server_component/log_builtins.cc b/sql/server_component/log_builtins.cc index 2990d86b0e05..9dd512ee2662 100644 --- a/sql/server_component/log_builtins.cc +++ b/sql/server_component/log_builtins.cc @@ -3474,7 +3474,7 @@ DEFINE_METHOD(log_service_error, log_builtins_syseventlog_imp::write, int ret; mysql_mutex_lock(&THR_LOCK_log_syseventlog); - ret = my_syslog(&my_charset_utf8_bin, level, msg); + ret = my_syslog(&my_charset_utf8mb3_bin, level, msg); mysql_mutex_unlock(&THR_LOCK_log_syseventlog); return (ret == 0) ? LOG_SERVICE_SUCCESS : LOG_SERVICE_NOT_AVAILABLE; diff --git a/sql/server_component/mysql_thd_attributes_imp.cc b/sql/server_component/mysql_thd_attributes_imp.cc index 137235be7e25..6422bd02970b 100644 --- a/sql/server_component/mysql_thd_attributes_imp.cc +++ b/sql/server_component/mysql_thd_attributes_imp.cc @@ -42,7 +42,7 @@ DEFINE_BOOL_METHOD(mysql_thd_attributes_imp::get, compute_digest_text(&t->m_digest->m_digest_storage, res); /* compute_digest_text returns string as to utf8. */ - res->set_charset(&my_charset_utf8_bin); + res->set_charset(&my_charset_utf8mb3_bin); *((my_h_string *)inout_pvalue) = (my_h_string)res; } else diff --git a/sql/sql_db.cc b/sql/sql_db.cc index d400e3b7fc5a..b52f40791e3d 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -370,7 +370,7 @@ bool mysql_create_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) { const char *lock_db_name = db; if (lower_case_table_names == 2) { my_stpcpy(name_buf, db); - my_casedn_str(&my_charset_utf8_tolower_ci, name_buf); + my_casedn_str(&my_charset_utf8mb3_tolower_ci, name_buf); lock_db_name = name_buf; } if (lock_schema_name(thd, lock_db_name)) return true; diff --git a/sql/sql_digest.cc b/sql/sql_digest.cc index 4cfc7b05dcc6..3c0fca66280d 100644 --- a/sql/sql_digest.cc +++ b/sql/sql_digest.cc @@ -195,7 +195,7 @@ void compute_digest_text(const sql_digest_storage *digest_storage, /* Convert text to utf8 */ const CHARSET_INFO *from_cs = get_charset(digest_storage->m_charset_number, MYF(0)); - const CHARSET_INFO *to_cs = &my_charset_utf8_bin; + const CHARSET_INFO *to_cs = &my_charset_utf8mb3_bin; if (from_cs == nullptr) { /* diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 89a7e2b4b85c..dbf5568338af 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -213,16 +213,16 @@ static void copy_string(MEM_ROOT *mem_root, String *dst, const String *src) { } Sql_condition::Sql_condition(MEM_ROOT *mem_root) - : m_class_origin((const char *)nullptr, 0, &my_charset_utf8_bin), - m_subclass_origin((const char *)nullptr, 0, &my_charset_utf8_bin), - m_constraint_catalog((const char *)nullptr, 0, &my_charset_utf8_bin), - m_constraint_schema((const char *)nullptr, 0, &my_charset_utf8_bin), - m_constraint_name((const char *)nullptr, 0, &my_charset_utf8_bin), - m_catalog_name((const char *)nullptr, 0, &my_charset_utf8_bin), - m_schema_name((const char *)nullptr, 0, &my_charset_utf8_bin), - m_table_name((const char *)nullptr, 0, &my_charset_utf8_bin), - m_column_name((const char *)nullptr, 0, &my_charset_utf8_bin), - m_cursor_name((const char *)nullptr, 0, &my_charset_utf8_bin), + : m_class_origin((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_subclass_origin((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_constraint_catalog((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_constraint_schema((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_constraint_name((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_catalog_name((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_schema_name((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_table_name((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_column_name((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_cursor_name((const char *)nullptr, 0, &my_charset_utf8mb3_bin), m_message_text(), m_mysql_errno(0), m_severity_level(Sql_condition::SL_ERROR), @@ -235,16 +235,16 @@ Sql_condition::Sql_condition(MEM_ROOT *mem_root, uint mysql_errno, const char *returned_sqlstate, Sql_condition::enum_severity_level severity, const char *message_text) - : m_class_origin((const char *)nullptr, 0, &my_charset_utf8_bin), - m_subclass_origin((const char *)nullptr, 0, &my_charset_utf8_bin), - m_constraint_catalog((const char *)nullptr, 0, &my_charset_utf8_bin), - m_constraint_schema((const char *)nullptr, 0, &my_charset_utf8_bin), - m_constraint_name((const char *)nullptr, 0, &my_charset_utf8_bin), - m_catalog_name((const char *)nullptr, 0, &my_charset_utf8_bin), - m_schema_name((const char *)nullptr, 0, &my_charset_utf8_bin), - m_table_name((const char *)nullptr, 0, &my_charset_utf8_bin), - m_column_name((const char *)nullptr, 0, &my_charset_utf8_bin), - m_cursor_name((const char *)nullptr, 0, &my_charset_utf8_bin), + : m_class_origin((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_subclass_origin((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_constraint_catalog((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_constraint_schema((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_constraint_name((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_catalog_name((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_schema_name((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_table_name((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_column_name((const char *)nullptr, 0, &my_charset_utf8mb3_bin), + m_cursor_name((const char *)nullptr, 0, &my_charset_utf8mb3_bin), m_message_text(), m_mysql_errno(mysql_errno), m_severity_level(severity), @@ -984,7 +984,7 @@ static bool is_deprecated(const char *cs_name) { */ void warn_on_deprecated_charset(THD *thd, const CHARSET_INFO *cs, const char *alias, const char *option) { - if (cs == &my_charset_utf8_general_ci) { + if (cs == &my_charset_utf8mb3_general_ci) { if (native_strcasecmp(alias, "utf8") == 0) { if (option == nullptr) push_warning(thd, ER_DEPRECATED_UTF8_ALIAS); @@ -1015,7 +1015,7 @@ void warn_on_deprecated_charset(THD *thd, const CHARSET_INFO *cs, */ void warn_on_deprecated_collation(THD *thd, const CHARSET_INFO *collation, const char *option) { - if (my_charset_same(collation, &my_charset_utf8_general_ci)) { + if (my_charset_same(collation, &my_charset_utf8mb3_general_ci)) { if (option == nullptr) push_warning_printf(thd, Sql_condition::SL_WARNING, ER_WARN_DEPRECATED_UTF8MB3_COLLATION, diff --git a/sql/sql_get_diagnostics.cc b/sql/sql_get_diagnostics.cc index d3515f672269..9859d2491048 100644 --- a/sql/sql_get_diagnostics.cc +++ b/sql/sql_get_diagnostics.cc @@ -273,7 +273,7 @@ bool Condition_information::aggregate(THD *thd, const Diagnostics_area *da) { Item *Condition_information_item::make_utf8_string_item(THD *thd, const String *str) { /* Default is utf8mb3 character set and utf8mb3_general_ci collation. */ - const CHARSET_INFO *to_cs = &my_charset_utf8_general_ci; + const CHARSET_INFO *to_cs = &my_charset_utf8mb3_general_ci; /* If a charset was not set, assume that no conversion is needed. */ const CHARSET_INFO *from_cs = str->charset() ? str->charset() : to_cs; Item_string *item = new Item_string(str->ptr(), str->length(), from_cs); diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index d031d04b05ef..292921311e5d 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -285,7 +285,7 @@ void Lex_input_stream::body_utf8_start(THD *thd, const char *begin_ptr) { size_t body_utf8_length = (m_buf_length / thd->variables.character_set_client->mbminlen) * - my_charset_utf8_bin.mbmaxlen; + my_charset_utf8mb3_bin.mbmaxlen; m_body_utf8 = (char *)thd->alloc(body_utf8_length + 1); m_body_utf8_ptr = m_body_utf8; @@ -363,8 +363,8 @@ void Lex_input_stream::body_utf8_append_literal(THD *thd, const LEX_STRING *txt, LEX_STRING utf_txt; - if (!my_charset_same(txt_cs, &my_charset_utf8_general_ci)) { - thd->convert_string(&utf_txt, &my_charset_utf8_general_ci, txt->str, + if (!my_charset_same(txt_cs, &my_charset_utf8mb3_general_ci)) { + thd->convert_string(&utf_txt, &my_charset_utf8mb3_general_ci, txt->str, txt->length, txt_cs); } else { utf_txt.str = txt->str; diff --git a/sql/sql_signal.cc b/sql/sql_signal.cc index ae37125655f6..2f10da380406 100644 --- a/sql/sql_signal.cc +++ b/sql/sql_signal.cc @@ -206,7 +206,7 @@ static bool assign_fixed_string(MEM_ROOT *mem_root, CHARSET_INFO *dst_cs, static int assign_condition_item(MEM_ROOT *mem_root, const char *name, THD *thd, Item *set, String *ci) { char str_buff[(64 + 1) * 4]; /* Room for a null terminated UTF8 String 64 */ - String str_value(str_buff, sizeof(str_buff), &my_charset_utf8_bin); + String str_value(str_buff, sizeof(str_buff), &my_charset_utf8mb3_bin); String *str; bool truncated; @@ -218,7 +218,8 @@ static int assign_condition_item(MEM_ROOT *mem_root, const char *name, THD *thd, } str = set->val_str(&str_value); - truncated = assign_fixed_string(mem_root, &my_charset_utf8_bin, 64, ci, str); + truncated = + assign_fixed_string(mem_root, &my_charset_utf8mb3_bin, 64, ci, str); if (truncated) { if (thd->is_strict_mode()) { thd->raise_error_printf(ER_COND_ITEM_TOO_LONG, name); @@ -305,7 +306,7 @@ int Sql_cmd_common_signal::eval_signal_informations(THD *thd, bool truncated; String utf8_text; str = set->val_str(&str_value); - truncated = assign_fixed_string(thd->mem_root, &my_charset_utf8_bin, 128, + truncated = assign_fixed_string(thd->mem_root, &my_charset_utf8mb3_bin, 128, &utf8_text, str); if (truncated) { if (thd->is_strict_mode()) { diff --git a/sql/srv_session.cc b/sql/srv_session.cc index 41c27c12738f..d7bca57caf1b 100644 --- a/sql/srv_session.cc +++ b/sql/srv_session.cc @@ -812,7 +812,7 @@ bool Srv_session::open() { No store_globals() here as the session is always created in a detached state. Attachment with store_globals() will happen on demand. */ - if (thd_init_client_charset(&thd, my_charset_utf8_general_ci.number)) { + if (thd_init_client_charset(&thd, my_charset_utf8mb3_general_ci.number)) { connection_errors_internal++; if (err_protocol_ctx.handler) err_protocol_ctx.handler(err_protocol_ctx.handler_context, diff --git a/sql/string_service.cc b/sql/string_service.cc index 567354d003d1..bda44057ae64 100644 --- a/sql/string_service.cc +++ b/sql/string_service.cc @@ -53,7 +53,7 @@ int mysql_string_convert_to_char_ptr(mysql_string_handle string_handle, int *error) { String *str = (String *)string_handle; int len = - (int)my_convert(buffer, buffer_size - 1, &my_charset_utf8_general_ci, + (int)my_convert(buffer, buffer_size - 1, &my_charset_utf8mb3_general_ci, str->ptr(), str->length(), str->charset(), (uint *)error); buffer[len] = '\0'; return (len); diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 8a7a655220aa..89e3bdf652e8 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1866,7 +1866,7 @@ struct Get_csname { } // namespace -static CHARSET_INFO *charset_system_default = &my_charset_utf8_general_ci; +static CHARSET_INFO *charset_system_default = &my_charset_utf8mb3_general_ci; static Sys_var_struct Sys_character_set_system( "character_set_system", diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 78da8396c648..bd44290ce2a9 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -10898,7 +10898,7 @@ FT_INFO *ha_innobase::ft_init_ext(uint flags, /* in: */ if (strcmp(char_set->csname, "utf32") == 0 || strcmp(char_set->csname, "utf16") == 0) { buf_tmp_used = innobase_convert_string( - buf_tmp, sizeof(buf_tmp) - 1, &my_charset_utf8_general_ci, query, + buf_tmp, sizeof(buf_tmp) - 1, &my_charset_utf8mb3_general_ci, query, query_len, (CHARSET_INFO *)char_set, &num_errors); buf_tmp[buf_tmp_used] = 0; diff --git a/storage/perfschema/table_session_connect.cc b/storage/perfschema/table_session_connect.cc index 3b25eb1804b5..ff51da6ff7ab 100644 --- a/storage/perfschema/table_session_connect.cc +++ b/storage/perfschema/table_session_connect.cc @@ -153,7 +153,7 @@ static bool parse_length_encoded_string(const char **ptr, char *dest, this is still UTF8MB3 printed in a UTF8MB4 column. */ copy_length = well_formed_copy_nchars( - &my_charset_utf8_bin, dest, dest_size, from_cs, *ptr, data_length, + &my_charset_utf8mb3_bin, dest, dest_size, from_cs, *ptr, data_length, nchars_max, &well_formed_error_pos, &cannot_convert_error_pos, &from_end_pos); *copied_len = copy_length; diff --git a/storage/perfschema/unittest/pfs_connect_attr-t.cc b/storage/perfschema/unittest/pfs_connect_attr-t.cc index dbe31208faa0..fb5c5916d0d9 100644 --- a/storage/perfschema/unittest/pfs_connect_attr-t.cc +++ b/storage/perfschema/unittest/pfs_connect_attr-t.cc @@ -45,7 +45,7 @@ static void test_blob_parser() { unsigned char packet[10000], *ptr; uint name_len, value_len, idx, packet_length; bool result; - const CHARSET_INFO *cs = &my_charset_utf8_bin; + const CHARSET_INFO *cs = &my_charset_utf8mb3_bin; diag("test_blob_parser"); @@ -152,7 +152,7 @@ static void test_multibyte_lengths() { char name[100], value[4096]; uint name_len, value_len; bool result; - const CHARSET_INFO *cs = &my_charset_utf8_bin; + const CHARSET_INFO *cs = &my_charset_utf8mb3_bin; unsigned char var_len_packet[] = { 252, 2, 0, 'k', '1', 253, 2, 0, 0, 'v', '1', 254, 2, 0, 0, 0, 0, @@ -180,7 +180,7 @@ static void test_utf8_parser() { char name[33 * 6], value[1024 * 6], packet[1500 * 6], *ptr; uint name_len, value_len; bool result; - const CHARSET_INFO *cs = &my_charset_utf8_bin; + const CHARSET_INFO *cs = &my_charset_utf8mb3_bin; /* note : this is encoded in utf-8 */ const char *attr1 = "Георги"; @@ -230,7 +230,7 @@ static void test_utf8_parser_bad_encoding() { char name[33 * 3], value[1024 * 3], packet[1500 * 3], *ptr; uint name_len, value_len; bool result; - const CHARSET_INFO *cs = &my_charset_utf8_bin; + const CHARSET_INFO *cs = &my_charset_utf8mb3_bin; /* note : this is encoded in utf-8 */ const char *attr = "Георги"; diff --git a/strings/ctype-uca.cc b/strings/ctype-uca.cc index 9b00d2e5517e..5ffaada8b0d7 100644 --- a/strings/ctype-uca.cc +++ b/strings/ctype-uca.cc @@ -2675,7 +2675,7 @@ static my_coll_lexem_num my_coll_lexem_next(MY_COLL_LEXEM *lexem) { /* Escaped character, e.g. \u1234 */ if ((*beg == '\\') && (beg + 2 < lexem->end) && (beg[1] == 'u') && - my_isxdigit(&my_charset_utf8_general_ci, beg[2])) { + my_isxdigit(&my_charset_utf8mb3_general_ci, beg[2])) { int ch; beg += 2; @@ -2701,7 +2701,7 @@ static my_coll_lexem_num my_coll_lexem_next(MY_COLL_LEXEM *lexem) { if (((uchar)*beg) > 0x7F) /* Unescaped multibyte character */ { - CHARSET_INFO *cs = &my_charset_utf8_general_ci; + CHARSET_INFO *cs = &my_charset_utf8mb3_general_ci; my_wc_t wc; int nbytes = cs->cset->mb_wc(cs, &wc, pointer_cast(beg), pointer_cast(lexem->end)); @@ -4839,7 +4839,7 @@ static void my_coll_uninit_uca(CHARSET_INFO *cs) { extern "C" { static bool my_coll_init_uca(CHARSET_INFO *cs, MY_CHARSET_LOADER *loader) { cs->pad_char = ' '; - cs->ctype = my_charset_utf8_unicode_ci.ctype; + cs->ctype = my_charset_utf8mb3_unicode_ci.ctype; if (!cs->caseinfo) cs->caseinfo = &my_unicase_default; if (!cs->uca) cs->uca = &my_uca_v400; return create_tailoring(cs, loader); @@ -6077,12 +6077,12 @@ static const uchar ctype_utf8[] = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0}; -extern MY_CHARSET_HANDLER my_charset_utf8_handler; +extern MY_CHARSET_HANDLER my_charset_utf8mb3_handler; #define MY_CS_UTF8MB3_UCA_FLAGS \ (MY_CS_COMPILED | MY_CS_STRNXFRM | MY_CS_UNICODE) -CHARSET_INFO my_charset_utf8_unicode_ci = { +CHARSET_INFO my_charset_utf8mb3_unicode_ci = { 192, 0, 0, /* number */ @@ -6113,11 +6113,11 @@ CHARSET_INFO my_charset_utf8_unicode_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_icelandic_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_icelandic_uca_ci = { 193, 0, 0, /* number */ @@ -6148,11 +6148,11 @@ CHARSET_INFO my_charset_utf8_icelandic_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_latvian_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_latvian_uca_ci = { 194, 0, 0, /* number */ @@ -6183,11 +6183,11 @@ CHARSET_INFO my_charset_utf8_latvian_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_romanian_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_romanian_uca_ci = { 195, 0, 0, /* number */ @@ -6218,11 +6218,11 @@ CHARSET_INFO my_charset_utf8_romanian_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_slovenian_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_slovenian_uca_ci = { 196, 0, 0, /* number */ @@ -6253,11 +6253,11 @@ CHARSET_INFO my_charset_utf8_slovenian_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_polish_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_polish_uca_ci = { 197, 0, 0, /* number */ @@ -6288,11 +6288,11 @@ CHARSET_INFO my_charset_utf8_polish_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_estonian_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_estonian_uca_ci = { 198, 0, 0, /* number */ @@ -6323,11 +6323,11 @@ CHARSET_INFO my_charset_utf8_estonian_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_spanish_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_spanish_uca_ci = { 199, 0, 0, /* number */ @@ -6358,11 +6358,11 @@ CHARSET_INFO my_charset_utf8_spanish_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_swedish_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_swedish_uca_ci = { 200, 0, 0, /* number */ @@ -6393,11 +6393,11 @@ CHARSET_INFO my_charset_utf8_swedish_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_turkish_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_turkish_uca_ci = { 201, 0, 0, /* number */ @@ -6428,11 +6428,11 @@ CHARSET_INFO my_charset_utf8_turkish_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_czech_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_czech_uca_ci = { 202, 0, 0, /* number */ @@ -6463,11 +6463,11 @@ CHARSET_INFO my_charset_utf8_czech_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_danish_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_danish_uca_ci = { 203, 0, 0, /* number */ @@ -6498,11 +6498,11 @@ CHARSET_INFO my_charset_utf8_danish_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_lithuanian_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_lithuanian_uca_ci = { 204, 0, 0, /* number */ @@ -6533,11 +6533,11 @@ CHARSET_INFO my_charset_utf8_lithuanian_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_slovak_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_slovak_uca_ci = { 205, 0, 0, /* number */ @@ -6568,11 +6568,11 @@ CHARSET_INFO my_charset_utf8_slovak_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_spanish2_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_spanish2_uca_ci = { 206, 0, 0, /* number */ @@ -6603,11 +6603,11 @@ CHARSET_INFO my_charset_utf8_spanish2_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_roman_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_roman_uca_ci = { 207, 0, 0, /* number */ @@ -6638,11 +6638,11 @@ CHARSET_INFO my_charset_utf8_roman_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_persian_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_persian_uca_ci = { 208, 0, 0, /* number */ @@ -6673,11 +6673,11 @@ CHARSET_INFO my_charset_utf8_persian_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_esperanto_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_esperanto_uca_ci = { 209, 0, 0, /* number */ @@ -6708,11 +6708,11 @@ CHARSET_INFO my_charset_utf8_esperanto_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_hungarian_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_hungarian_uca_ci = { 210, 0, 0, /* number */ @@ -6743,11 +6743,11 @@ CHARSET_INFO my_charset_utf8_hungarian_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_sinhala_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_sinhala_uca_ci = { 211, 0, 0, /* number */ @@ -6778,11 +6778,11 @@ CHARSET_INFO my_charset_utf8_sinhala_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_german2_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_german2_uca_ci = { 212, 0, 0, /* number */ @@ -6813,11 +6813,11 @@ CHARSET_INFO my_charset_utf8_german2_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_croatian_uca_ci = { +CHARSET_INFO my_charset_utf8mb3_croatian_uca_ci = { 213, 0, 0, /* number */ @@ -6848,11 +6848,11 @@ CHARSET_INFO my_charset_utf8_croatian_uca_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_unicode_520_ci = { +CHARSET_INFO my_charset_utf8mb3_unicode_520_ci = { 214, 0, 0, /* number */ @@ -6883,11 +6883,11 @@ CHARSET_INFO my_charset_utf8_unicode_520_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_vietnamese_ci = { +CHARSET_INFO my_charset_utf8mb3_vietnamese_ci = { 215, 0, 0, /* number */ @@ -6918,7 +6918,7 @@ CHARSET_INFO my_charset_utf8_vietnamese_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_any_uca_handler, PAD_SPACE}; diff --git a/strings/ctype-utf8.cc b/strings/ctype-utf8.cc index 0d3de6703845..21f53dbf04a2 100644 --- a/strings/ctype-utf8.cc +++ b/strings/ctype-utf8.cc @@ -5750,35 +5750,35 @@ static MY_COLLATION_HANDLER my_collation_utf8mb3_bin_handler = { my_hash_sort_mb_bin, my_propagate_simple}; -MY_CHARSET_HANDLER my_charset_utf8_handler = {nullptr, /* init */ - my_ismbchar_utf8mb3, - my_mbcharlen_utf8mb3, - my_numchars_mb, - my_charpos_mb3, - my_well_formed_len_utf8mb3, - my_lengthsp_8bit, - my_numcells_mb, - my_mb_wc_utf8mb3_thunk, - my_uni_utf8mb3, - my_mb_ctype_mb, - my_caseup_str_utf8mb3, - my_casedn_str_utf8mb3, - my_caseup_utf8mb3, - my_casedn_utf8mb3, - my_snprintf_8bit, - my_long10_to_str_8bit, - my_longlong10_to_str_8bit, - my_fill_8bit, - my_strntol_8bit, - my_strntoul_8bit, - my_strntoll_8bit, - my_strntoull_8bit, - my_strntod_8bit, - my_strtoll10_8bit, - my_strntoull10rnd_8bit, - my_scan_8bit}; - -CHARSET_INFO my_charset_utf8_general_ci = { +MY_CHARSET_HANDLER my_charset_utf8mb3_handler = {nullptr, /* init */ + my_ismbchar_utf8mb3, + my_mbcharlen_utf8mb3, + my_numchars_mb, + my_charpos_mb3, + my_well_formed_len_utf8mb3, + my_lengthsp_8bit, + my_numcells_mb, + my_mb_wc_utf8mb3_thunk, + my_uni_utf8mb3, + my_mb_ctype_mb, + my_caseup_str_utf8mb3, + my_casedn_str_utf8mb3, + my_caseup_utf8mb3, + my_casedn_utf8mb3, + my_snprintf_8bit, + my_long10_to_str_8bit, + my_longlong10_to_str_8bit, + my_fill_8bit, + my_strntol_8bit, + my_strntoul_8bit, + my_strntoll_8bit, + my_strntoull_8bit, + my_strntod_8bit, + my_strtoll10_8bit, + my_strntoull10rnd_8bit, + my_scan_8bit}; + +CHARSET_INFO my_charset_utf8mb3_general_ci = { 33, 0, 0, /* number */ @@ -5809,11 +5809,11 @@ CHARSET_INFO my_charset_utf8_general_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_utf8mb3_general_ci_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_tolower_ci = { +CHARSET_INFO my_charset_utf8mb3_tolower_ci = { 76, 0, 0, /* number */ @@ -5844,11 +5844,11 @@ CHARSET_INFO my_charset_utf8_tolower_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_utf8mb3_general_ci_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_general_mysql500_ci = { +CHARSET_INFO my_charset_utf8mb3_general_mysql500_ci = { 223, 0, 0, /* number */ @@ -5879,11 +5879,11 @@ CHARSET_INFO my_charset_utf8_general_mysql500_ci = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_utf8mb3_general_ci_handler, PAD_SPACE}; -CHARSET_INFO my_charset_utf8_bin = { +CHARSET_INFO my_charset_utf8mb3_bin = { 83, 0, 0, /* number */ @@ -5914,7 +5914,7 @@ CHARSET_INFO my_charset_utf8_bin = { ' ', /* pad char */ false, /* escape_with_backslash_is_dangerous */ 1, /* levels_for_compare */ - &my_charset_utf8_handler, + &my_charset_utf8mb3_handler, &my_collation_utf8mb3_bin_handler, PAD_SPACE}; diff --git a/strings/ctype.cc b/strings/ctype.cc index 9302261f0061..5786b0aaec98 100644 --- a/strings/ctype.cc +++ b/strings/ctype.cc @@ -390,7 +390,7 @@ static int tailoring_append2(MY_XML_PARSER *st, const char *fmt, size_t len1, } static size_t scan_one_character(const char *s, const char *e, my_wc_t *wc) { - CHARSET_INFO *cs = &my_charset_utf8_general_ci; + CHARSET_INFO *cs = &my_charset_utf8mb3_general_ci; if (s >= e) return 0; /* Escape sequence: \uXXXX */ diff --git a/unittest/gunit/explain_filename-t.cc b/unittest/gunit/explain_filename-t.cc index 9b2c7dbc6af3..1e6d9f4d659e 100644 --- a/unittest/gunit/explain_filename-t.cc +++ b/unittest/gunit/explain_filename-t.cc @@ -47,7 +47,7 @@ class PartitionTest : public ::testing::Test { m_charset = system_charset_info; m_locale = my_default_lc_messages; - system_charset_info = &my_charset_utf8_bin; + system_charset_info = &my_charset_utf8mb3_bin; my_default_lc_messages = &my_locale_en_US; /* Populate the necessary error messages */ diff --git a/unittest/gunit/item-t.cc b/unittest/gunit/item-t.cc index 4d924149d826..034927f8281d 100644 --- a/unittest/gunit/item-t.cc +++ b/unittest/gunit/item-t.cc @@ -277,7 +277,7 @@ TEST_F(ItemTest, ItemString) { EXPECT_EQ(MYSQL_TYPE_STRING, field_string.type()); // CHAR field for testing strings with illegal values - Mock_field_string field_string_utf8(20, &my_charset_utf8_general_ci); + Mock_field_string field_string_utf8(20, &my_charset_utf8mb3_general_ci); EXPECT_EQ(MYSQL_TYPE_STRING, field_string_utf8.type()); /* @@ -324,7 +324,7 @@ TEST_F(ItemTest, ItemString) { // VARCHAR field for testing strings with illegal values Mock_field_varstring field_varstring_utf8(20, &table_share, - &my_charset_utf8_general_ci); + &my_charset_utf8mb3_general_ci); EXPECT_EQ(MYSQL_TYPE_VARCHAR, field_varstring_utf8.type()); /* diff --git a/unittest/gunit/mdl-t.cc b/unittest/gunit/mdl-t.cc index 20bda743c992..1eda25223fc6 100644 --- a/unittest/gunit/mdl-t.cc +++ b/unittest/gunit/mdl-t.cc @@ -124,7 +124,7 @@ class MDLTest : public ::testing::Test, public Test_MDL_context_owner { m_mdl_context.init(this); EXPECT_FALSE(m_mdl_context.has_locks()); m_charset = system_charset_info; - system_charset_info = &my_charset_utf8_bin; + system_charset_info = &my_charset_utf8mb3_bin; EXPECT_TRUE(system_charset_info != nullptr); MDL_REQUEST_INIT(&m_global_request, MDL_key::GLOBAL, "", "", @@ -4693,7 +4693,7 @@ static void lock_bench(MDL_context &ctx, const Name_vec &names) { */ static void BM_FindTicket(size_t num_iterations) { StopBenchmarkTiming(); - system_charset_info = &my_charset_utf8_bin; + system_charset_info = &my_charset_utf8mb3_bin; mdl_init(); MDL_context ctx; Mock_MDL_context_owner owner; diff --git a/unittest/gunit/opt_costconstants-t.cc b/unittest/gunit/opt_costconstants-t.cc index ad3da67239ca..89755763682d 100644 --- a/unittest/gunit/opt_costconstants-t.cc +++ b/unittest/gunit/opt_costconstants-t.cc @@ -140,7 +140,8 @@ class TapeEngine_cost_constants : public Testable_SE_cost_constants { cost_constant_error set(const LEX_CSTRING &name, const double value, bool default_value) { // Process TAPE_IO_COST here - if (!my_strcasecmp(&my_charset_utf8_general_ci, "TAPE_IO_COST", name.str)) { + if (!my_strcasecmp(&my_charset_utf8mb3_general_ci, "TAPE_IO_COST", + name.str)) { update_cost_value(&m_tape_io_cost, &m_tape_io_cost_default, value, default_value); return COST_CONSTANT_OK; @@ -189,10 +190,10 @@ class Testable_Cost_model_constants : public Cost_model_constants { */ uint find_handler_slot_from_name(THD *, const LEX_CSTRING &name) const { - if (my_strcasecmp(&my_charset_utf8_general_ci, "Karius", name.str) == 0) + if (my_strcasecmp(&my_charset_utf8mb3_general_ci, "Karius", name.str) == 0) return 4; - if (my_strcasecmp(&my_charset_utf8_general_ci, "Baktus", name.str) == 0) + if (my_strcasecmp(&my_charset_utf8mb3_general_ci, "Baktus", name.str) == 0) return 7; // There is no handler for a storage engine with the given name diff --git a/unittest/gunit/strings_utf8-t.cc b/unittest/gunit/strings_utf8-t.cc index 6bf7440e60f9..4047f0eb9909 100644 --- a/unittest/gunit/strings_utf8-t.cc +++ b/unittest/gunit/strings_utf8-t.cc @@ -40,7 +40,7 @@ class StringsUTF8Test : public ::testing::Test { // Save global settings. m_charset = system_charset_info; - system_charset_info = &my_charset_utf8_bin; + system_charset_info = &my_charset_utf8mb3_bin; } void TearDown() override { diff --git a/unittest/gunit/test_utils.cc b/unittest/gunit/test_utils.cc index 097fdb029d3c..b8e59d04d78f 100644 --- a/unittest/gunit/test_utils.cc +++ b/unittest/gunit/test_utils.cc @@ -91,7 +91,7 @@ void setup_server_for_unit_tests() { const_cast("--lc-messages-dir=" ERRMSG_DIR), nullptr}; set_remaining_args(6, argv); - system_charset_info = &my_charset_utf8_general_ci; + system_charset_info = &my_charset_utf8mb3_general_ci; mysql_mutex_init(PSI_NOT_INSTRUMENTED, &LOCK_plugin, MY_MUTEX_INIT_FAST); sys_var_init();