summaryrefslogtreecommitdiff
path: root/sql/sql_db.cc
diff options
context:
space:
mode:
authorRucha Deodhar <rucha.deodhar@mariadb.com>2021-02-15 01:39:37 +0530
committerRucha Deodhar <rucha.deodhar@mariadb.com>2021-04-20 12:50:32 +0530
commite7762b3a725d0608f63a4c9bfb4e1db87cf20fe7 (patch)
tree3e3aed3cd181ea2ed30903d47a99e7cf8d3a8dd0 /sql/sql_db.cc
parentbfedf1eb4b63235e7dd88f36305758f52f28f27d (diff)
downloadmariadb-git-bb-10.6-MDEV-8334.tar.gz
MDEV-8334: Rename utf8 to utf8mb3bb-10.6-MDEV-8334
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_db.cc')
-rw-r--r--sql/sql_db.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index d4fd66e233d..be90ee88a50 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -547,6 +547,7 @@ bool load_db_opt(THD *thd, const char *path, Schema_specification_st *create)
DBUG_ENTER("load_db_opt");
bool error=1;
size_t nbytes;
+ myf utf8_flag= thd->get_utf8_flag();
bzero((char*) create,sizeof(*create));
create->default_table_charset= thd->variables.collation_server;
@@ -583,9 +584,9 @@ bool load_db_opt(THD *thd, const char *path, Schema_specification_st *create)
default-collation commands.
*/
if (!(create->default_table_charset=
- get_charset_by_csname(pos+1, MY_CS_PRIMARY, MYF(0))) &&
+ get_charset_by_csname(pos+1, MY_CS_PRIMARY, MYF(utf8_flag))) &&
!(create->default_table_charset=
- get_charset_by_name(pos+1, MYF(0))))
+ get_charset_by_name(pos+1, MYF(utf8_flag))))
{
sql_print_error("Error while loading database options: '%s':",path);
sql_print_error(ER_THD(thd, ER_UNKNOWN_CHARACTER_SET),pos+1);
@@ -594,8 +595,7 @@ bool load_db_opt(THD *thd, const char *path, Schema_specification_st *create)
}
else if (!strncmp(buf,"default-collation", (pos-buf)))
{
- if (!(create->default_table_charset= get_charset_by_name(pos+1,
- MYF(0))))
+ if (!(create->default_table_charset= get_charset_by_name(pos+1, MYF(utf8_flag))))
{
sql_print_error("Error while loading database options: '%s':",path);
sql_print_error(ER_THD(thd, ER_UNKNOWN_COLLATION),pos+1);