Commit 903b5d6a authored by Alexander Barkov's avatar Alexander Barkov

MDEV-25829 Change default Unicode collation to uca1400_ai_ci

Step#3 The main patch
parent a3117c79
......@@ -3,6 +3,11 @@
# this collation before including this file
#
--echo #
--echo # Bug#31081 server crash in regexp function
--echo #
--disable_warnings
drop table if exists t1;
--enable_warnings
......
#
# Bug #3928 regexp [[:>:]] and UTF-8
#
--echo #
--echo # Bug #3928 regexp [[:>:]] and UTF-8
--echo #
SELECT @@character_set_client, @@collation_connection;
# This should return TRUE
--echo # This should return TRUE
select 'вася' rlike '\\bвася\\b';
select 'вася ' rlike '\\bвася\\b';
select ' вася' rlike '\\bвася\\b';
......@@ -14,7 +14,7 @@ select 'вася ' rlike '[[:<:]]вася[[:>:]]';
select ' вася' rlike '[[:<:]]вася[[:>:]]';
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
# This should return FALSE
--echo # This should return FALSE
select 'васяz' rlike '\\bвася\\b';
select 'zвася' rlike '\\bвася\\b';
select 'zвасяz' rlike '\\bвася\\b';
......
#
# Various tests with blank and control characters
#
# Tests covering a change in mysql-5.5.37:
#
# commit 63e1d22f8f46966c13d88a4f2e9acd7fa3e9c9b6
# Date: Fri Mar 26 18:14:39 2004 +0400
#
# UTF8 now process space as PAD character correctly.
--disable_service_connection
SELECT COLLATION('a');
SELECT 'a' = 'a ' AS c;
SELECT 'a\0' = 'a' AS c;
SELECT 'a\0' = 'a ' AS c;
SELECT 'a\t' = 'a' AS c;
SELECT 'a\t' = 'a ' AS c;
SELECT 'a' < 'a ' AS c;
SELECT 'a\0' < 'a' AS c;
SELECT 'a\0' < 'a ' AS c;
SELECT 'a\t' < 'a' AS c;
SELECT 'a\t' < 'a ' AS c;
SELECT 'a' > 'a ' AS c;
SELECT 'a\0' > 'a' AS c;
SELECT 'a\0' > 'a ' AS c;
SELECT 'a\t' > 'a' AS c;
SELECT 'a\t' > 'a ' AS c;
--enable_service_connection
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS a LIMIT 0;
#
# Add a column `a_readable` returning a readable form of 'a'
# Some special characters get replaces to dots:
# - 0x00 - to make "diff" handle the output as text rather than binary
# - 0x09 - to the the output have a more predictable visible width
#
# It's important for `a_readable` to have exactly
# the same character set with `a`, to avoid data loss on conversion.
# Let's also create it with the same collation with `a`, just in case.
EXECUTE IMMEDIATE
REPLACE(REPLACE(
"ALTER TABLE t1 ADD a_readable "
"TEXT CHARACTER SET latin1 COLLATE DEFAULT "
"GENERATED ALWAYS AS "
"(RPAD(QUOTE(REGEXP_REPLACE(t1.a, '(\\\\x{00}|\\\\x{09})', '.')), 10))",
'DEFAULT', collation('a')),
'latin1', charset('a'));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES ('a'),('a\0'),('a\t'),('a ');
SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
SELECT HEX(a), a_readable FROM t1 ORDER BY a, BINARY a;
SELECT
HEX(t1.a) AS t1a,
CASE STRCMP(t1.a, t2.a) WHEN -1 THEN '<' WHEN 1 THEN '>' ELSE '=' END AS cmp,
HEX(t2.a) AS t2a,
t1.a_readable,
t2.a_readable
FROM t1 t1, t1 t2
ORDER BY BINARY t1.a, BINARY t2.a;
DROP TABLE t1;
......@@ -9,11 +9,13 @@ SELECT
FROM
seq_65536_to_1114111', @@character_set_connection, @@collation_connection);
--disable_service_connection
SELECT COLLATION(c) FROM v_supplementary LIMIT 1;
SELECT
SUM(HEX(WEIGHT_STRING(c))<>'FFFD'),
SUM(HEX(WEIGHT_STRING(c))='FFFD')
FROM v_supplementary;
--enable_service_connection
DROP VIEW v_supplementary;
......@@ -58,11 +58,11 @@ select CONVERT(_koi8r'
# "a\0" < "a"
# "a\0" < "a "
SELECT 'a' = 'a ';
SELECT 'a\0' < 'a';
SELECT 'a\0' < 'a ';
SELECT 'a\t' < 'a';
SELECT 'a\t' < 'a ';
SELECT 'a' = 'a ' collate utf8mb4_general_ci;
SELECT 'a\0' < 'a' collate utf8mb4_general_ci;
SELECT 'a\0' < 'a ' collate utf8mb4_general_ci;
SELECT 'a\t' < 'a' collate utf8mb4_general_ci;
SELECT 'a\t' < 'a ' collate utf8mb4_general_ci;
#
# The same for binary collation
......@@ -73,7 +73,7 @@ SELECT 'a\0' < 'a ' collate utf8mb4_bin;
SELECT 'a\t' < 'a' collate utf8mb4_bin;
SELECT 'a\t' < 'a ' collate utf8mb4_bin;
eval CREATE TABLE t1 (a char(10) character set utf8mb4 not null) ENGINE $engine;
eval CREATE TABLE t1 (a char(10) character set utf8mb4 collate utf8mb4_general_ci not null) ENGINE $engine;
INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
--sorted_result
SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
......@@ -988,7 +988,7 @@ DROP TABLE t1;
#
# Bug#17313: N'xxx' and _utf8mb4'xxx' are not equivalent
#
eval CREATE TABLE t1 (item varchar(255)) default character set utf8mb4 ENGINE $engine;
eval CREATE TABLE t1 (item varchar(255)) default character set utf8mb4 collate utf8mb4_general_ci ENGINE $engine;
INSERT INTO t1 VALUES (N'\\');
INSERT INTO t1 VALUES (_utf8mb4'\\');
INSERT INTO t1 VALUES (N'Cote d\'Ivoire');
......@@ -1256,12 +1256,12 @@ SHOW VARIABLES LIKE 'character\_set\_%';
SET @@character_set_server=@save_character_set_server;
CREATE DATABASE crashtest DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
USE crashtest;
eval CREATE TABLE crashtest (crash char(10)) DEFAULT CHARSET=utf8mb4 ENGINE $engine;
eval CREATE TABLE crashtest (crash char(10)) DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci ENGINE $engine;
INSERT INTO crashtest VALUES ('35'), ('36'), ('37');
SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4) COLLATE utf8mb4_general_ci;
INSERT INTO crashtest VALUES ('-1000');
EXPLAIN SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
EXPLAIN SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4) COLLATE utf8mb4_general_ci;
SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4) COLLATE utf8mb4_general_ci;
DROP TABLE crashtest;
DROP DATABASE crashtest;
USE test;
......@@ -1557,7 +1557,7 @@ DROP TABLE IF EXISTS t1;
eval CREATE TABLE t1 (
predicted_order int NOT NULL,
utf8mb4_encoding VARCHAR(10) NOT NULL
) CHARACTER SET utf8mb4 ENGINE $engine;
) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ENGINE $engine;
INSERT INTO t1 VALUES (19, x'E0B696'), (30, x'E0B69AE0B798'), (61, x'E0B6AF'), (93, x'E0B799'), (52, x'E0B6A6'), (73, x'E0B6BBE0B78AE2808D'), (3, x'E0B686'), (56, x'E0B6AA'), (55, x'E0B6A9'), (70, x'E0B6B9'), (94, x'E0B79A'), (80, x'E0B785'), (25, x'E0B69AE0B791'), (48, x'E0B6A2'), (13, x'E0B690'), (86, x'E0B793'), (91, x'E0B79F'), (81, x'E0B786'), (79, x'E0B784'), (14, x'E0B691'), (99, x'E0B78A'), (8, x'E0B68B'), (68, x'E0B6B7'), (22, x'E0B69A'), (16, x'E0B693'), (33, x'E0B69AE0B7B3'), (38, x'E0B69AE0B79D'), (21, x'E0B683'), (11, x'E0B68E'), (77, x'E0B782'), (40, x'E0B69AE0B78A'), (101, x'E0B78AE2808DE0B6BB'), (35, x'E0B69AE0B79A'), (1, x'E0B7B4'), (9, x'E0B68C'), (96, x'E0B79C'), (6, x'E0B689'), (95, x'E0B79B'), (88, x'E0B796'), (64, x'E0B6B3'), (26, x'E0B69AE0B792'), (82, x'E0B78F'), (28, x'E0B69AE0B794'), (39, x'E0B69AE0B79E'), (97, x'E0B79D'), (2, x'E0B685'), (75, x'E0B780'), (34, x'E0B69AE0B799'), (69, x'E0B6B8'), (83, x'E0B790'), (18, x'E0B695'), (90, x'E0B7B2'), (17, x'E0B694'), (72, x'E0B6BB'), (66, x'E0B6B5'), (59, x'E0B6AD'), (44, x'E0B69E'), (15, x'E0B692'), (23, x'E0B69AE0B78F'), (65, x'E0B6B4'), (42, x'E0B69C'), (63, x'E0B6B1'), (85, x'E0B792'), (47, x'E0B6A1'), (49, x'E0B6A3'), (92, x'E0B7B3'), (78, x'E0B783'), (36, x'E0B69AE0B79B'), (4, x'E0B687'), (24, x'E0B69AE0B790'), (87, x'E0B794'), (37, x'E0B69AE0B79C'), (32, x'E0B69AE0B79F'), (29, x'E0B69AE0B796'), (43, x'E0B69D'), (62, x'E0B6B0'), (100, x'E0B78AE2808DE0B6BA'), (60, x'E0B6AE'), (45, x'E0B69F'), (12, x'E0B68F'), (46, x'E0B6A0'), (50, x'E0B6A5'), (51, x'E0B6A4'), (5, x'E0B688'), (76, x'E0B781'), (89, x'E0B798'), (74, x'E0B6BD'), (10, x'E0B68D'), (57, x'E0B6AB'), (71, x'E0B6BA'), (58, x'E0B6AC'), (27, x'E0B69AE0B793'), (54, x'E0B6A8'), (84, x'E0B791'), (31, x'E0B69AE0B7B2'), (98, x'E0B79E'), (53, x'E0B6A7'), (41, x'E0B69B'), (67, x'E0B6B6'), (7, x'E0B68A'), (20, x'E0B682');
SELECT predicted_order, hex(utf8mb4_encoding) FROM t1 ORDER BY utf8mb4_encoding COLLATE utf8mb4_sinhala_ci;
DROP TABLE t1;
......@@ -1642,7 +1642,7 @@ DROP TABLE IF EXISTS t1;
eval CREATE TABLE t1 (
u_decimal int NOT NULL,
utf8mb4_encoding VARCHAR(10) NOT NULL
) CHARACTER SET utf8mb4 ENGINE $engine;
) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ENGINE $engine;
# Source of the following values: http://www.fileformat.info/info/unicode/block/index.htm
# SINGLE BARLINE
INSERT INTO t1 VALUES (119040, x'f09d8480'),
......@@ -1683,7 +1683,7 @@ DROP TABLE IF EXISTS t2;
eval CREATE TABLE t2 (
u_decimal int NOT NULL,
utf8mb3_encoding VARCHAR(10) NOT NULL
) CHARACTER SET utf8mb3 ENGINE $engine;
) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci ENGINE $engine;
# LATIN CAPITAL LETTER VEND
INSERT INTO t2 VALUES (42856, x'ea9da8');
# SMALL COMMERCIAL AT
......@@ -1718,40 +1718,40 @@ SELECT count(*) FROM t1, t2
# Alter from 4-byte charset to 3-byte charset, error
--disable_warnings
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8;
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
--enable_warnings
SHOW CREATE TABLE t1;
--sorted_result
SELECT u_decimal,hex(utf8mb4_encoding),utf8mb4_encoding FROM t1;
# Alter table from utf8 to utf8mb4
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb4;
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
SHOW CREATE TABLE t2;
--sorted_result
SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
# Alter table back from utf8mb4 to utf8
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb3;
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci;
SHOW CREATE TABLE t2;
--sorted_result
SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
# ALter of utf8mb4 column to utf8
--disable_warnings
ALTER TABLE t1 MODIFY utf8mb4_encoding VARCHAR(10) CHARACTER SET utf8mb3;
ALTER TABLE t1 MODIFY utf8mb4_encoding VARCHAR(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci;
--enable_warnings
SHOW CREATE TABLE t1;
--sorted_result
SELECT u_decimal,hex(utf8mb4_encoding) FROM t1;
# ALter of utf8 column to utf8mb4
ALTER TABLE t1 MODIFY utf8mb4_encoding VARCHAR(10) CHARACTER SET utf8mb4;
ALTER TABLE t1 MODIFY utf8mb4_encoding VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
SHOW CREATE TABLE t1;
--sorted_result
SELECT u_decimal,hex(utf8mb4_encoding) FROM t1;
# ALter of utf8 column to utf8mb4
ALTER TABLE t2 MODIFY utf8mb3_encoding VARCHAR(10) CHARACTER SET utf8mb4;
ALTER TABLE t2 MODIFY utf8mb3_encoding VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
SHOW CREATE TABLE t2;
--sorted_result
SELECT u_decimal,hex(utf8mb3_encoding) FROM t2;
......@@ -1762,7 +1762,7 @@ DROP TABLE IF EXISTS t3;
eval CREATE TABLE t3 (
u_decimal int NOT NULL,
utf8mb3_encoding VARCHAR(10) NOT NULL
) CHARACTER SET utf8 ENGINE $engine;
) CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE $engine;
# Insert select utf8mb4 (4-byte) into utf8 (3-byte), error
#--error ER_INVALID_CHARACTER_STRING
......@@ -1774,7 +1774,7 @@ DROP TABLE IF EXISTS t4;
eval CREATE TABLE t4 (
u_decimal int NOT NULL,
utf8mb4_encoding VARCHAR(10) NOT NULL
) CHARACTER SET utf8mb4 ENGINE $engine;
) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ENGINE $engine;
# Insert select utf8 (3-byte) into utf8mb4 (4-byte)
INSERT INTO t3 SELECT * FROM t2;
......@@ -1789,11 +1789,11 @@ DROP TABLE t4;
--echo #
SELECT CHARSET(CONCAT(_utf8mb4'a',_utf8'b'));
eval CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 NOT NULL) ENGINE $engine;
eval CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL) ENGINE $engine;
INSERT INTO t1 VALUES (x'ea9da8'),(x'f48fbfbf');
SELECT CONCAT(utf8mb4, _utf8 x'ea9da8') FROM t1 LIMIT 0;
eval CREATE TABLE t2 (utf8mb3 VARCHAR(10) CHARACTER SET utf8mb3 NOT NULL) ENGINE $engine;
eval CREATE TABLE t2 (utf8mb3 VARCHAR(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL) ENGINE $engine;
INSERT INTO t2 VALUES (x'ea9da8');
SELECT HEX(CONCAT(utf8mb4, utf8mb3)) FROM t1,t2 ORDER BY 1;
......@@ -1814,7 +1814,7 @@ DROP TABLE t2;
--echo # Check that mixing utf8mb4 with an invalid utf8 constant returns error
--echo #
# This should perhaps be changed to return ER_INVALID_CHARACTER_STRING
eval CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4) ENGINE $engine;
eval CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci) ENGINE $engine;
INSERT INTO t1 VALUES (x'f48fbfbf');
--error ER_CANT_AGGREGATE_2COLLATIONS
SELECT CONCAT(utf8mb4, _utf8 '') FROM t1;
......@@ -1835,7 +1835,8 @@ DROP TABLE t1;
--echo #
CREATE TABLE t1 (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
a VARCHAR(10) CHARACTER SET utf8mb4, KEY(a,id)
a VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
KEY(a,id)
);
INSERT INTO t1 (a) VALUES (0x61);
INSERT INTO t1 (a) VALUES (0xC280),(0xDFBF);
......
-- require include/have_utf16.require
disable_query_log;
show collation like 'utf16_general_ci';
enable_query_log;
let collation=utf16_general_ci;
--source include/have_collation.inc
Collation Charset Id Default Compiled Sortlen
utf16_general_ci utf16 54 Yes Yes 1
-- require include/have_utf32.require
disable_query_log;
show collation like 'utf32_general_ci';
enable_query_log;
let collation=utf32_general_ci;
--source include/have_collation.inc
Collation Charset Id Default Compiled Sortlen
utf32_general_ci utf32 60 Yes Yes 1
--require include/have_utf8mb4.require
--disable_query_log
SHOW COLLATION LIKE 'utf8mb4_general_ci';
--enable_query_log
let collation=utf8mb4_general_ci;
--source include/have_collation.inc
Collation Charset Id Default Compiled Sortlen
utf8mb4_general_ci utf8mb4 45 Yes Yes 1
......@@ -878,7 +878,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` text DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_uca1400_ai_ci
drop table t1;
create table t1 (a mediumtext character set latin1);
alter table t1 convert to character set utf8;
......@@ -886,7 +886,7 @@ show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` longtext DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_uca1400_ai_ci
drop table t1;
End of 5.0 tests
drop table if exists t1, t2, t3;
......@@ -1353,7 +1353,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`consultant_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_uca1400_ai_ci
DROP TABLE t1;
CREATE TABLE t1 (
`a` int(11) DEFAULT NULL
......@@ -1365,7 +1365,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`consultant_id` int(11) NOT NULL DEFAULT 2
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_uca1400_ai_ci
DROP TABLE t1;
CREATE TABLE t1 (
`a` int(11) DEFAULT NULL
......@@ -1377,7 +1377,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`consultant_id` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_uca1400_ai_ci
DROP TABLE t1;
CREATE TABLE t1 (
`a` int(11) DEFAULT NULL
......@@ -1390,7 +1390,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`consultant_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_uca1400_ai_ci
DROP TABLE t1;
#
# BUG#27788685: NO WARNING WHEN TRUNCATING A STRING WITH DATA LOSS
......@@ -2201,7 +2201,7 @@ t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_uca1400_ai_ci
DROP TABLE t1;
#
# MDEV-15308
......
This diff is collapsed.
......@@ -51,11 +51,11 @@ USE db1;
ALTER DATABASE COMMENT 'db1 comment' CHARACTER SET 'utf8';
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */ COMMENT 'db1 comment'
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci */ COMMENT 'db1 comment'
ALTER DATABASE db1 COMMENT 'this is db1 comment';
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */ COMMENT 'this is db1 comment'
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci */ COMMENT 'this is db1 comment'
ALTER DATABASE CHARACTER SET 'latin1';
SHOW CREATE DATABASE db1;
Database Create Database
......
......@@ -13,7 +13,7 @@ t1 CREATE TABLE `t1` (
`c1` int(11) DEFAULT 12 COMMENT 'column1',
`c2` int(11) DEFAULT NULL COMMENT 'column2',
`c3` int(11) NOT NULL COMMENT 'column3',
`c4` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'a',
`c4` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL DEFAULT 'a',
`c5` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT 'b',
`c6` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin
......@@ -24,7 +24,7 @@ t2 CREATE TABLE `t2` (
`c1` int(11) DEFAULT 12 COMMENT 'column1',
`c2` int(11) DEFAULT NULL COMMENT 'column2',
`c3` int(11) NOT NULL COMMENT 'column3',
`c4` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'a',
`c4` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL DEFAULT 'a',
`c5` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci DEFAULT 'b',
`c6` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
......
......@@ -46,7 +46,7 @@ Table Create Table
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
show create view имя_вью_кодировке_утф8_длиной_больше_чем_42;
View Create View character_set_client collation_connection
имя_вью_кодировке_утф8_длиной_больше_чем_42 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `имя_вью_кодировке_утф8_длиной_больше_чем_42` AS select `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48`.`имя_поля_в_кодировке_утф8_длиной_больше_чем_45` AS `имя_поля_в_кодировке_утф8_длиной_больше_чем_45` from `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48` utf8mb3 utf8mb3_general_ci
имя_вью_кодировке_утф8_длиной_больше_чем_42 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `имя_вью_кодировке_утф8_длиной_больше_чем_42` AS select `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48`.`имя_поля_в_кодировке_утф8_длиной_больше_чем_45` AS `имя_поля_в_кодировке_утф8_длиной_больше_чем_45` from `имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48` utf8mb3 utf8mb3_uca1400_ai_ci
create trigger имя_триггера_в_кодировке_утф8_длиной_больше_чем_49
before insert on имя_таблицы_в_кодировке_утф8_длиной_больше_чем_48 for each row set @a:=1;
select TRIGGER_NAME from information_schema.triggers where
......
......@@ -32,7 +32,7 @@ test.t10 analyze status OK
#
select collation('abc');
collation('abc')
utf8mb4_general_ci
utf8mb4_uca1400_ai_ci
explain select * from t1 force index (mb3) where t1.mb3='abc';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref mb3 mb3 99 const 1 Using index condition
......@@ -47,7 +47,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range mb3 mb3 99 NULL 1 Using index condition
# If a constant can't be represented in utf8mb3, an error is produced:
explain select * from t1 force index (mb3) where t1.mb3='😊';
ERROR HY000: Illegal mix of collations (utf8mb3_general_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '='
ERROR HY000: Illegal mix of collations (utf8mb3_general_ci,IMPLICIT) and (utf8mb4_uca1400_ai_ci,COERCIBLE) for operation '='
#
# Check ref access on mb3_field=mb4_field
#
......
......@@ -4,6 +4,7 @@
#
# MDEV-27853 Wrong data type on column `COLLATE DEFAULT` and table `COLLATE some_non_default_collation`
#
SET character_set_collations='utf8mb4=utf8mb4_general_ci';
CREATE TABLE t1 (
a CHAR(10) COLLATE DEFAULT
) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
......@@ -11811,6 +11812,7 @@ DROP FUNCTION is_conflicting_charset_explicit_collate_explicit;
DROP FUNCTION is_conflicting_collate_explicit2;
DROP FUNCTION is_conflicting_collate_default_collate_explicit;
DROP FUNCTION collate_cs_default_collation;
SET character_set_collations=DEFAULT;
#
# End of 10.9 tests
#
......@@ -8,6 +8,8 @@
--echo # MDEV-27853 Wrong data type on column `COLLATE DEFAULT` and table `COLLATE some_non_default_collation`
--echo #
SET character_set_collations='utf8mb4=utf8mb4_general_ci';
CREATE TABLE t1 (
a CHAR(10) COLLATE DEFAULT
) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
......@@ -621,6 +623,7 @@ DROP FUNCTION is_conflicting_collate_explicit2;
DROP FUNCTION is_conflicting_collate_default_collate_explicit;
DROP FUNCTION collate_cs_default_collation;
SET character_set_collations=DEFAULT;
--echo #
--echo # End of 10.9 tests
......
SET character_set_collations='utf8mb4=utf8mb4_general_ci';
CREATE TABLE t0 (a VARCHAR(64));
INSERT INTO t0 VALUES
('CHARACTER SET DEFAULT'),
......@@ -3688,6 +3689,7 @@ DROP TABLE results_alter_db;
DROP TABLE results_create_table;
DROP TABLE results_alter_table;
DROP TABLE results_convert_table;
SET character_set_collations=DEFAULT;
#
# MDEV-30003 Assertion failure upon 2nd execution of SP trying to set collation on non-existing database
#
......
--source include/have_utf8mb4.inc
SET character_set_collations='utf8mb4=utf8mb4_general_ci';
CREATE TABLE t0 (a VARCHAR(64));
INSERT INTO t0 VALUES
......@@ -367,6 +368,8 @@ DROP TABLE results_create_table;
DROP TABLE results_alter_table;
DROP TABLE results_convert_table;
SET character_set_collations=DEFAULT;
--echo #
--echo # MDEV-30003 Assertion failure upon 2nd execution of SP trying to set collation on non-existing database
--echo #
......
......@@ -23,7 +23,7 @@ DROP DATABASE db1;
CREATE DATABASE db1 COLLATE DEFAULT;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
utf8mb4 utf8mb4_general_ci
utf8mb4 utf8mb4_uca1400_ai_ci
DROP DATABASE db1;
CREATE DATABASE db1 COLLATE latin1_bin;
SELECT * FROM cscl;
......@@ -68,12 +68,12 @@ DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET DEFAULT COLLATE DEFAULT;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
utf8mb4 utf8mb4_general_ci
utf8mb4 utf8mb4_uca1400_ai_ci
DROP DATABASE db1;
CREATE DATABASE db1 COLLATE DEFAULT CHARACTER SET DEFAULT;
SELECT * FROM cscl;
DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME
utf8mb4 utf8mb4_general_ci
utf8mb4 utf8mb4_uca1400_ai_ci
DROP DATABASE db1;
CREATE DATABASE db1 CHARACTER SET DEFAULT CHARACTER SET utf8mb4;
SELECT * FROM cscl;
......
......@@ -266,7 +266,7 @@ utf8mb3_bin utf8mb3_bin
SET @@character_set_collations=DEFAULT;
EXECUTE stmt;
a b
utf8mb3_general_ci utf8mb3_general_ci
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
SET NAMES utf8mb3;
SET @@character_set_collations='';
PREPARE stmt FROM 'CREATE TABLE t1 '
......
......@@ -23,7 +23,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
DROP TABLE t1;
#
# MDEV-28117 Multiple conflicting table COLLATE clauses are not rejected
......
......@@ -112,7 +112,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
`c1` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE CONCAT(c1)='a';
......@@ -135,7 +135,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
`c1` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
INSERT INTO t1 VALUES ('a'),('a ');
SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
......@@ -158,7 +158,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
`c1` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
......@@ -181,7 +181,7 @@ CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
`c1` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
INSERT INTO t1 VALUES ('%'),('% ');
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
......@@ -207,7 +207,7 @@ CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
`a` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
INSERT INTO t1 VALUES ('a'),('a ');
SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
......
......@@ -102,15 +102,15 @@ ALTER TABLE t1 CONVERT TO CHARACTER SET utf8, CHARACTER SET latin1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
`a` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8, CHARACTER SET DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
`a` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin5 COLLATE=latin5_turkish_ci
ALTER TABLE t1 CONVERT TO CHARACTER SET latin1, CHARACTER SET utf8;
SHOW CREATE TABLE t1;
......@@ -118,7 +118,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_uca1400_ai_ci
ALTER TABLE t1 CONVERT TO CHARACTER SET latin1, CHARACTER SET DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
......@@ -132,7 +132,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin5 COLLATE latin5_turkish_ci DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin5 COLLATE latin5_turkish_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_uca1400_ai_ci
ALTER TABLE t1 CONVERT TO CHARACTER SET DEFAULT, CHARACTER SET latin1;
SHOW CREATE TABLE t1;
Table Create Table
......@@ -144,15 +144,15 @@ ALTER TABLE t1 CHARACTER SET latin1, CONVERT TO CHARACTER SET utf8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
`a` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
ALTER TABLE t1 CHARACTER SET DEFAULT, CONVERT TO CHARACTER SET utf8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
`a` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
`b` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin5 COLLATE=latin5_turkish_ci
ALTER TABLE t1 CHARACTER SET utf8, CONVERT TO CHARACTER SET latin1;
SHOW CREATE TABLE t1;
......@@ -160,7 +160,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_uca1400_ai_ci
ALTER TABLE t1 CHARACTER SET DEFAULT, CONVERT TO CHARACTER SET latin1;
SHOW CREATE TABLE t1;
Table Create Table
......@@ -174,7 +174,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) CHARACTER SET latin5 COLLATE latin5_turkish_ci DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin5 COLLATE latin5_turkish_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_uca1400_ai_ci
ALTER TABLE t1 CHARACTER SET latin1, CONVERT TO CHARACTER SET DEFAULT;
SHOW CREATE TABLE t1;
Table Create Table
......
......@@ -2244,7 +2244,7 @@ FE80
DELETE FROM t2 WHERE a='?';
ALTER TABLE t2 ADD u VARCHAR(1) CHARACTER SET utf8, ADD a2 VARCHAR(1) CHARACTER SET euckr;
UPDATE IGNORE t2 SET u=a, a2=u;
SELECT s as unassigned_code FROM t2 WHERE u='?';
SELECT s as unassigned_code FROM t2 WHERE u=binary'?';
unassigned_code
A2E8
A2E9
......@@ -7626,7 +7626,7 @@ FEFB
FEFC
FEFD
FEFE
DELETE FROM t2 WHERE u='?';
DELETE FROM t2 WHERE u=binary'?';
SELECT count(*) as roundtrip_problem_chars FROM t2 WHERE hex(a) <> hex(a2);
roundtrip_problem_chars
0
......
......@@ -103,8 +103,15 @@ ALTER TABLE t2 ADD u VARCHAR(1) CHARACTER SET utf8, ADD a2 VARCHAR(1) CHARACTER
--disable_warnings
UPDATE IGNORE t2 SET u=a, a2=u;
--enable_warnings
SELECT s as unassigned_code FROM t2 WHERE u='?';
DELETE FROM t2 WHERE u='?';
#
# _euckr 0xA3BF is "U+FF1F FULLWIDTH QUESTION MARK".
# In utf8mb3_uca1400_ai_ci, which is the collation for t1.u,
# it's equal to "U+003F QUESTION MARK".
# Let's use the `binary` keyword in the comparison
# to avoid 0xA3BF being displayed as unassigned character.
#
SELECT s as unassigned_code FROM t2 WHERE u=binary'?';
DELETE FROM t2 WHERE u=binary'?';
# Make sure there are no euckr->utf8->euckr roundtrip problems
SELECT count(*) as roundtrip_problem_chars FROM t2 WHERE hex(a) <> hex(a2);
SELECT s, hex(a), hex(u), hex(a2) FROM t2 ORDER BY s;
......
......@@ -1067,8 +1067,10 @@ A8B7 ǚ
A8B8 ǜ
A8B9 ü
A8BA ê
A8BB ɑ
A8BD ń
A8BE ň
A8C0 ɡ
Warnings:
Warning 1977 Cannot convert 'gbk' character 0xA140 to 'utf8mb3'
Warning 1977 Cannot convert 'gbk' character 0xA140 to 'utf8mb3'
......
......@@ -49,7 +49,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
`a1` text NOT NULL,
`a2` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`a2` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL,
`b1` blob NOT NULL,
`eol` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=gbk COLLATE=gbk_chinese_ci
......
......@@ -284,7 +284,7 @@ id name val
32 mn 63616161616161616161616161616161
32 mx 63616161616161616161616161616161
32 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci;
INSERT INTO t1 (a) VALUES (_ucs2 0x0425),(_ucs2 0x045F);
INSERT INTO t1 (a) VALUES (_ucs2 0x2525),(_ucs2 0x5F5F);
SELECT * FROM v1;
......@@ -433,6 +433,153 @@ id name val
36 mn E5BD9F
36 mx E5BD9F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_uca1400_ai_ci;
SELECT * FROM v1;
id name val
1 a
1 mn
1 mx
1 sp --------------------------------
2 a _
2 mn 09090909090909090909090909090909
2 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
2 sp --------------------------------
3 a %
3 mn 09090909090909090909090909090909
3 mx EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF20
3 sp --------------------------------
4 a \_
4 mn 5F
4 mx 5F
4 sp --------------------------------
5 a \%
5 mn 25
5 mx 25
5 sp --------------------------------
6 a \
6 mn 5C
6 mx 5C
6 sp --------------------------------
7 a a
7 mn 61
7 mx 61
7 sp --------------------------------
8 a c
8 mn 63
8 mx 63
8 sp --------------------------------
9 a a_
9 mn 61090909090909090909090909090909
9 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
9 sp --------------------------------
10 a c_
10 mn 63090909090909090909090909090909
10 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
10 sp --------------------------------
11 a a%
11 mn 61090909090909090909090909090909
11 mx 61EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
11 sp --------------------------------
12 a c%
12 mn 63090909090909090909090909090909
12 mx 63EFBFBFEFBFBFEFBFBFEFBFBFEFBFBF
12 sp --------------------------------
13 a aa
13 mn 6161
13 mx 6161
13 sp --------------------------------
14 a cc
14 mn 6363
14 mx 6363
14 sp --------------------------------
15 a ch
15 mn 6368
15 mx 6368
15 sp --------------------------------
16 a aa_
16 mn 61610909090909090909090909090909
16 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020
16 sp --------------------------------
17 a cc_
17 mn 63630909090909090909090909090909
17 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020
17 sp --------------------------------
18 a ch_
18 mn 63680909090909090909090909090909
18 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020
18 sp --------------------------------
19 a aa%
19 mn 61610909090909090909090909090909
19 mx 6161EFBFBFEFBFBFEFBFBFEFBFBF2020
19 sp --------------------------------
20 a cc%
20 mn 63630909090909090909090909090909
20 mx 6363EFBFBFEFBFBFEFBFBFEFBFBF2020
20 sp --------------------------------
21 a ch%
21 mn 63680909090909090909090909090909
21 mx 6368EFBFBFEFBFBFEFBFBFEFBFBF2020
21 sp --------------------------------
22 a aaa
22 mn 616161
22 mx 616161
22 sp --------------------------------
23 a ccc
23 mn 636363
23 mx 636363
23 sp --------------------------------
24 a cch
24 mn 636368
24 mx 636368
24 sp --------------------------------
25 a aaa_
25 mn 61616109090909090909090909090909
25 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20
25 sp --------------------------------
26 a ccc_
26 mn 63636309090909090909090909090909
26 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20
26 sp --------------------------------
27 a cch_
27 mn 63636809090909090909090909090909
27 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20
27 sp --------------------------------
28 a aaa%
28 mn 61616109090909090909090909090909
28 mx 616161EFBFBFEFBFBFEFBFBFEFBFBF20
28 sp --------------------------------
29 a ccc%
29 mn 63636309090909090909090909090909
29 mx 636363EFBFBFEFBFBFEFBFBFEFBFBF20
29 sp --------------------------------
30 a cch%
30 mn 63636809090909090909090909090909
30 mx 636368EFBFBFEFBFBFEFBFBFEFBFBF20
30 sp --------------------------------
31 a aaaaaaaaaaaaaaaaaaaa
31 mn 6161616161
31 mx 6161616161
31 sp --------------------------------
32 a caaaaaaaaaaaaaaaaaaa
32 mn 6361616161
32 mx 6361616161
32 sp --------------------------------
33 a Х
33 mn D0A5
33 mx D0A5
33 sp --------------------------------
34 a џ
34 mn D19F
34 mx D19F
34 sp --------------------------------
35 a ┥
35 mn E294A5
35 mx E294A5
35 sp --------------------------------
36 a 彟
36 mn E5BD9F
36 mx E5BD9F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
SELECT * FROM v1;
id name val
......@@ -1021,7 +1168,7 @@ id name val
36 mn E5BD9F
36 mx E5BD9F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
SELECT * FROM v1;
id name val
1 a
......@@ -1168,6 +1315,153 @@ id name val
36 mn E5BD9F
36 mx E5BD9F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci;
SELECT * FROM v1;
id name val
1 a
1 mn
1 mx
1 sp --------------------------------
2 a _
2 mn 09090909090909090909090909090909
2 mx F48FBFBFF48FBFBFF48FBFBFF48FBFBF
2 sp --------------------------------
3 a %
3 mn 09090909090909090909090909090909
3 mx F48FBFBFF48FBFBFF48FBFBFF48FBFBF
3 sp --------------------------------
4 a \_
4 mn 5F
4 mx 5F
4 sp --------------------------------
5 a \%
5 mn 25
5 mx 25
5 sp --------------------------------
6 a \
6 mn 5C
6 mx 5C
6 sp --------------------------------
7 a a
7 mn 61
7 mx 61
7 sp --------------------------------
8 a c
8 mn 63
8 mx 63
8 sp --------------------------------
9 a a_
9 mn 61090909090909090909090909090909
9 mx 61F48FBFBFF48FBFBFF48FBFBF202020
9 sp --------------------------------
10 a c_
10 mn 63090909090909090909090909090909
10 mx 63F48FBFBFF48FBFBFF48FBFBF202020
10 sp --------------------------------
11 a a%
11 mn 61090909090909090909090909090909
11 mx 61F48FBFBFF48FBFBFF48FBFBF202020
11 sp --------------------------------
12 a c%
12 mn 63090909090909090909090909090909
12 mx 63F48FBFBFF48FBFBFF48FBFBF202020
12 sp --------------------------------
13 a aa
13 mn 6161
13 mx 6161
13 sp --------------------------------
14 a cc
14 mn 6363
14 mx 6363
14 sp --------------------------------
15 a ch
15 mn 6368
15 mx 6368
15 sp --------------------------------
16 a aa_
16 mn 61610909090909090909090909090909
16 mx 6161F48FBFBFF48FBFBFF48FBFBF2020
16 sp --------------------------------
17 a cc_
17 mn 63630909090909090909090909090909
17 mx 6363F48FBFBFF48FBFBFF48FBFBF2020
17 sp --------------------------------
18 a ch_
18 mn 63680909090909090909090909090909
18 mx 6368F48FBFBFF48FBFBFF48FBFBF2020
18 sp --------------------------------
19 a aa%
19 mn 61610909090909090909090909090909
19 mx 6161F48FBFBFF48FBFBFF48FBFBF2020
19 sp --------------------------------
20 a cc%
20 mn 63630909090909090909090909090909
20 mx 6363F48FBFBFF48FBFBFF48FBFBF2020
20 sp --------------------------------
21 a ch%
21 mn 63680909090909090909090909090909
21 mx 6368F48FBFBFF48FBFBFF48FBFBF2020
21 sp --------------------------------
22 a aaa
22 mn 616161
22 mx 616161
22 sp --------------------------------
23 a ccc
23 mn 636363
23 mx 636363
23 sp --------------------------------
24 a cch
24 mn 636368
24 mx 636368
24 sp --------------------------------
25 a aaa_
25 mn 61616109090909090909090909090909
25 mx 616161F48FBFBFF48FBFBFF48FBFBF20
25 sp --------------------------------
26 a ccc_
26 mn 63636309090909090909090909090909
26 mx 636363F48FBFBFF48FBFBFF48FBFBF20
26 sp --------------------------------
27 a cch_
27 mn 63636809090909090909090909090909
27 mx 636368F48FBFBFF48FBFBFF48FBFBF20
27 sp --------------------------------
28 a aaa%
28 mn 61616109090909090909090909090909
28 mx 616161F48FBFBFF48FBFBFF48FBFBF20
28 sp --------------------------------
29 a ccc%
29 mn 63636309090909090909090909090909
29 mx 636363F48FBFBFF48FBFBFF48FBFBF20
29 sp --------------------------------
30 a cch%
30 mn 63636809090909090909090909090909
30 mx 636368F48FBFBFF48FBFBFF48FBFBF20
30 sp --------------------------------
31 a aaaaaaaaaaaaaaaaaaaa
31 mn 61616161
31 mx 61616161
31 sp --------------------------------
32 a caaaaaaaaaaaaaaaaaaa
32 mn 63616161
32 mx 63616161
32 sp --------------------------------
33 a Х
33 mn D0A5
33 mx D0A5
33 sp --------------------------------
34 a џ
34 mn D19F
34 mx D19F
34 sp --------------------------------
35 a ┥
35 mn E294A5
35 mx E294A5
35 sp --------------------------------
36 a 彟
36 mn E5BD9F
36 mx E5BD9F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
SELECT * FROM v1;
id name val
......@@ -1903,7 +2197,7 @@ id name val
36 mn E5BD9F
36 mx E5BD9F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_general_ci;
SELECT * FROM v1;
id name val
1 a
......@@ -2638,7 +2932,7 @@ id name val
36 mn 5F5F
36 mx 5F5F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_general_ci;
SELECT * FROM v1;
id name val
1 a
......@@ -3520,7 +3814,7 @@ id name val
36 mn 5F5F
36 mx 5F5F
36 sp --------------------------------
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_general_ci;
SELECT * FROM v1;
id name val
1 a
......
......@@ -39,11 +39,14 @@ SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET latin1;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci;
INSERT INTO t1 (a) VALUES (_ucs2 0x0425),(_ucs2 0x045F);
INSERT INTO t1 (a) VALUES (_ucs2 0x2525),(_ucs2 0x5F5F);
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_uca1400_ai_ci;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
SELECT * FROM v1;
......@@ -59,7 +62,10 @@ SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_thai_520_w2;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
......@@ -80,7 +86,7 @@ SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_general_ci;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci;
......@@ -95,7 +101,7 @@ SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_thai_520_w2;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_general_ci;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_ci;
......@@ -116,7 +122,7 @@ SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf16 COLLATE utf16_unicode_520_ci;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_general_ci;
SELECT * FROM v1;
ALTER TABLE t1 MODIFY a VARCHAR(32) CHARACTER SET utf32 COLLATE utf32_unicode_ci;
......
......@@ -145,7 +145,7 @@ INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'
SET CHARACTER SET utf8;
SELECT koi8_ru_f,MIN(comment),COUNT(*) FROM t1 GROUP BY 1;
ALTER TABLE t1 ADD utf8_f CHAR(32) CHARACTER SET utf8 NOT NULL default '';
ALTER TABLE t1 ADD utf8_f CHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL default '';
UPDATE t1 SET utf8_f=CONVERT(koi8_ru_f USING utf8);
SET CHARACTER SET koi8r;
SELECT * FROM t1;
......
......@@ -3,17 +3,17 @@ CREATE TABLE t1 SELECT _utf8'test' as c1, _utf8'тест' as c2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` varchar(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`c2` varchar(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL
`c1` varchar(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL,
`c2` varchar(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DELETE FROM t1;
ALTER TABLE t1 ADD c3 CHAR(4) CHARACTER SET utf8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` varchar(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`c2` varchar(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
`c3` char(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
`c1` varchar(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL,
`c2` varchar(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL,
`c3` char(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
INSERT IGNORE INTO t1 VALUES ('aaaabbbbccccdddd','aaaabbbbccccdddd','aaaabbbbccccdddd');
Warnings:
......@@ -28,7 +28,7 @@ CREATE TABLE t1 (a CHAR(4) CHARACTER SET utf8, KEY key_a(a(3)));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`a` char(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
KEY `key_a` (`a`(3))
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SHOW KEYS FROM t1;
......@@ -48,7 +48,7 @@ ALTER TABLE t1 CHANGE a a CHAR(4) CHARACTER SET utf8;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`a` char(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
KEY `key_a` (`a`(3))
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SHOW KEYS FROM t1;
......
......@@ -6479,6 +6479,9 @@ c
ch
drop table t1;
set collation_connection=ucs2_unicode_ci;
#
# Bug#31081 server crash in regexp function
#
drop table if exists t1;
create table t1 as
select repeat(' ', 64) as s1, repeat(' ',64) as s2
......
......@@ -145,7 +145,7 @@ hex(a)
00410009
0041005A
drop table t1;
CREATE TABLE t1 (word VARCHAR(64) CHARACTER SET ucs2, word2 CHAR(64) CHARACTER SET ucs2);
CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET ucs2 COLLATE ucs2_general_ci;
INSERT INTO t1 VALUES (_koi8r'',_koi8r''), (X'2004',X'2004');
SELECT hex(word) FROM t1 ORDER BY word;
hex(word)
......@@ -196,8 +196,8 @@ RPAD(_ucs2 X'0420',10,_ucs2 X'0421') r;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`l` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL,
`r` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
`l` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL,
`r` varchar(10) CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
#
......@@ -682,7 +682,7 @@ create table t1 (a enum('x','y','z') character set ucs2);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('x','y','z') CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
`a` enum('x','y','z') CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
insert into t1 values ('x');
insert into t1 values ('y');
......@@ -696,7 +696,7 @@ alter table t1 change a a enum('x','y','z','d','e','
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('x','y','z','d','e','','','') CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
`a` enum('x','y','z','d','e','','','') CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
insert into t1 values ('D');
insert into t1 values ('E ');
......@@ -718,7 +718,7 @@ create table t1 (a set ('x','y','z','
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` set('x','y','z','','','') CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
`a` set('x','y','z','','','') CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
insert into t1 values ('x');
insert into t1 values ('y');
......@@ -1364,7 +1364,7 @@ hex(group_concat(a))
0061002C0062002C0063
select collation(group_concat(a)) from t1;
collation(group_concat(a))
ucs2_general_ci
ucs2_uca1400_ai_ci
drop table t1;
set names latin1;
create table t1 (a char(1) character set latin1);
......@@ -1402,17 +1402,17 @@ a 1
select * from t1 where a=if(b>10,_ucs2 0x0061,_ucs2 0x0062);
a b
select concat(a,if(b<10,_ucs2 0x00C0,_ucs2 0x0062)) from t1;
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation 'concat'
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_uca1400_ai_ci,COERCIBLE) for operation 'concat'
select concat(a,if(b>10,_ucs2 0x00C0,_ucs2 0x0062)) from t1;
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation 'concat'
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_uca1400_ai_ci,COERCIBLE) for operation 'concat'
select concat(a,if(b<10,_ucs2 0x0062,_ucs2 0x00C0)) from t1;
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation 'concat'
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_uca1400_ai_ci,COERCIBLE) for operation 'concat'
select concat(a,if(b>10,_ucs2 0x0062,_ucs2 0x00C0)) from t1;
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation 'concat'
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_uca1400_ai_ci,COERCIBLE) for operation 'concat'
select * from t1 where a=if(b<10,_ucs2 0x00C0,_ucs2 0x0062);
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation '='
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_uca1400_ai_ci,COERCIBLE) for operation '='
select * from t1 where a=if(b<10,_ucs2 0x0062,_ucs2 0x00C0);
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_general_ci,COERCIBLE) for operation '='
ERROR HY000: Illegal mix of collations (ascii_general_ci,IMPLICIT) and (ucs2_uca1400_ai_ci,COERCIBLE) for operation '='
drop table t1;
CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET UCS2);
INSERT INTO t1 VALUES ('a');
......@@ -1426,6 +1426,9 @@ HEX(s1)
0061
DROP TABLE t1;
set collation_connection=ucs2_general_ci;
#
# Bug#31081 server crash in regexp function
#
drop table if exists t1;
create table t1 as
select repeat(' ', 64) as s1, repeat(' ',64) as s2
......
......@@ -34,7 +34,7 @@ drop table t1;
# which contains 0x20 in the high byte.
#
CREATE TABLE t1 (word VARCHAR(64) CHARACTER SET ucs2, word2 CHAR(64) CHARACTER SET ucs2);
CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET ucs2 COLLATE ucs2_general_ci;
INSERT INTO t1 VALUES (_koi8r'',_koi8r''), (X'2004',X'2004');
SELECT hex(word) FROM t1 ORDER BY word;
SELECT hex(word2) FROM t1 ORDER BY word2;
......
......@@ -38,7 +38,7 @@ hex(_utf16 0x3344)
select hex(_utf16 0x113344);
hex(_utf16 0x113344)
00113344
CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf16;
CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf16 COLLATE utf16_general_ci;
INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004');
SELECT hex(word) FROM t1 ORDER BY word;
hex(word)
......@@ -101,8 +101,8 @@ RPAD(_utf16 X'0420',10,_utf16 X'0421') r;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`l` varchar(10) CHARACTER SET utf16 COLLATE utf16_general_ci DEFAULT NULL,
`r` varchar(10) CHARACTER SET utf16 COLLATE utf16_general_ci DEFAULT NULL
`l` varchar(10) CHARACTER SET utf16 COLLATE utf16_uca1400_ai_ci DEFAULT NULL,
`r` varchar(10) CHARACTER SET utf16 COLLATE utf16_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
select hex(l), hex(r) from t1;
hex(l) hex(r)
......@@ -510,7 +510,7 @@ create table t1 (a enum('x','y','z') character set utf16);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('x','y','z') CHARACTER SET utf16 COLLATE utf16_general_ci DEFAULT NULL
`a` enum('x','y','z') CHARACTER SET utf16 COLLATE utf16_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
insert into t1 values ('x');
insert into t1 values ('y');
......@@ -524,7 +524,7 @@ alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('x','y','z','d','e','ä','ö','ü') CHARACTER SET utf16 COLLATE utf16_general_ci DEFAULT NULL
`a` enum('x','y','z','d','e','ä','ö','ü') CHARACTER SET utf16 COLLATE utf16_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
insert into t1 values ('D');
insert into t1 values ('E ');
......@@ -546,7 +546,7 @@ create table t1 (a set ('x','y','z','ä','ö','ü') character set utf16);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` set('x','y','z','ä','ö','ü') CHARACTER SET utf16 COLLATE utf16_general_ci DEFAULT NULL
`a` set('x','y','z','ä','ö','ü') CHARACTER SET utf16 COLLATE utf16_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
insert into t1 values ('x');
insert into t1 values ('y');
......@@ -1294,14 +1294,14 @@ Note 1246 Converting column 'a' from VARCHAR to TEXT
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` mediumtext CHARACTER SET utf16 COLLATE utf16_general_ci DEFAULT NULL
`a` mediumtext CHARACTER SET utf16 COLLATE utf16_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop table t1;
create table t1 (a varchar(250) character set utf16 primary key);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(250) CHARACTER SET utf16 COLLATE utf16_general_ci NOT NULL,
`a` varchar(250) CHARACTER SET utf16 COLLATE utf16_uca1400_ai_ci NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop table t1;
......@@ -1322,6 +1322,9 @@ E000 EE8080 E000
FFFF EFBFBF FFFF
drop table t1;
set collation_connection=utf16_general_ci;
#
# Bug#31081 server crash in regexp function
#
drop table if exists t1;
create table t1 as
select repeat(' ', 64) as s1, repeat(' ',64) as s2
......@@ -1515,11 +1518,11 @@ s4 LONGTEXT CHARACTER SET utf16
SET NAMES utf8, @@character_set_results=NULL;
SELECT *, HEX(s1) FROM t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 s1 s1 252 255 0 Y 16 0 54
def test t1 t1 s2 s2 252 65535 0 Y 16 0 54
def test t1 t1 s3 s3 252 16777215 0 Y 16 0 54
def test t1 t1 s4 s4 252 4294967295 0 Y 16 0 54
def HEX(s1) 253 6120 0 Y 0 0 33
def test t1 t1 s1 s1 252 255 0 Y 16 0 101
def test t1 t1 s2 s2 252 65535 0 Y 16 0 101
def test t1 t1 s3 s3 252 16777215 0 Y 16 0 101
def test t1 t1 s4 s4 252 4294967295 0 Y 16 0 101
def HEX(s1) 253 6120 0 Y 0 0 192
s1 s2 s3 s4 HEX(s1)
SET NAMES latin1;
SELECT *, HEX(s1) FROM t1;
......@@ -1533,17 +1536,17 @@ s1 s2 s3 s4 HEX(s1)
SET NAMES utf8;
SELECT *, HEX(s1) FROM t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 s1 s1 252 381 0 Y 16 0 33
def test t1 t1 s2 s2 252 98301 0 Y 16 0 33
def test t1 t1 s3 s3 252 25165821 0 Y 16 0 33
def test t1 t1 s4 s4 252 4294967295 0 Y 16 0 33
def HEX(s1) 253 6120 0 Y 0 0 33
def test t1 t1 s1 s1 252 381 0 Y 16 0 192
def test t1 t1 s2 s2 252 98301 0 Y 16 0 192
def test t1 t1 s3 s3 252 25165821 0 Y 16 0 192
def test t1 t1 s4 s4 252 4294967295 0 Y 16 0 192
def HEX(s1) 253 6120 0 Y 0 0 192
s1 s2 s3 s4 HEX(s1)
CREATE TABLE t2 AS SELECT CONCAT(s1) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`CONCAT(s1)` varchar(255) CHARACTER SET utf16 COLLATE utf16_general_ci DEFAULT NULL
`CONCAT(s1)` varchar(255) CHARACTER SET utf16 COLLATE utf16_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1, t2;
#
......@@ -1834,11 +1837,11 @@ hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0))
select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0))
20AC20AC20AC00200020002000200020002000200020002000
select hex(weight_string(_utf16 0xD800DC00));
hex(weight_string(_utf16 0xD800DC00))
select hex(weight_string(_utf16 0xD800DC00 COLLATE utf16_general_ci));
hex(weight_string(_utf16 0xD800DC00 COLLATE utf16_general_ci))
FFFD
select hex(weight_string(_utf16 0xD800DC01));
hex(weight_string(_utf16 0xD800DC01))
select hex(weight_string(_utf16 0xD800DC01 COLLATE utf16_general_ci));
hex(weight_string(_utf16 0xD800DC01 COLLATE utf16_general_ci))
FFFD
select @@collation_connection;
@@collation_connection
......@@ -2190,7 +2193,8 @@ SET optimizer_switch=@save_optimizer_switch;
#
CREATE TABLE t1 (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
a VARCHAR(10) CHARACTER SET utf16, KEY(a,id)
a VARCHAR(10) CHARACTER SET utf16 COLLATE utf16_general_ci,
KEY(a,id)
);
INSERT INTO t1 (a) VALUES (_utf8mb4 0x61);
INSERT INTO t1 (a) VALUES (_utf8mb4 0xC280),(_utf8mb4 0xDFBF);
......
......@@ -34,7 +34,7 @@ select hex(_utf16 0x113344);
# low byte. The second character is THREE-PER-M, U+2004,
# which contains 0x20 in the high byte.
CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf16;
CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf16 COLLATE utf16_general_ci;
INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004');
SELECT hex(word) FROM t1 ORDER BY word;
SELECT hex(word2) FROM t1 ORDER BY word2;
......@@ -830,8 +830,8 @@ SET NAMES utf8;
set collation_connection=utf16_general_ci;
--source include/weight_string.inc
--source include/weight_string_euro.inc
select hex(weight_string(_utf16 0xD800DC00));
select hex(weight_string(_utf16 0xD800DC01));
select hex(weight_string(_utf16 0xD800DC00 COLLATE utf16_general_ci));
select hex(weight_string(_utf16 0xD800DC01 COLLATE utf16_general_ci));
--source include/weight_string_l1.inc
set collation_connection=utf16_bin;
......@@ -894,7 +894,8 @@ SET NAMES utf8, character_set_connection=utf16;
--echo #
CREATE TABLE t1 (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
a VARCHAR(10) CHARACTER SET utf16, KEY(a,id)
a VARCHAR(10) CHARACTER SET utf16 COLLATE utf16_general_ci,
KEY(a,id)
);
INSERT INTO t1 (a) VALUES (_utf8mb4 0x61);
INSERT INTO t1 (a) VALUES (_utf8mb4 0xC280),(_utf8mb4 0xDFBF);
......
......@@ -3108,6 +3108,9 @@ COUNT(*) c1
1 a
DROP TABLE IF EXISTS t1;
set collation_connection=utf16_unicode_ci;
#
# Bug#31081 server crash in regexp function
#
drop table if exists t1;
create table t1 as
select repeat(' ', 64) as s1, repeat(' ',64) as s2
......
......@@ -1592,6 +1592,9 @@ DROP TABLE t1;
# Test basic regex functionality
#
SET NAMES utf8, collation_connection=utf16le_general_ci;
#
# Bug#31081 server crash in regexp function
#
drop table if exists t1;
create table t1 as
select repeat(' ', 64) as s1, repeat(' ',64) as s2
......@@ -1791,7 +1794,7 @@ def test t1 t1 s1 s1 252 255 0 Y 16 0 56
def test t1 t1 s2 s2 252 65535 0 Y 16 0 56
def test t1 t1 s3 s3 252 16777215 0 Y 16 0 56
def test t1 t1 s4 s4 252 4294967295 0 Y 16 0 56
def HEX(s1) 253 6120 0 Y 0 0 33
def HEX(s1) 253 6120 0 Y 0 0 192
s1 s2 s3 s4 HEX(s1)
SET NAMES latin1;
SELECT *, HEX(s1) FROM t1;
......@@ -1805,11 +1808,11 @@ s1 s2 s3 s4 HEX(s1)
SET NAMES utf8;
SELECT *, HEX(s1) FROM t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 s1 s1 252 381 0 Y 16 0 33
def test t1 t1 s2 s2 252 98301 0 Y 16 0 33
def test t1 t1 s3 s3 252 25165821 0 Y 16 0 33
def test t1 t1 s4 s4 252 4294967295 0 Y 16 0 33
def HEX(s1) 253 6120 0 Y 0 0 33
def test t1 t1 s1 s1 252 381 0 Y 16 0 192
def test t1 t1 s2 s2 252 98301 0 Y 16 0 192
def test t1 t1 s3 s3 252 25165821 0 Y 16 0 192
def test t1 t1 s4 s4 252 4294967295 0 Y 16 0 192
def HEX(s1) 253 6120 0 Y 0 0 192
s1 s2 s3 s4 HEX(s1)
CREATE TABLE t2 AS SELECT CONCAT(s1) FROM t1;
SHOW CREATE TABLE t2;
......
......@@ -47,7 +47,7 @@ hex(_utf32 X'3344')
select hex(_utf32 X'103344');
hex(_utf32 X'103344')
00103344
CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf32;
CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf32 COLLATE utf32_general_ci;
INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004');
SELECT hex(word) FROM t1 ORDER BY word;
hex(word)
......@@ -100,8 +100,8 @@ RPAD(_utf32 X'0420',10,_utf32 X'0421') r;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`l` varchar(10) CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT NULL,
`r` varchar(10) CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT NULL
`l` varchar(10) CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT NULL,
`r` varchar(10) CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
select hex(l), hex(r) from t1;
hex(l) hex(r)
......@@ -240,7 +240,7 @@ select 'AMZ'like 'A%M%Z';
1
SET NAMES utf8;
SET character_set_connection=utf32;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32);
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32 COLLATE utf32_general_ci);
INSERT INTO t1 VALUES ('фыва'),('Фыва'),('фЫва'),('фыВа'),('фывА'),('ФЫВА');
INSERT INTO t1 VALUES ('фывапролдж'),('Фывапролдж'),('фЫвапролдж'),('фыВапролдж');
INSERT INTO t1 VALUES ('фывАпролдж'),('фываПролдж'),('фывапРолдж'),('фывапрОлдж');
......@@ -509,7 +509,7 @@ create table t1 (a enum('x','y','z') character set utf32);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('x','y','z') CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT NULL
`a` enum('x','y','z') CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
insert into t1 values ('x');
insert into t1 values ('y');
......@@ -523,7 +523,7 @@ alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('x','y','z','d','e','ä','ö','ü') CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT NULL
`a` enum('x','y','z','d','e','ä','ö','ü') CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
insert into t1 values ('D');
insert into t1 values ('E ');
......@@ -545,7 +545,7 @@ create table t1 (a set ('x','y','z','ä','ö','ü') character set utf32);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` set('x','y','z','ä','ö','ü') CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT NULL
`a` set('x','y','z','ä','ö','ü') CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
insert into t1 values ('x');
insert into t1 values ('y');
......@@ -1291,14 +1291,14 @@ Note 1246 Converting column 'a' from VARCHAR to TEXT
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` mediumtext CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT NULL
`a` mediumtext CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop table t1;
create table t1 (a varchar(250) character set utf32 primary key);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(250) CHARACTER SET utf32 COLLATE utf32_general_ci NOT NULL,
`a` varchar(250) CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
drop table t1;
......@@ -1425,6 +1425,9 @@ t
DROP TABLE t1;
SET NAMES latin1;
set collation_connection=utf32_general_ci;
#
# Bug#31081 server crash in regexp function
#
drop table if exists t1;
create table t1 as
select repeat(' ', 64) as s1, repeat(' ',64) as s2
......@@ -1528,11 +1531,11 @@ s4 LONGTEXT CHARACTER SET utf32
SET NAMES utf8mb4, @@character_set_results=NULL;
SELECT *, HEX(s1) FROM t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 s1 s1 252 255 0 Y 16 0 60
def test t1 t1 s2 s2 252 65535 0 Y 16 0 60
def test t1 t1 s3 s3 252 16777215 0 Y 16 0 60
def test t1 t1 s4 s4 252 4294967295 0 Y 16 0 60
def HEX(s1) 253 8160 0 Y 0 0 45
def test t1 t1 s1 s1 252 255 0 Y 16 0 160
def test t1 t1 s2 s2 252 65535 0 Y 16 0 160
def test t1 t1 s3 s3 252 16777215 0 Y 16 0 160
def test t1 t1 s4 s4 252 4294967295 0 Y 16 0 160
def HEX(s1) 253 8160 0 Y 0 0 224
s1 s2 s3 s4 HEX(s1)
SET NAMES latin1;
SELECT *, HEX(s1) FROM t1;
......@@ -1546,17 +1549,17 @@ s1 s2 s3 s4 HEX(s1)
SET NAMES utf8mb4;
SELECT *, HEX(s1) FROM t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 s1 s1 252 252 0 Y 16 0 45
def test t1 t1 s2 s2 252 65532 0 Y 16 0 45
def test t1 t1 s3 s3 252 16777212 0 Y 16 0 45
def test t1 t1 s4 s4 252 4294967292 0 Y 16 0 45
def HEX(s1) 253 8160 0 Y 0 0 45
def test t1 t1 s1 s1 252 252 0 Y 16 0 224
def test t1 t1 s2 s2 252 65532 0 Y 16 0 224
def test t1 t1 s3 s3 252 16777212 0 Y 16 0 224
def test t1 t1 s4 s4 252 4294967292 0 Y 16 0 224
def HEX(s1) 253 8160 0 Y 0 0 224
s1 s2 s3 s4 HEX(s1)
CREATE TABLE t2 AS SELECT CONCAT(s1) FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`CONCAT(s1)` varchar(255) CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT NULL
`CONCAT(s1)` varchar(255) CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1, t2;
#
......@@ -1933,11 +1936,11 @@ hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0))
select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0))
20AC20AC20AC00200020002000200020002000200020002000
select hex(weight_string(_utf32 0x10000));
hex(weight_string(_utf32 0x10000))
select hex(weight_string(_utf32 0x10000 collate utf32_general_ci));
hex(weight_string(_utf32 0x10000 collate utf32_general_ci))
FFFD
select hex(weight_string(_utf32 0x10001));
hex(weight_string(_utf32 0x10001))
select hex(weight_string(_utf32 0x10001 collate utf32_general_ci));
hex(weight_string(_utf32 0x10001 collate utf32_general_ci))
FFFD
select @@collation_connection;
@@collation_connection
......@@ -2287,14 +2290,14 @@ SET optimizer_switch=@save_optimizer_switch;
#
# MDEV-8419 utf32: compare broken bytes as "greater than any non-broken character"
#
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32, KEY(a));
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32 COLLATE utf32_general_ci, KEY(a));
INSERT INTO t1 VALUES (0x10000),(0x10001),(0x10002);
SELECT COUNT(DISTINCT a) FROM t1;
COUNT(DISTINCT a)
1
DROP TABLE t1;
SELECT _utf32 0x10001=_utf32 0x10002;
_utf32 0x10001=_utf32 0x10002
SELECT _utf32 0x10001=_utf32 0x10002 COLLATE utf32_general_ci;
_utf32 0x10001=_utf32 0x10002 COLLATE utf32_general_ci
1
#
# MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)
......@@ -3141,13 +3144,13 @@ ALTER TABLE t1 CHANGE a a ENUM('aa') CHARACTER SET utf32;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('慡') CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT NULL
`a` enum('慡') CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
ALTER TABLE t1 CHANGE a a ENUM('a','b') CHARACTER SET utf32;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('a','b') CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT NULL
`a` enum('a','b') CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
SET NAMES utf8;
......@@ -3161,8 +3164,8 @@ c2 ENUM ('a','b') CHARACTER SET utf32 DEFAULT 'a'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` enum('a','b') CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT 'a',
`c2` enum('a','b') CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT 'a'
`c1` enum('a','b') CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT 'a',
`c2` enum('a','b') CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT 'a'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
CREATE TABLE t1 (
......
......@@ -40,7 +40,7 @@ select hex(_utf32 X'103344');
# which contains 0x20 in the high byte.
#
CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf32;
CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf32 COLLATE utf32_general_ci;
INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004');
SELECT hex(word) FROM t1 ORDER BY word;
SELECT hex(word2) FROM t1 ORDER BY word2;
......@@ -99,7 +99,7 @@ SET character_set_connection=utf32;
SET NAMES utf8;
SET character_set_connection=utf32;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32);
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32 COLLATE utf32_general_ci);
INSERT INTO t1 VALUES ('фыва'),('Фыва'),('фЫва'),('фыВа'),('фывА'),('ФЫВА');
INSERT INTO t1 VALUES ('фывапролдж'),('Фывапролдж'),('фЫвапролдж'),('фыВапролдж');
INSERT INTO t1 VALUES ('фывАпролдж'),('фываПролдж'),('фывапРолдж'),('фывапрОлдж');
......@@ -950,8 +950,8 @@ set sql_mode=default;
set collation_connection=utf32_general_ci;
--source include/weight_string.inc
--source include/weight_string_euro.inc
select hex(weight_string(_utf32 0x10000));
select hex(weight_string(_utf32 0x10001));
select hex(weight_string(_utf32 0x10000 collate utf32_general_ci));
select hex(weight_string(_utf32 0x10001 collate utf32_general_ci));
--source include/weight_string_l1.inc
set collation_connection=utf32_bin;
......@@ -1017,11 +1017,11 @@ SET NAMEs utf8, character_set_connection=utf32;
--echo # MDEV-8419 utf32: compare broken bytes as "greater than any non-broken character"
--echo #
# Make sure that all non-BMP characters are compared as equal
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32, KEY(a));
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32 COLLATE utf32_general_ci, KEY(a));
INSERT INTO t1 VALUES (0x10000),(0x10001),(0x10002);
SELECT COUNT(DISTINCT a) FROM t1;
DROP TABLE t1;
SELECT _utf32 0x10001=_utf32 0x10002;
SELECT _utf32 0x10001=_utf32 0x10002 COLLATE utf32_general_ci;
--echo #
--echo # MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED)
......
......@@ -3108,6 +3108,9 @@ COUNT(*) c1
1 a
DROP TABLE IF EXISTS t1;
set collation_connection=utf32_unicode_ci;
#
# Bug#31081 server crash in regexp function
#
drop table if exists t1;
create table t1 as
select repeat(' ', 64) as s1, repeat(' ',64) as s2
......@@ -7951,7 +7954,7 @@ ALTER TABLE t1 CHANGE a a ENUM('a','b') CHARACTER SET utf32;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('a','b') CHARACTER SET utf32 COLLATE utf32_general_ci DEFAULT NULL
`a` enum('a','b') CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
SET NAMES utf8;
......
This diff is collapsed.
......@@ -16,6 +16,14 @@ SET TIME_ZONE='+03:00';
--source include/default_optimizer_switch.inc
--source include/default_charset.inc
#
# Remove the 'utf8mb3=xxx' substring from @@character_set_collations to change
# the default utf8mb3 collation to the hard-coded default utf8mb3_general_ci
#
SET character_set_collations= REGEXP_REPLACE(@@character_set_collations, '(utf8mb3=[a-z0-9_]*)', '');
SELECT @@character_set_collations;
--disable_warnings
drop table if exists t1,t2,t3,t4;
drop database if exists mysqltest;
......@@ -60,32 +68,6 @@ select convert(_latin1'G
select CONVERT(_koi8r'' USING utf8) LIKE CONVERT(_koi8r'' USING utf8);
select CONVERT(_koi8r'' USING utf8) LIKE CONVERT(_koi8r'' USING utf8);
#
# Check the following:
# "a" == "a "
# "a\0" < "a"
# "a\0" < "a "
SELECT 'a' = 'a ';
SELECT 'a\0' < 'a';
SELECT 'a\0' < 'a ';
SELECT 'a\t' < 'a';
SELECT 'a\t' < 'a ';
#
# The same for binary collation
#
SELECT 'a' = 'a ' collate utf8_bin;
SELECT 'a\0' < 'a' collate utf8_bin;
SELECT 'a\0' < 'a ' collate utf8_bin;
SELECT 'a\t' < 'a' collate utf8_bin;
SELECT 'a\t' < 'a ' collate utf8_bin;
CREATE TABLE t1 (a char(10) character set utf8 not null);
INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
DROP TABLE t1;
#
# Fix this, it should return 1:
#
......@@ -204,13 +186,6 @@ select * from t1 where a = 'b' and a = 'b';
select * from t1 where a = 'b' and a != 'b';
drop table t1;
#
# Testing regexp
#
set names utf8;
--source include/ctype_regex.inc
--source include/ctype_regex_utf8.inc
#
# Bug #4555
# ALTER TABLE crashes mysqld with enum column collated utf8_unicode_ci
......@@ -1761,16 +1736,6 @@ SET sql_mode=default;
--echo # WL#3664 WEIGHT_STRING
--echo #
set names utf8;
--source include/weight_string.inc
--source include/weight_string_euro.inc
--source include/weight_string_l1.inc
set @@collation_connection=utf8_bin;
--source include/weight_string.inc
--source include/weight_string_euro.inc
--source include/weight_string_l1.inc
--echo #
--echo # Checking strnxfrm() with odd length
--echo #
......@@ -1792,13 +1757,6 @@ set max_sort_length=default;
--echo # Start of 10.0 tests
--echo #
SET NAMES utf8 COLLATE utf8_bin;
--source include/ctype_like_cond_propagation.inc
SET NAMES utf8;
--source include/ctype_like_cond_propagation.inc
--source include/ctype_like_cond_propagation_utf8_german.inc
--echo #
--echo # MDEV-6666 Malformed result for CONCAT(utf8_column, binary_string)
--echo #
......
......@@ -52,7 +52,7 @@ SET @@character_set_database=DEFAULT;
# Emulate a pre-4.1 database without db.opt
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci */
USE db1;
SELECT @@character_set_database, 'taken from defaults' AS comment;
@@character_set_database comment
......
This diff is collapsed.
--echo #
--echo # Start of 5.5 tests
--echo #
SET NAMES utf8mb3 COLLATE utf8mb3_bin;
--source include/ctype_special_chars.inc
--echo #
--echo # End of 5.5 tests
--echo #
--echo #
--echo # Start of 5.6 tests
--echo #
--echo #
--echo # WL#3664 WEIGHT_STRING
--echo #
SET NAMES utf8mb3 COLLATE utf8mb3_bin;
--source include/weight_string.inc
--source include/weight_string_euro.inc
--source include/weight_string_l1.inc
--echo #
--echo # End of 5.6 tests
--echo #
--echo #
--echo # Start of 10.0 tests
--echo #
#
# Testing regexp
#
SET NAMES utf8mb3 COLLATE utf8mb3_bin;
--source include/ctype_regex.inc
--source include/ctype_regex_utf8.inc
#
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
#
--source include/ctype_like_cond_propagation.inc
--source include/ctype_like_cond_propagation_utf8_german.inc
--echo #
--echo # End of 10.0 tests
--echo #
This diff is collapsed.
--echo #
--echo # Start of 5.5 tests
--echo #
SET NAMES utf8mb3 COLLATE utf8mb3_general_ci;
--source include/ctype_special_chars.inc
--echo #
--echo # End of 5.5 tests
--echo #
--echo #
--echo # Start of 5.6 tests
--echo #
--echo #
--echo # WL#3664 WEIGHT_STRING
--echo #
SET NAMES utf8mb3 COLLATE utf8mb3_general_ci;
--source include/weight_string.inc
--source include/weight_string_euro.inc
--source include/weight_string_l1.inc
--echo #
--echo # End of 5.6 tests
--echo #
--echo #
--echo # Start of 10.0 tests
--echo #
#
# Testing regexp
#
SET NAMES utf8mb3 COLLATE utf8mb3_general_ci;
--source include/ctype_regex.inc
--source include/ctype_regex_utf8.inc
#
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
#
--source include/ctype_like_cond_propagation.inc
--source include/ctype_like_cond_propagation_utf8_german.inc
--echo #
--echo # End of 10.0 tests
--echo #
This diff is collapsed.
--echo #
--echo # Start of 5.5 tests
--echo #
SET NAMES utf8mb3 COLLATE uca1400_ai_ci;
--source include/ctype_special_chars.inc
--echo #
--echo # End of 5.5 tests
--echo #
--echo #
--echo # Start of 5.6 tests
--echo #
--echo #
--echo # WL#3664 WEIGHT_STRING
--echo #
SET NAMES utf8mb3 COLLATE uca1400_ai_ci;
--source include/weight_string.inc
--source include/weight_string_euro.inc
--source include/weight_string_l1.inc
--echo #
--echo # End of 5.6 tests
--echo #
--echo #
--echo # Start of 10.0 tests
--echo #
#
# Testing regexp
#
SET NAMES utf8mb3 COLLATE uca1400_ai_ci;
--source include/ctype_regex.inc
--source include/ctype_regex_utf8.inc
#
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
#
--source include/ctype_like_cond_propagation.inc
--source include/ctype_like_cond_propagation_utf8_german.inc
--echo #
--echo # End of 10.0 tests
--echo #
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2230,7 +2230,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
`b` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT `a`,
`c` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT convert(`a` using utf8mb3),
`c` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT convert(`a` using utf8mb3),
`d` varbinary(10) DEFAULT (cast(`a` as char charset binary))
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
INSERT INTO t1 (a) VALUES ('a');
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -1417,7 +1417,7 @@ e25388fde8290dc286a6164fa2d97e551b53498dcbf7bc378eb1f178
SET NAMES utf8;
SELECT sha2('1',224);
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def sha2('1',224) 253 168 56 Y 0 39 33
def sha2('1',224) 253 168 56 Y 0 39 192
sha2('1',224)
e25388fde8290dc286a6164fa2d97e551b53498dcbf7bc378eb1f178
SET NAMES latin1;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
drop table if exists t1;
set names latin1;
#
# Bug#31081 server crash in regexp function
#
drop table if exists t1;
create table t1 as
select repeat(' ', 64) as s1, repeat(' ',64) as s2
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment