diff options
author | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2021-02-15 01:39:37 +0530 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2021-05-19 06:48:36 +0200 |
commit | 2fdb556e045e9918410086eeaac5a94a4c028626 (patch) | |
tree | 1420013b4e76b3192cb8ac33406c818d3ecfc3af /sql/sql_class.h | |
parent | c366845a0b5c08285c958cf1500b3b7906ecf8d4 (diff) | |
download | mariadb-git-2fdb556e045e9918410086eeaac5a94a4c028626.tar.gz |
MDEV-8334: Rename utf8 to utf8mb3
This patch changes the main name of 3 byte character set from utf8 to
utf8mb3. New old_mode UTF8_IS_UTF8MB3 is added and set TRUE by default,
so that utf8 would mean utf8mb3. If not set, utf8 would mean utf8mb4.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r-- | sql/sql_class.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index bbadaad1dcc..fc65bdcab3e 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -189,6 +189,7 @@ enum enum_binlog_row_image { #define OLD_MODE_NO_DUP_KEY_WARNINGS_WITH_IGNORE (1 << 0) #define OLD_MODE_NO_PROGRESS_INFO (1 << 1) #define OLD_MODE_ZERO_DATE_TIME_CAST (1 << 2) +#define OLD_MODE_UTF8_IS_UTF8MB3 (1 << 3) extern char internal_table_name[2]; extern char empty_c_string[1]; @@ -1054,13 +1055,14 @@ static inline void update_global_memory_status(int64 size) @retval Pointter to CHARSET_INFO with the given name on success */ static inline CHARSET_INFO * -mysqld_collation_get_by_name(const char *name, +mysqld_collation_get_by_name(const char *name, myf utf8_flag, CHARSET_INFO *name_cs= system_charset_info) { CHARSET_INFO *cs; MY_CHARSET_LOADER loader; my_charset_loader_init_mysys(&loader); - if (!(cs= my_collation_get_by_name(&loader, name, MYF(0)))) + + if (!(cs= my_collation_get_by_name(&loader, name, MYF(utf8_flag)))) { ErrConvString err(name, name_cs); my_error(ER_UNKNOWN_COLLATION, MYF(0), err.ptr()); @@ -5437,6 +5439,11 @@ public: Item *sp_prepare_func_item(Item **it_addr, uint cols= 1); bool sp_eval_expr(Field *result_field, Item **expr_item_ptr); + myf get_utf8_flag() + { + return (variables.old_behavior & OLD_MODE_UTF8_IS_UTF8MB3 ? + MY_UTF8_IS_UTF8MB3 : 0); + } }; |