1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

feat(ddl): MCOL-5744: better handling of utf8 charset aliases (#3174)

Server expands ut8_XXX aliases to utf8mb3_XXX or utf8mb4_XXX depending
on the UTF8_IS_UTF8MB3 setting in the OLD_MODE environment variable.

Server already has the necessary code implemented in the get_utf8_flag()
method of class THD. There are several uses of this flag and all we have
to do to be in line with server is to use it.

This patch does that for DDL as work on MCOL-5705 uncovered some
problems in that area.
This commit is contained in:
Sergey Zefirov
2024-05-10 19:17:57 +03:00
committed by GitHub
parent 8204c131bf
commit 5b9ddd902e
7 changed files with 62 additions and 13 deletions

View File

@ -60,8 +60,9 @@ void SqlParser::setDefaultCharset(const CHARSET_INFO* default_charset)
x.default_table_charset = default_charset;
}
int SqlParser::Parse(const char* sqltext)
int SqlParser::Parse(const char* sqltext, myf utf8_flag)
{
x.utf8_flag = utf8_flag;
ddllex_init_extra(&scanData, &x.scanner);
scanner_init(sqltext, x.scanner);
fStatus = ddlparse(&x);
@ -129,6 +130,6 @@ int SqlFileParser::Parse(const string& sqlfile)
// cout << "----------------------" << endl;
// cout << sqlbuf << endl;
return SqlParser::Parse(sqlbuf);
return SqlParser::Parse(sqlbuf, MYF(0));
}
} // namespace ddlpackage