1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +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 Leonid Fedorov
parent 3d2b329a2f
commit ef451af860
7 changed files with 58 additions and 13 deletions

View File

@ -765,7 +765,7 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& /*ta
parser.setDefaultSchema(schema);
parser.setDefaultCharset(default_table_charset);
int rc = 0;
parser.Parse(ddlStatement.c_str());
parser.Parse(ddlStatement.c_str(), thd->get_utf8_flag());
if (get_fe_conn_info_ptr() == NULL)
{

View File

@ -52,6 +52,7 @@ ST_FIELD_INFO is_columnstore_columns_fields[] = {
Show::Column("NUMERIC_SCALE", Show::ULong(0), NOT_NULL),
Show::Column("IS_AUTOINCREMENT", Show::STiny(0), NOT_NULL),
Show::Column("COMPRESSION_TYPE", Show::Varchar(64), NOT_NULL),
Show::Column("CHARSET", Show::ULong(4), NOT_NULL),
Show::CEnd()};
static int is_columnstore_columns_fill(THD* thd, TABLE_LIST* tables, COND* cond)
@ -183,6 +184,8 @@ static int is_columnstore_columns_fill(THD* thd, TABLE_LIST* tables, COND* cond)
table->field[15]->store(compression_type.c_str(), compression_type.length(), cs);
table->field[16]->store(ct.charsetNumber);
if (schema_table_store_record(thd, table))
return 1;
}