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-common/client.c | |
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-common/client.c')
-rw-r--r-- | sql-common/client.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql-common/client.c b/sql-common/client.c index 22ebd6dae00..34e8f7f755e 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1747,12 +1747,14 @@ mysql_set_character_set_with_default_collation(MYSQL *mysql) charsets_dir=mysql->options.charset_dir; if ((mysql->charset= get_charset_by_csname(mysql->options.charset_name, - MY_CS_PRIMARY, MYF(MY_WME)))) + MY_CS_PRIMARY, MYF(MY_WME| + MY_UTF8_IS_UTF8MB3)))) { /* Try to set compiled default collation when it's possible. */ CHARSET_INFO *collation; if ((collation= - get_charset_by_name(MYSQL_DEFAULT_COLLATION_NAME, MYF(MY_WME))) && + get_charset_by_name(MYSQL_DEFAULT_COLLATION_NAME, MYF(MY_UTF8_IS_UTF8MB3 | + MY_WME))) && my_charset_same(mysql->charset, collation)) { mysql->charset= collation; @@ -4095,7 +4097,7 @@ int STDCALL mysql_set_character_set(MYSQL *mysql, const char *cs_name) charsets_dir= mysql->options.charset_dir; if (strlen(cs_name) < MY_CS_NAME_SIZE && - (cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0)))) + (cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(MY_UTF8_IS_UTF8MB3)))) { char buff[MY_CS_NAME_SIZE + 10]; charsets_dir= save_csdir; |