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

@ -0,0 +1,19 @@
DROP DATABASE IF EXISTS MCOL5744;
CREATE DATABASE MCOL5744;
SET old_mode='';
CREATE TABLE t(x text CHARACTER SET utf8 COLLATE utf8_general_ci) ENGINE=COLUMNSTORE;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`x` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
DROP TABLE t;
SET old_mode='UTF8_IS_UTF8MB3';
CREATE TABLE t(x text CHARACTER SET utf8 COLLATE utf8_general_ci) ENGINE=COLUMNSTORE;
SHOW CREATE TABLE t;
Table Create Table
t CREATE TABLE `t` (
`x` text DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
DROP TABLE t;
DROP DATABASE MCOL5744;

View File

@ -0,0 +1,19 @@
--disable_warnings
DROP DATABASE IF EXISTS MCOL5744;
--enable_warnings
CREATE DATABASE MCOL5744;
SET old_mode='';
CREATE TABLE t(x text CHARACTER SET utf8 COLLATE utf8_general_ci) ENGINE=COLUMNSTORE;
SHOW CREATE TABLE t;
DROP TABLE t;
SET old_mode='UTF8_IS_UTF8MB3';
CREATE TABLE t(x text CHARACTER SET utf8 COLLATE utf8_general_ci) ENGINE=COLUMNSTORE;
SHOW CREATE TABLE t;
DROP TABLE t;
DROP DATABASE MCOL5744;