mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-25829 Change default Unicode collation to uca1400_ai_ci
Step#3 The main patch
This commit is contained in:
@ -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
|
||||
|
@ -1,9 +1,9 @@
|
||||
#
|
||||
# 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';
|
||||
|
71
mysql-test/include/ctype_special_chars.inc
Normal file
71
mysql-test/include/ctype_special_chars.inc
Normal file
@ -0,0 +1,71 @@
|
||||
#
|
||||
# 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 '<27>') 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);
|
||||
|
@ -1,4 +1,2 @@
|
||||
-- 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
|
||||
|
@ -1,2 +0,0 @@
|
||||
Collation Charset Id Default Compiled Sortlen
|
||||
utf16_general_ci utf16 54 Yes Yes 1
|
@ -1,4 +1,2 @@
|
||||
-- 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
|
||||
|
@ -1,2 +0,0 @@
|
||||
Collation Charset Id Default Compiled Sortlen
|
||||
utf32_general_ci utf32 60 Yes Yes 1
|
@ -1,7 +1,2 @@
|
||||
--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
|
||||
|
@ -1,2 +0,0 @@
|
||||
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
|
||||
|
@ -868,7 +868,7 @@ ERROR HY000: Compressed column 'a' can't be used in key specification
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
# Make sure column was actually compressed
|
||||
INSERT INTO t1 VALUES(REPEAT('a', 1000));
|
||||
@ -904,7 +904,7 @@ ALTER TABLE t1 MODIFY COLUMN a TEXT COMPRESSED CHARSET ucs2;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT LEFT(a, 10), LENGTH(a) FROM t1;
|
||||
LEFT(a, 10) LENGTH(a)
|
||||
@ -921,7 +921,7 @@ CREATE TABLE t2 LIKE t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t2;
|
||||
# Make sure implicit CREATE TABLE ... SELECT inherits compression
|
||||
@ -929,7 +929,7 @@ CREATE TABLE t2 SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT LEFT(a, 10), LENGTH(a) FROM t2;
|
||||
LEFT(a, 10) LENGTH(a)
|
||||
@ -965,7 +965,7 @@ ALTER TABLE t1 ENGINE=InnoDB;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT LEFT(a, 10), LENGTH(a) FROM t1;
|
||||
LEFT(a, 10) LENGTH(a)
|
||||
@ -1483,7 +1483,7 @@ CREATE OR REPLACE TABLE t1 (a VARCHAR(1000) COMPRESSED CHARACTER SET utf8);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(1000) /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`a` varchar(1000) /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
|
||||
@ -1559,14 +1559,14 @@ CREATE TABLE t1 (a VARCHAR(10) COMPRESSED UNICODE);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
|
||||
`a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
#
|
||||
@ -1598,14 +1598,14 @@ CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8 DEFAULT '');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT ''
|
||||
`a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a VARCHAR(10) COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100)));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
|
||||
`a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
#
|
||||
@ -1689,14 +1689,14 @@ CREATE TABLE t1 (a TINYTEXT COMPRESSED UNICODE);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
|
||||
`a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
#
|
||||
@ -1728,14 +1728,14 @@ CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8 DEFAULT '');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT ''
|
||||
`a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a TINYTEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100)));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
|
||||
`a` tinytext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
#
|
||||
@ -1819,14 +1819,14 @@ CREATE TABLE t1 (a TEXT COMPRESSED UNICODE);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
#
|
||||
@ -1858,14 +1858,14 @@ CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8 DEFAULT '');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT ''
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a TEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100)));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
|
||||
`a` text /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
#
|
||||
@ -1949,14 +1949,14 @@ CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED UNICODE);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
|
||||
`a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
#
|
||||
@ -1988,14 +1988,14 @@ CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8 DEFAULT '');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT ''
|
||||
`a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a MEDIUMTEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100)));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
|
||||
`a` mediumtext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
#
|
||||
@ -2079,14 +2079,14 @@ CREATE TABLE t1 (a LONGTEXT COMPRESSED UNICODE);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` longtext /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
|
||||
`a` longtext /*!100301 COMPRESSED*/ CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`a` longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
#
|
||||
@ -2118,14 +2118,14 @@ CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8 DEFAULT '');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT ''
|
||||
`a` longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a LONGTEXT COMPRESSED CHARACTER SET utf8 GENERATED ALWAYS AS (REPEAT('a',100)));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
|
||||
`a` longtext /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci GENERATED ALWAYS AS (repeat('a',100)) VIRTUAL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
#
|
||||
@ -2481,7 +2481,7 @@ CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED);
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`a` varchar(10) /*!100301 COMPRESSED*/ CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a NVARCHAR(10) COMPRESSED BINARY COMPRESSED);
|
||||
|
@ -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
|
||||
|
@ -1,3 +1,4 @@
|
||||
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
|
||||
#
|
||||
|
@ -1,5 +1,6 @@
|
||||
--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;
|
||||
|
@ -219,7 +219,7 @@ z LAT CAPIT Z 2
|
||||
э CYR CAPIT E 2
|
||||
ю CYR CAPIT YU 2
|
||||
я CYR CAPIT YA 2
|
||||
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;
|
||||
@ -1721,44 +1721,44 @@ SELECT CHARSET(CONCAT(utf8, utf8mb4)) FROM t1;
|
||||
CHARSET(CONCAT(utf8, utf8mb4))
|
||||
utf8mb4
|
||||
SELECT CHARSET(CONCAT(utf8, ucs2)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf8mb3_general_ci,IMPLICIT) and (ucs2_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf8mb3_uca1400_ai_ci,IMPLICIT) and (ucs2_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(utf8, utf16)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf8mb3_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf8mb3_uca1400_ai_ci,IMPLICIT) and (utf16_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(utf8, utf32)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf8mb3_general_ci,IMPLICIT) and (utf32_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf8mb3_uca1400_ai_ci,IMPLICIT) and (utf32_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(utf8mb4, utf8)) FROM t1;
|
||||
CHARSET(CONCAT(utf8mb4, utf8))
|
||||
utf8mb4
|
||||
SELECT CHARSET(CONCAT(utf8mb4, ucs2)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (ucs2_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_uca1400_ai_ci,IMPLICIT) and (ucs2_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(utf8mb4, utf16)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_uca1400_ai_ci,IMPLICIT) and (utf16_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(utf8mb4, utf32)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf32_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_uca1400_ai_ci,IMPLICIT) and (utf32_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(ucs2, utf8)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (ucs2_general_ci,IMPLICIT) and (utf8mb3_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (ucs2_uca1400_ai_ci,IMPLICIT) and (utf8mb3_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(ucs2, utf8mb4)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (ucs2_general_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (ucs2_uca1400_ai_ci,IMPLICIT) and (utf8mb4_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(ucs2, utf16)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (ucs2_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (ucs2_uca1400_ai_ci,IMPLICIT) and (utf16_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(ucs2, utf32)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (ucs2_general_ci,IMPLICIT) and (utf32_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (ucs2_uca1400_ai_ci,IMPLICIT) and (utf32_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(utf16, utf8)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf16_general_ci,IMPLICIT) and (utf8mb3_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf16_uca1400_ai_ci,IMPLICIT) and (utf8mb3_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(utf16, ucs2)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf16_general_ci,IMPLICIT) and (ucs2_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf16_uca1400_ai_ci,IMPLICIT) and (ucs2_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(utf16, utf8mb4)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf16_general_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf16_uca1400_ai_ci,IMPLICIT) and (utf8mb4_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(utf16, utf32)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf16_general_ci,IMPLICIT) and (utf32_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf16_uca1400_ai_ci,IMPLICIT) and (utf32_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(utf32, utf8)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (utf8mb3_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf32_uca1400_ai_ci,IMPLICIT) and (utf8mb3_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(utf32, ucs2)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (ucs2_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf32_uca1400_ai_ci,IMPLICIT) and (ucs2_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(utf32, utf8mb4)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf32_uca1400_ai_ci,IMPLICIT) and (utf8mb4_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
SELECT CHARSET(CONCAT(utf32, utf16)) FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf32_uca1400_ai_ci,IMPLICIT) and (utf16_uca1400_ai_ci,IMPLICIT) for operation 'concat'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#58321 No warning when characters outside BMP0 is converted to UCS2
|
||||
|
@ -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'<27>',_koi8r'<27>'), (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','<27>','<27>','<27>') CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
|
||||
`a` enum('x','y','z','d','e','<27>','<27>','<27>') 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','<27>','<27>','<27>') CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
|
||||
`a` set('x','y','z','<27>','<27>','<27>') 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'<27>',_koi8r'<27>'), (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;
|
||||
|
@ -1,4 +1,8 @@
|
||||
SET TIME_ZONE='+03:00';
|
||||
SET character_set_collations= REGEXP_REPLACE(@@character_set_collations, '(utf8mb3=[a-z0-9_]*)', '');
|
||||
SELECT @@character_set_collations;
|
||||
@@character_set_collations
|
||||
ucs2=ucs2_uca1400_ai_ci,utf8mb4=utf8mb4_uca1400_ai_ci,utf16=utf16_uca1400_ai_ci,utf32=utf32_uca1400_ai_ci
|
||||
drop table if exists t1,t2,t3,t4;
|
||||
drop database if exists mysqltest;
|
||||
drop table if exists t1,t2;
|
||||
@ -75,45 +79,6 @@ CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8) LIKE CONVERT(_koi8r'\xF7\xE1\xF3\xF
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8);
|
||||
CONVERT(_koi8r'\xF7\xE1\xF3\xF1' USING utf8) LIKE CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8)
|
||||
1
|
||||
SELECT 'a' = 'a ';
|
||||
'a' = 'a '
|
||||
1
|
||||
SELECT 'a\0' < 'a';
|
||||
'a\0' < 'a'
|
||||
1
|
||||
SELECT 'a\0' < 'a ';
|
||||
'a\0' < 'a '
|
||||
1
|
||||
SELECT 'a\t' < 'a';
|
||||
'a\t' < 'a'
|
||||
1
|
||||
SELECT 'a\t' < 'a ';
|
||||
'a\t' < 'a '
|
||||
1
|
||||
SELECT 'a' = 'a ' collate utf8_bin;
|
||||
'a' = 'a ' collate utf8_bin
|
||||
1
|
||||
SELECT 'a\0' < 'a' collate utf8_bin;
|
||||
'a\0' < 'a' collate utf8_bin
|
||||
1
|
||||
SELECT 'a\0' < 'a ' collate utf8_bin;
|
||||
'a\0' < 'a ' collate utf8_bin
|
||||
1
|
||||
SELECT 'a\t' < 'a' collate utf8_bin;
|
||||
'a\t' < 'a' collate utf8_bin
|
||||
1
|
||||
SELECT 'a\t' < 'a ' collate utf8_bin;
|
||||
'a\t' < 'a ' collate utf8_bin
|
||||
1
|
||||
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;
|
||||
hex(a) STRCMP(a,'a') STRCMP(a,'a ')
|
||||
61 0 0
|
||||
6100 -1 -1
|
||||
6109 -1 -1
|
||||
61 0 0
|
||||
DROP TABLE t1;
|
||||
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
|
||||
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
|
||||
this is test
|
||||
@ -270,95 +235,6 @@ b
|
||||
select * from t1 where a = 'b' and a != 'b';
|
||||
a
|
||||
drop table t1;
|
||||
set names utf8;
|
||||
drop table if exists t1;
|
||||
create table t1 as
|
||||
select repeat(' ', 64) as s1, repeat(' ',64) as s2
|
||||
union
|
||||
select null, null;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`s1` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`s2` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
delete from t1;
|
||||
insert into t1 values('aaa','aaa');
|
||||
insert into t1 values('aaa|qqq','qqq');
|
||||
insert into t1 values('gheis','^[^a-dXYZ]+$');
|
||||
insert into t1 values('aab','^aa?b');
|
||||
insert into t1 values('Baaan','^Ba*n');
|
||||
insert into t1 values('aaa','qqq|aaa');
|
||||
insert into t1 values('qqq','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq');
|
||||
insert into t1 values('aaa','aba');
|
||||
insert into t1 values(null,'abc');
|
||||
insert into t1 values('def',null);
|
||||
insert into t1 values(null,null);
|
||||
insert into t1 values('ghi','ghi[');
|
||||
select HIGH_PRIORITY s1 regexp s2 from t1;
|
||||
s1 regexp s2
|
||||
0
|
||||
0
|
||||
0
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
SELECT @@character_set_client, @@collation_connection;
|
||||
@@character_set_client @@collation_connection
|
||||
utf8mb3 utf8mb3_general_ci
|
||||
select 'вася' rlike '\\bвася\\b';
|
||||
'вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася ' rlike '\\bвася\\b';
|
||||
'вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася' rlike '\\bвася\\b';
|
||||
' вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася ' rlike '\\bвася\\b';
|
||||
' вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select 'васяz' rlike '\\bвася\\b';
|
||||
'васяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвася' rlike '\\bвася\\b';
|
||||
'zвася' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвасяz' rlike '\\bвася\\b';
|
||||
'zвасяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'васяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвася' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8_unicode_ci);
|
||||
ALTER TABLE t1 ADD COLUMN b CHAR(20);
|
||||
DROP TABLE t1;
|
||||
@ -1819,7 +1695,7 @@ SET CHARACTER SET utf8;
|
||||
SHOW VARIABLES LIKE 'character\_set\_%';
|
||||
Variable_name Value
|
||||
character_set_client utf8mb3
|
||||
character_set_collations
|
||||
character_set_collations ucs2=ucs2_uca1400_ai_ci,utf8mb4=utf8mb4_uca1400_ai_ci,utf16=utf16_uca1400_ai_ci,utf32=utf32_uca1400_ai_ci
|
||||
character_set_connection latin1
|
||||
character_set_database latin1
|
||||
character_set_filesystem binary
|
||||
@ -6270,494 +6146,6 @@ SET sql_mode=default;
|
||||
#
|
||||
# WL#3664 WEIGHT_STRING
|
||||
#
|
||||
set names utf8;
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb3_general_ci
|
||||
CREATE TABLE t1 AS SELECT 'a' AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
0041
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
0041
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(5) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(10) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
00410041004100410041
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
00410041004100410041
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(3)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(6) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(3))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(3)))
|
||||
004100410041
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
004100410041
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(10)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(20) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(10)))
|
||||
0041004100410041004100200020002000200020
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
0041004100410041004100200020002000200020
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
select hex(weight_string('a'));
|
||||
hex(weight_string('a'))
|
||||
0041
|
||||
select hex(weight_string('A'));
|
||||
hex(weight_string('A'))
|
||||
0041
|
||||
select hex(weight_string('abc'));
|
||||
hex(weight_string('abc'))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(2)));
|
||||
hex(weight_string('abc' as char(2)))
|
||||
00410042
|
||||
select hex(weight_string('abc' as char(3)));
|
||||
hex(weight_string('abc' as char(3)))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(5)));
|
||||
hex(weight_string('abc' as char(5)))
|
||||
00410042004300200020
|
||||
select hex(weight_string('abc', 1, 2, 0xC0));
|
||||
hex(weight_string('abc', 1, 2, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 2, 0xC0));
|
||||
hex(weight_string('abc', 2, 2, 0xC0))
|
||||
0041
|
||||
select hex(weight_string('abc', 3, 2, 0xC0));
|
||||
hex(weight_string('abc', 3, 2, 0xC0))
|
||||
004100
|
||||
select hex(weight_string('abc', 4, 2, 0xC0));
|
||||
hex(weight_string('abc', 4, 2, 0xC0))
|
||||
00410042
|
||||
select hex(weight_string('abc', 5, 2, 0xC0));
|
||||
hex(weight_string('abc', 5, 2, 0xC0))
|
||||
0041004200
|
||||
select hex(weight_string('abc',25, 2, 0xC0));
|
||||
hex(weight_string('abc',25, 2, 0xC0))
|
||||
00410042002000200020002000200020002000200020002000
|
||||
select hex(weight_string('abc', 1, 3, 0xC0));
|
||||
hex(weight_string('abc', 1, 3, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 3, 0xC0));
|
||||
hex(weight_string('abc', 2, 3, 0xC0))
|
||||
0041
|
||||
select hex(weight_string('abc', 3, 3, 0xC0));
|
||||
hex(weight_string('abc', 3, 3, 0xC0))
|
||||
004100
|
||||
select hex(weight_string('abc', 4, 3, 0xC0));
|
||||
hex(weight_string('abc', 4, 3, 0xC0))
|
||||
00410042
|
||||
select hex(weight_string('abc', 5, 3, 0xC0));
|
||||
hex(weight_string('abc', 5, 3, 0xC0))
|
||||
0041004200
|
||||
select hex(weight_string('abc',25, 3, 0xC0));
|
||||
hex(weight_string('abc',25, 3, 0xC0))
|
||||
00410042004300200020002000200020002000200020002000
|
||||
select hex(weight_string('abc', 1, 4, 0xC0));
|
||||
hex(weight_string('abc', 1, 4, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 4, 0xC0));
|
||||
hex(weight_string('abc', 2, 4, 0xC0))
|
||||
0041
|
||||
select hex(weight_string('abc', 3, 4, 0xC0));
|
||||
hex(weight_string('abc', 3, 4, 0xC0))
|
||||
004100
|
||||
select hex(weight_string('abc', 4, 4, 0xC0));
|
||||
hex(weight_string('abc', 4, 4, 0xC0))
|
||||
00410042
|
||||
select hex(weight_string('abc', 5, 4, 0xC0));
|
||||
hex(weight_string('abc', 5, 4, 0xC0))
|
||||
0041004200
|
||||
select hex(weight_string('abc',25, 4, 0xC0));
|
||||
hex(weight_string('abc',25, 4, 0xC0))
|
||||
00410042004300200020002000200020002000200020002000
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb3_general_ci
|
||||
select hex(weight_string(cast(_latin1 0x80 as char)));
|
||||
hex(weight_string(cast(_latin1 0x80 as char)))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char)))
|
||||
20AC20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(2)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(2)))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(3)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(3)))
|
||||
20AC20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(5)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(5)))
|
||||
20AC20AC20AC00200020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0))
|
||||
20AC20AC00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0))
|
||||
20AC20AC002000200020002000200020002000200020002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0))
|
||||
20AC20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0))
|
||||
20AC20AC20AC00200020002000200020002000200020002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0))
|
||||
20AC20AC20
|
||||
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 @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb3_general_ci
|
||||
select hex(weight_string('a' LEVEL 1));
|
||||
hex(weight_string('a' LEVEL 1))
|
||||
0041
|
||||
select hex(weight_string('A' LEVEL 1));
|
||||
hex(weight_string('A' LEVEL 1))
|
||||
0041
|
||||
select hex(weight_string('abc' LEVEL 1));
|
||||
hex(weight_string('abc' LEVEL 1))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(2) LEVEL 1));
|
||||
hex(weight_string('abc' as char(2) LEVEL 1))
|
||||
00410042
|
||||
select hex(weight_string('abc' as char(3) LEVEL 1));
|
||||
hex(weight_string('abc' as char(3) LEVEL 1))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1))
|
||||
00410042004300200020
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
|
||||
20002000430042004100
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
|
||||
FFBEFFBDFFBCFFDFFFDF
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
|
||||
DFFFDFFFBCFFBDFFBEFF
|
||||
set @@collation_connection=utf8_bin;
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb3_bin
|
||||
CREATE TABLE t1 AS SELECT 'a' AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
0061
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
0061
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(5) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(10) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
00610061006100610061
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
00610061006100610061
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(3)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(6) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(3))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(3)))
|
||||
006100610061
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
006100610061
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(10)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(20) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(10)))
|
||||
0061006100610061006100200020002000200020
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
0061006100610061006100200020002000200020
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
select hex(weight_string('a'));
|
||||
hex(weight_string('a'))
|
||||
0061
|
||||
select hex(weight_string('A'));
|
||||
hex(weight_string('A'))
|
||||
0041
|
||||
select hex(weight_string('abc'));
|
||||
hex(weight_string('abc'))
|
||||
006100620063
|
||||
select hex(weight_string('abc' as char(2)));
|
||||
hex(weight_string('abc' as char(2)))
|
||||
00610062
|
||||
select hex(weight_string('abc' as char(3)));
|
||||
hex(weight_string('abc' as char(3)))
|
||||
006100620063
|
||||
select hex(weight_string('abc' as char(5)));
|
||||
hex(weight_string('abc' as char(5)))
|
||||
00610062006300200020
|
||||
select hex(weight_string('abc', 1, 2, 0xC0));
|
||||
hex(weight_string('abc', 1, 2, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 2, 0xC0));
|
||||
hex(weight_string('abc', 2, 2, 0xC0))
|
||||
0061
|
||||
select hex(weight_string('abc', 3, 2, 0xC0));
|
||||
hex(weight_string('abc', 3, 2, 0xC0))
|
||||
006100
|
||||
select hex(weight_string('abc', 4, 2, 0xC0));
|
||||
hex(weight_string('abc', 4, 2, 0xC0))
|
||||
00610062
|
||||
select hex(weight_string('abc', 5, 2, 0xC0));
|
||||
hex(weight_string('abc', 5, 2, 0xC0))
|
||||
0061006200
|
||||
select hex(weight_string('abc',25, 2, 0xC0));
|
||||
hex(weight_string('abc',25, 2, 0xC0))
|
||||
00610062002000200020002000200020002000200020002000
|
||||
select hex(weight_string('abc', 1, 3, 0xC0));
|
||||
hex(weight_string('abc', 1, 3, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 3, 0xC0));
|
||||
hex(weight_string('abc', 2, 3, 0xC0))
|
||||
0061
|
||||
select hex(weight_string('abc', 3, 3, 0xC0));
|
||||
hex(weight_string('abc', 3, 3, 0xC0))
|
||||
006100
|
||||
select hex(weight_string('abc', 4, 3, 0xC0));
|
||||
hex(weight_string('abc', 4, 3, 0xC0))
|
||||
00610062
|
||||
select hex(weight_string('abc', 5, 3, 0xC0));
|
||||
hex(weight_string('abc', 5, 3, 0xC0))
|
||||
0061006200
|
||||
select hex(weight_string('abc',25, 3, 0xC0));
|
||||
hex(weight_string('abc',25, 3, 0xC0))
|
||||
00610062006300200020002000200020002000200020002000
|
||||
select hex(weight_string('abc', 1, 4, 0xC0));
|
||||
hex(weight_string('abc', 1, 4, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 4, 0xC0));
|
||||
hex(weight_string('abc', 2, 4, 0xC0))
|
||||
0061
|
||||
select hex(weight_string('abc', 3, 4, 0xC0));
|
||||
hex(weight_string('abc', 3, 4, 0xC0))
|
||||
006100
|
||||
select hex(weight_string('abc', 4, 4, 0xC0));
|
||||
hex(weight_string('abc', 4, 4, 0xC0))
|
||||
00610062
|
||||
select hex(weight_string('abc', 5, 4, 0xC0));
|
||||
hex(weight_string('abc', 5, 4, 0xC0))
|
||||
0061006200
|
||||
select hex(weight_string('abc',25, 4, 0xC0));
|
||||
hex(weight_string('abc',25, 4, 0xC0))
|
||||
00610062006300200020002000200020002000200020002000
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb3_bin
|
||||
select hex(weight_string(cast(_latin1 0x80 as char)));
|
||||
hex(weight_string(cast(_latin1 0x80 as char)))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char)))
|
||||
20AC20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(2)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(2)))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(3)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(3)))
|
||||
20AC20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(5)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(5)))
|
||||
20AC20AC20AC00200020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0))
|
||||
20AC20AC00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0))
|
||||
20AC20AC002000200020002000200020002000200020002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0))
|
||||
20AC20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0))
|
||||
20AC20AC20AC00200020002000200020002000200020002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0))
|
||||
20AC20AC20
|
||||
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 @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb3_bin
|
||||
select hex(weight_string('a' LEVEL 1));
|
||||
hex(weight_string('a' LEVEL 1))
|
||||
0061
|
||||
select hex(weight_string('A' LEVEL 1));
|
||||
hex(weight_string('A' LEVEL 1))
|
||||
0041
|
||||
select hex(weight_string('abc' LEVEL 1));
|
||||
hex(weight_string('abc' LEVEL 1))
|
||||
006100620063
|
||||
select hex(weight_string('abc' as char(2) LEVEL 1));
|
||||
hex(weight_string('abc' as char(2) LEVEL 1))
|
||||
00610062
|
||||
select hex(weight_string('abc' as char(3) LEVEL 1));
|
||||
hex(weight_string('abc' as char(3) LEVEL 1))
|
||||
006100620063
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1))
|
||||
00610062006300200020
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
|
||||
20002000630062006100
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
|
||||
FF9EFF9DFF9CFFDFFFDF
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
|
||||
DFFFDFFF9CFF9DFF9EFF
|
||||
#
|
||||
# Checking strnxfrm() with odd length
|
||||
#
|
||||
@ -6788,285 +6176,6 @@ set max_sort_length=default;
|
||||
#
|
||||
# Start of 10.0 tests
|
||||
#
|
||||
SET NAMES utf8 COLLATE utf8_bin;
|
||||
#
|
||||
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
|
||||
#
|
||||
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_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('a'),('a ');
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='a';
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
|
||||
DROP TABLE t1;
|
||||
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_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('a'),('a ');
|
||||
SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
|
||||
#
|
||||
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_bin 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 ';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,octet_length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and `test`.`t1`.`a` not like 'a '
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of MDEV-8694
|
||||
#
|
||||
SET NAMES utf8;
|
||||
#
|
||||
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
|
||||
#
|
||||
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
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('a'),('a ');
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='a';
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
|
||||
DROP TABLE t1;
|
||||
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
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('a'),('a ');
|
||||
SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
|
||||
#
|
||||
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
|
||||
) 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 ';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,octet_length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` not like 'a ' and `test`.`t1`.`a` = 'a'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of MDEV-8694
|
||||
#
|
||||
#
|
||||
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
|
||||
#
|
||||
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
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('ae'),('ä');
|
||||
SELECT * FROM t1 WHERE c1='ä';
|
||||
c1
|
||||
ä
|
||||
SELECT * FROM t1 WHERE c1 LIKE 'ae';
|
||||
c1
|
||||
ae
|
||||
SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae';
|
||||
c1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where `test`.`t1`.`c1` = 'ä' and `test`.`t1`.`c1` like 'ae'
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='ä';
|
||||
c1
|
||||
ä
|
||||
SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'ae';
|
||||
c1
|
||||
ae
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae';
|
||||
c1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'ä' and concat(`test`.`t1`.`c1`) like 'ae'
|
||||
DROP TABLE IF EXISTS t1;
|
||||
#
|
||||
# MDEV-6666 Malformed result for CONCAT(utf8_column, binary_string)
|
||||
#
|
||||
|
@ -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'<27><><EFBFBD><EFBFBD>' USING utf8) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8);
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' 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
|
||||
|
622
mysql-test/main/ctype_utf8mb3_bin.result
Normal file
622
mysql-test/main/ctype_utf8mb3_bin.result
Normal file
@ -0,0 +1,622 @@
|
||||
#
|
||||
# Start of 5.5 tests
|
||||
#
|
||||
SET NAMES utf8mb3 COLLATE utf8mb3_bin;
|
||||
SELECT COLLATION('a');
|
||||
COLLATION('a')
|
||||
utf8mb3_bin
|
||||
SELECT 'a' = 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\0' = 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' = 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' = 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' = 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a' < 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' < 'a' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\0' < 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\t' < 'a' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\t' < 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' > 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' > 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS a LIMIT 0;
|
||||
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;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
|
||||
`a_readable` text CHARACTER SET utf8mb3 COLLATE utf8mb3_bin GENERATED ALWAYS AS (rpad(quote(regexp_replace(`a`,'(\\x{00}|\\x{09})','.')),10)) VIRTUAL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 (a) VALUES ('a'),('a\0'),('a\t'),('a ');
|
||||
SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
|
||||
hex(a) STRCMP(a,'a') STRCMP(a,'a ')
|
||||
61 0 0
|
||||
6100 -1 -1
|
||||
6109 -1 -1
|
||||
6120 0 0
|
||||
SELECT HEX(a), a_readable FROM t1 ORDER BY a, BINARY a;
|
||||
HEX(a) a_readable
|
||||
6100 'a.'
|
||||
6109 'a.'
|
||||
61 'a'
|
||||
6120 '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;
|
||||
t1a cmp t2a a_readable a_readable
|
||||
61 = 61 'a' 'a'
|
||||
61 > 6100 'a' 'a.'
|
||||
61 > 6109 'a' 'a.'
|
||||
61 = 6120 'a' 'a '
|
||||
6100 < 61 'a.' 'a'
|
||||
6100 = 6100 'a.' 'a.'
|
||||
6100 < 6109 'a.' 'a.'
|
||||
6100 < 6120 'a.' 'a '
|
||||
6109 < 61 'a.' 'a'
|
||||
6109 > 6100 'a.' 'a.'
|
||||
6109 = 6109 'a.' 'a.'
|
||||
6109 < 6120 'a.' 'a '
|
||||
6120 = 61 'a ' 'a'
|
||||
6120 > 6100 'a ' 'a.'
|
||||
6120 > 6109 'a ' 'a.'
|
||||
6120 = 6120 'a ' 'a '
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
#
|
||||
# Start of 5.6 tests
|
||||
#
|
||||
#
|
||||
# WL#3664 WEIGHT_STRING
|
||||
#
|
||||
SET NAMES utf8mb3 COLLATE utf8mb3_bin;
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb3_bin
|
||||
CREATE TABLE t1 AS SELECT 'a' AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
0061
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
0061
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(5) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(10) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
00610061006100610061
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
00610061006100610061
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(3)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(6) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(3))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(3)))
|
||||
006100610061
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
006100610061
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(10)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(20) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(10)))
|
||||
0061006100610061006100200020002000200020
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
0061006100610061006100200020002000200020
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
select hex(weight_string('a'));
|
||||
hex(weight_string('a'))
|
||||
0061
|
||||
select hex(weight_string('A'));
|
||||
hex(weight_string('A'))
|
||||
0041
|
||||
select hex(weight_string('abc'));
|
||||
hex(weight_string('abc'))
|
||||
006100620063
|
||||
select hex(weight_string('abc' as char(2)));
|
||||
hex(weight_string('abc' as char(2)))
|
||||
00610062
|
||||
select hex(weight_string('abc' as char(3)));
|
||||
hex(weight_string('abc' as char(3)))
|
||||
006100620063
|
||||
select hex(weight_string('abc' as char(5)));
|
||||
hex(weight_string('abc' as char(5)))
|
||||
00610062006300200020
|
||||
select hex(weight_string('abc', 1, 2, 0xC0));
|
||||
hex(weight_string('abc', 1, 2, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 2, 0xC0));
|
||||
hex(weight_string('abc', 2, 2, 0xC0))
|
||||
0061
|
||||
select hex(weight_string('abc', 3, 2, 0xC0));
|
||||
hex(weight_string('abc', 3, 2, 0xC0))
|
||||
006100
|
||||
select hex(weight_string('abc', 4, 2, 0xC0));
|
||||
hex(weight_string('abc', 4, 2, 0xC0))
|
||||
00610062
|
||||
select hex(weight_string('abc', 5, 2, 0xC0));
|
||||
hex(weight_string('abc', 5, 2, 0xC0))
|
||||
0061006200
|
||||
select hex(weight_string('abc',25, 2, 0xC0));
|
||||
hex(weight_string('abc',25, 2, 0xC0))
|
||||
00610062002000200020002000200020002000200020002000
|
||||
select hex(weight_string('abc', 1, 3, 0xC0));
|
||||
hex(weight_string('abc', 1, 3, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 3, 0xC0));
|
||||
hex(weight_string('abc', 2, 3, 0xC0))
|
||||
0061
|
||||
select hex(weight_string('abc', 3, 3, 0xC0));
|
||||
hex(weight_string('abc', 3, 3, 0xC0))
|
||||
006100
|
||||
select hex(weight_string('abc', 4, 3, 0xC0));
|
||||
hex(weight_string('abc', 4, 3, 0xC0))
|
||||
00610062
|
||||
select hex(weight_string('abc', 5, 3, 0xC0));
|
||||
hex(weight_string('abc', 5, 3, 0xC0))
|
||||
0061006200
|
||||
select hex(weight_string('abc',25, 3, 0xC0));
|
||||
hex(weight_string('abc',25, 3, 0xC0))
|
||||
00610062006300200020002000200020002000200020002000
|
||||
select hex(weight_string('abc', 1, 4, 0xC0));
|
||||
hex(weight_string('abc', 1, 4, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 4, 0xC0));
|
||||
hex(weight_string('abc', 2, 4, 0xC0))
|
||||
0061
|
||||
select hex(weight_string('abc', 3, 4, 0xC0));
|
||||
hex(weight_string('abc', 3, 4, 0xC0))
|
||||
006100
|
||||
select hex(weight_string('abc', 4, 4, 0xC0));
|
||||
hex(weight_string('abc', 4, 4, 0xC0))
|
||||
00610062
|
||||
select hex(weight_string('abc', 5, 4, 0xC0));
|
||||
hex(weight_string('abc', 5, 4, 0xC0))
|
||||
0061006200
|
||||
select hex(weight_string('abc',25, 4, 0xC0));
|
||||
hex(weight_string('abc',25, 4, 0xC0))
|
||||
00610062006300200020002000200020002000200020002000
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb3_bin
|
||||
select hex(weight_string(cast(_latin1 0x80 as char)));
|
||||
hex(weight_string(cast(_latin1 0x80 as char)))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char)))
|
||||
20AC20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(2)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(2)))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(3)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(3)))
|
||||
20AC20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(5)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(5)))
|
||||
20AC20AC20AC00200020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0))
|
||||
20AC20AC00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0))
|
||||
20AC20AC002000200020002000200020002000200020002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0))
|
||||
20AC20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0))
|
||||
20AC20AC20AC00200020002000200020002000200020002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0))
|
||||
20AC20AC20
|
||||
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 @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb3_bin
|
||||
select hex(weight_string('a' LEVEL 1));
|
||||
hex(weight_string('a' LEVEL 1))
|
||||
0061
|
||||
select hex(weight_string('A' LEVEL 1));
|
||||
hex(weight_string('A' LEVEL 1))
|
||||
0041
|
||||
select hex(weight_string('abc' LEVEL 1));
|
||||
hex(weight_string('abc' LEVEL 1))
|
||||
006100620063
|
||||
select hex(weight_string('abc' as char(2) LEVEL 1));
|
||||
hex(weight_string('abc' as char(2) LEVEL 1))
|
||||
00610062
|
||||
select hex(weight_string('abc' as char(3) LEVEL 1));
|
||||
hex(weight_string('abc' as char(3) LEVEL 1))
|
||||
006100620063
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1))
|
||||
00610062006300200020
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
|
||||
20002000630062006100
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
|
||||
FF9EFF9DFF9CFFDFFFDF
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
|
||||
DFFFDFFF9CFF9DFF9EFF
|
||||
#
|
||||
# End of 5.6 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.0 tests
|
||||
#
|
||||
SET NAMES utf8mb3 COLLATE utf8mb3_bin;
|
||||
#
|
||||
# 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
|
||||
union
|
||||
select null, null;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`s1` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
|
||||
`s2` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
delete from t1;
|
||||
insert into t1 values('aaa','aaa');
|
||||
insert into t1 values('aaa|qqq','qqq');
|
||||
insert into t1 values('gheis','^[^a-dXYZ]+$');
|
||||
insert into t1 values('aab','^aa?b');
|
||||
insert into t1 values('Baaan','^Ba*n');
|
||||
insert into t1 values('aaa','qqq|aaa');
|
||||
insert into t1 values('qqq','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq');
|
||||
insert into t1 values('aaa','aba');
|
||||
insert into t1 values(null,'abc');
|
||||
insert into t1 values('def',null);
|
||||
insert into t1 values(null,null);
|
||||
insert into t1 values('ghi','ghi[');
|
||||
select HIGH_PRIORITY s1 regexp s2 from t1;
|
||||
s1 regexp s2
|
||||
0
|
||||
0
|
||||
0
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
#
|
||||
# Bug #3928 regexp [[:>:]] and UTF-8
|
||||
#
|
||||
SELECT @@character_set_client, @@collation_connection;
|
||||
@@character_set_client @@collation_connection
|
||||
utf8mb3 utf8mb3_bin
|
||||
# This should return TRUE
|
||||
select 'вася' rlike '\\bвася\\b';
|
||||
'вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася ' rlike '\\bвася\\b';
|
||||
'вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася' rlike '\\bвася\\b';
|
||||
' вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася ' rlike '\\bвася\\b';
|
||||
' вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
# This should return FALSE
|
||||
select 'васяz' rlike '\\bвася\\b';
|
||||
'васяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвася' rlike '\\bвася\\b';
|
||||
'zвася' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвасяz' rlike '\\bвася\\b';
|
||||
'zвасяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'васяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвася' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
#
|
||||
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
|
||||
#
|
||||
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_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('a'),('a ');
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='a';
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
|
||||
DROP TABLE t1;
|
||||
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_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('a'),('a ');
|
||||
SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
|
||||
#
|
||||
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_bin 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 ';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,octet_length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and `test`.`t1`.`a` not like 'a '
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of MDEV-8694
|
||||
#
|
||||
#
|
||||
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
|
||||
#
|
||||
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_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('ae'),('ä');
|
||||
SELECT * FROM t1 WHERE c1='ä';
|
||||
c1
|
||||
ä
|
||||
SELECT * FROM t1 WHERE c1 LIKE 'ae';
|
||||
c1
|
||||
ae
|
||||
SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae';
|
||||
c1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where `test`.`t1`.`c1` = 'ä' and `test`.`t1`.`c1` like 'ae'
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='ä';
|
||||
c1
|
||||
ä
|
||||
SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'ae';
|
||||
c1
|
||||
ae
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae';
|
||||
c1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'ä' and concat(`test`.`t1`.`c1`) like 'ae'
|
||||
DROP TABLE IF EXISTS t1;
|
||||
#
|
||||
# End of 10.0 tests
|
||||
#
|
52
mysql-test/main/ctype_utf8mb3_bin.test
Normal file
52
mysql-test/main/ctype_utf8mb3_bin.test
Normal file
@ -0,0 +1,52 @@
|
||||
--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 #
|
622
mysql-test/main/ctype_utf8mb3_general_ci.result
Normal file
622
mysql-test/main/ctype_utf8mb3_general_ci.result
Normal file
@ -0,0 +1,622 @@
|
||||
#
|
||||
# Start of 5.5 tests
|
||||
#
|
||||
SET NAMES utf8mb3 COLLATE utf8mb3_general_ci;
|
||||
SELECT COLLATION('a');
|
||||
COLLATION('a')
|
||||
utf8mb3_general_ci
|
||||
SELECT 'a' = 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\0' = 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' = 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' = 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' = 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a' < 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' < 'a' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\0' < 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\t' < 'a' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\t' < 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' > 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' > 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS a LIMIT 0;
|
||||
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;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`a_readable` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci GENERATED ALWAYS AS (rpad(quote(regexp_replace(`a`,'(\\x{00}|\\x{09})','.')),10)) VIRTUAL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 (a) VALUES ('a'),('a\0'),('a\t'),('a ');
|
||||
SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
|
||||
hex(a) STRCMP(a,'a') STRCMP(a,'a ')
|
||||
61 0 0
|
||||
6100 -1 -1
|
||||
6109 -1 -1
|
||||
6120 0 0
|
||||
SELECT HEX(a), a_readable FROM t1 ORDER BY a, BINARY a;
|
||||
HEX(a) a_readable
|
||||
6100 'a.'
|
||||
6109 'a.'
|
||||
61 'a'
|
||||
6120 '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;
|
||||
t1a cmp t2a a_readable a_readable
|
||||
61 = 61 'a' 'a'
|
||||
61 > 6100 'a' 'a.'
|
||||
61 > 6109 'a' 'a.'
|
||||
61 = 6120 'a' 'a '
|
||||
6100 < 61 'a.' 'a'
|
||||
6100 = 6100 'a.' 'a.'
|
||||
6100 < 6109 'a.' 'a.'
|
||||
6100 < 6120 'a.' 'a '
|
||||
6109 < 61 'a.' 'a'
|
||||
6109 > 6100 'a.' 'a.'
|
||||
6109 = 6109 'a.' 'a.'
|
||||
6109 < 6120 'a.' 'a '
|
||||
6120 = 61 'a ' 'a'
|
||||
6120 > 6100 'a ' 'a.'
|
||||
6120 > 6109 'a ' 'a.'
|
||||
6120 = 6120 'a ' 'a '
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
#
|
||||
# Start of 5.6 tests
|
||||
#
|
||||
#
|
||||
# WL#3664 WEIGHT_STRING
|
||||
#
|
||||
SET NAMES utf8mb3 COLLATE utf8mb3_general_ci;
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb3_general_ci
|
||||
CREATE TABLE t1 AS SELECT 'a' AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
0041
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
0041
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(5) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(10) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
00410041004100410041
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
00410041004100410041
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(3)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(6) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(3))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(3)))
|
||||
004100410041
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
004100410041
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(10)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(20) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(10)))
|
||||
0041004100410041004100200020002000200020
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
0041004100410041004100200020002000200020
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
select hex(weight_string('a'));
|
||||
hex(weight_string('a'))
|
||||
0041
|
||||
select hex(weight_string('A'));
|
||||
hex(weight_string('A'))
|
||||
0041
|
||||
select hex(weight_string('abc'));
|
||||
hex(weight_string('abc'))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(2)));
|
||||
hex(weight_string('abc' as char(2)))
|
||||
00410042
|
||||
select hex(weight_string('abc' as char(3)));
|
||||
hex(weight_string('abc' as char(3)))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(5)));
|
||||
hex(weight_string('abc' as char(5)))
|
||||
00410042004300200020
|
||||
select hex(weight_string('abc', 1, 2, 0xC0));
|
||||
hex(weight_string('abc', 1, 2, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 2, 0xC0));
|
||||
hex(weight_string('abc', 2, 2, 0xC0))
|
||||
0041
|
||||
select hex(weight_string('abc', 3, 2, 0xC0));
|
||||
hex(weight_string('abc', 3, 2, 0xC0))
|
||||
004100
|
||||
select hex(weight_string('abc', 4, 2, 0xC0));
|
||||
hex(weight_string('abc', 4, 2, 0xC0))
|
||||
00410042
|
||||
select hex(weight_string('abc', 5, 2, 0xC0));
|
||||
hex(weight_string('abc', 5, 2, 0xC0))
|
||||
0041004200
|
||||
select hex(weight_string('abc',25, 2, 0xC0));
|
||||
hex(weight_string('abc',25, 2, 0xC0))
|
||||
00410042002000200020002000200020002000200020002000
|
||||
select hex(weight_string('abc', 1, 3, 0xC0));
|
||||
hex(weight_string('abc', 1, 3, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 3, 0xC0));
|
||||
hex(weight_string('abc', 2, 3, 0xC0))
|
||||
0041
|
||||
select hex(weight_string('abc', 3, 3, 0xC0));
|
||||
hex(weight_string('abc', 3, 3, 0xC0))
|
||||
004100
|
||||
select hex(weight_string('abc', 4, 3, 0xC0));
|
||||
hex(weight_string('abc', 4, 3, 0xC0))
|
||||
00410042
|
||||
select hex(weight_string('abc', 5, 3, 0xC0));
|
||||
hex(weight_string('abc', 5, 3, 0xC0))
|
||||
0041004200
|
||||
select hex(weight_string('abc',25, 3, 0xC0));
|
||||
hex(weight_string('abc',25, 3, 0xC0))
|
||||
00410042004300200020002000200020002000200020002000
|
||||
select hex(weight_string('abc', 1, 4, 0xC0));
|
||||
hex(weight_string('abc', 1, 4, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 4, 0xC0));
|
||||
hex(weight_string('abc', 2, 4, 0xC0))
|
||||
0041
|
||||
select hex(weight_string('abc', 3, 4, 0xC0));
|
||||
hex(weight_string('abc', 3, 4, 0xC0))
|
||||
004100
|
||||
select hex(weight_string('abc', 4, 4, 0xC0));
|
||||
hex(weight_string('abc', 4, 4, 0xC0))
|
||||
00410042
|
||||
select hex(weight_string('abc', 5, 4, 0xC0));
|
||||
hex(weight_string('abc', 5, 4, 0xC0))
|
||||
0041004200
|
||||
select hex(weight_string('abc',25, 4, 0xC0));
|
||||
hex(weight_string('abc',25, 4, 0xC0))
|
||||
00410042004300200020002000200020002000200020002000
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb3_general_ci
|
||||
select hex(weight_string(cast(_latin1 0x80 as char)));
|
||||
hex(weight_string(cast(_latin1 0x80 as char)))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char)))
|
||||
20AC20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(2)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(2)))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(3)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(3)))
|
||||
20AC20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(5)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(5)))
|
||||
20AC20AC20AC00200020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0))
|
||||
20AC20AC00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0))
|
||||
20AC20AC002000200020002000200020002000200020002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0))
|
||||
20AC20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0))
|
||||
20AC20AC20AC00200020002000200020002000200020002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0))
|
||||
20AC20AC20
|
||||
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 @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb3_general_ci
|
||||
select hex(weight_string('a' LEVEL 1));
|
||||
hex(weight_string('a' LEVEL 1))
|
||||
0041
|
||||
select hex(weight_string('A' LEVEL 1));
|
||||
hex(weight_string('A' LEVEL 1))
|
||||
0041
|
||||
select hex(weight_string('abc' LEVEL 1));
|
||||
hex(weight_string('abc' LEVEL 1))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(2) LEVEL 1));
|
||||
hex(weight_string('abc' as char(2) LEVEL 1))
|
||||
00410042
|
||||
select hex(weight_string('abc' as char(3) LEVEL 1));
|
||||
hex(weight_string('abc' as char(3) LEVEL 1))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1))
|
||||
00410042004300200020
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
|
||||
20002000430042004100
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
|
||||
FFBEFFBDFFBCFFDFFFDF
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
|
||||
DFFFDFFFBCFFBDFFBEFF
|
||||
#
|
||||
# End of 5.6 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.0 tests
|
||||
#
|
||||
SET NAMES utf8mb3 COLLATE utf8mb3_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
|
||||
union
|
||||
select null, null;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`s1` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`s2` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
delete from t1;
|
||||
insert into t1 values('aaa','aaa');
|
||||
insert into t1 values('aaa|qqq','qqq');
|
||||
insert into t1 values('gheis','^[^a-dXYZ]+$');
|
||||
insert into t1 values('aab','^aa?b');
|
||||
insert into t1 values('Baaan','^Ba*n');
|
||||
insert into t1 values('aaa','qqq|aaa');
|
||||
insert into t1 values('qqq','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq');
|
||||
insert into t1 values('aaa','aba');
|
||||
insert into t1 values(null,'abc');
|
||||
insert into t1 values('def',null);
|
||||
insert into t1 values(null,null);
|
||||
insert into t1 values('ghi','ghi[');
|
||||
select HIGH_PRIORITY s1 regexp s2 from t1;
|
||||
s1 regexp s2
|
||||
0
|
||||
0
|
||||
0
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
#
|
||||
# Bug #3928 regexp [[:>:]] and UTF-8
|
||||
#
|
||||
SELECT @@character_set_client, @@collation_connection;
|
||||
@@character_set_client @@collation_connection
|
||||
utf8mb3 utf8mb3_general_ci
|
||||
# This should return TRUE
|
||||
select 'вася' rlike '\\bвася\\b';
|
||||
'вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася ' rlike '\\bвася\\b';
|
||||
'вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася' rlike '\\bвася\\b';
|
||||
' вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася ' rlike '\\bвася\\b';
|
||||
' вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
# This should return FALSE
|
||||
select 'васяz' rlike '\\bвася\\b';
|
||||
'васяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвася' rlike '\\bвася\\b';
|
||||
'zвася' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвасяz' rlike '\\bвася\\b';
|
||||
'zвасяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'васяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвася' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
#
|
||||
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
|
||||
#
|
||||
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
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('a'),('a ');
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='a';
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
|
||||
DROP TABLE t1;
|
||||
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
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('a'),('a ');
|
||||
SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
|
||||
#
|
||||
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
|
||||
) 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 ';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,octet_length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` not like 'a ' and `test`.`t1`.`a` = 'a'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of MDEV-8694
|
||||
#
|
||||
#
|
||||
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
|
||||
#
|
||||
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
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('ae'),('ä');
|
||||
SELECT * FROM t1 WHERE c1='ä';
|
||||
c1
|
||||
ä
|
||||
SELECT * FROM t1 WHERE c1 LIKE 'ae';
|
||||
c1
|
||||
ae
|
||||
SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae';
|
||||
c1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where `test`.`t1`.`c1` = 'ä' and `test`.`t1`.`c1` like 'ae'
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='ä';
|
||||
c1
|
||||
ä
|
||||
SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'ae';
|
||||
c1
|
||||
ae
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae';
|
||||
c1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'ä' and concat(`test`.`t1`.`c1`) like 'ae'
|
||||
DROP TABLE IF EXISTS t1;
|
||||
#
|
||||
# End of 10.0 tests
|
||||
#
|
52
mysql-test/main/ctype_utf8mb3_general_ci.test
Normal file
52
mysql-test/main/ctype_utf8mb3_general_ci.test
Normal file
@ -0,0 +1,52 @@
|
||||
--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 #
|
622
mysql-test/main/ctype_utf8mb3_uca1400_ai_ci.result
Normal file
622
mysql-test/main/ctype_utf8mb3_uca1400_ai_ci.result
Normal file
@ -0,0 +1,622 @@
|
||||
#
|
||||
# Start of 5.5 tests
|
||||
#
|
||||
SET NAMES utf8mb3 COLLATE uca1400_ai_ci;
|
||||
SELECT COLLATION('a');
|
||||
COLLATION('a')
|
||||
utf8mb3_uca1400_ai_ci
|
||||
SELECT 'a' = 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\0' = 'a' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\0' = 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\t' = 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' = 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a' < 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' < 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' < 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' < 'a' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\t' < 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' > 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' > 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS a LIMIT 0;
|
||||
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;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`a_readable` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci GENERATED ALWAYS AS (rpad(quote(regexp_replace(`a`,'(\\x{00}|\\x{09})','.')),10)) VIRTUAL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 (a) VALUES ('a'),('a\0'),('a\t'),('a ');
|
||||
SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
|
||||
hex(a) STRCMP(a,'a') STRCMP(a,'a ')
|
||||
61 0 0
|
||||
6100 0 0
|
||||
6109 -1 -1
|
||||
6120 0 0
|
||||
SELECT HEX(a), a_readable FROM t1 ORDER BY a, BINARY a;
|
||||
HEX(a) a_readable
|
||||
6109 'a.'
|
||||
61 'a'
|
||||
6100 'a.'
|
||||
6120 '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;
|
||||
t1a cmp t2a a_readable a_readable
|
||||
61 = 61 'a' 'a'
|
||||
61 = 6100 'a' 'a.'
|
||||
61 > 6109 'a' 'a.'
|
||||
61 = 6120 'a' 'a '
|
||||
6100 = 61 'a.' 'a'
|
||||
6100 = 6100 'a.' 'a.'
|
||||
6100 > 6109 'a.' 'a.'
|
||||
6100 = 6120 'a.' 'a '
|
||||
6109 < 61 'a.' 'a'
|
||||
6109 < 6100 'a.' 'a.'
|
||||
6109 = 6109 'a.' 'a.'
|
||||
6109 < 6120 'a.' 'a '
|
||||
6120 = 61 'a ' 'a'
|
||||
6120 = 6100 'a ' 'a.'
|
||||
6120 > 6109 'a ' 'a.'
|
||||
6120 = 6120 'a ' 'a '
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
#
|
||||
# Start of 5.6 tests
|
||||
#
|
||||
#
|
||||
# WL#3664 WEIGHT_STRING
|
||||
#
|
||||
SET NAMES utf8mb3 COLLATE uca1400_ai_ci;
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb3_uca1400_ai_ci
|
||||
CREATE TABLE t1 AS SELECT 'a' AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(16) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
2075
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
2075
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(5) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(80) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
20752075207520752075
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
20752075207520752075
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(3)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(48) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(3))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(3)))
|
||||
207520752075
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
207520752075
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(10)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(160) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(10)))
|
||||
2075207520752075207502090209020902090209
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
2075207520752075207502090209020902090209
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
select hex(weight_string('a'));
|
||||
hex(weight_string('a'))
|
||||
2075
|
||||
select hex(weight_string('A'));
|
||||
hex(weight_string('A'))
|
||||
2075
|
||||
select hex(weight_string('abc'));
|
||||
hex(weight_string('abc'))
|
||||
2075208F20A9
|
||||
select hex(weight_string('abc' as char(2)));
|
||||
hex(weight_string('abc' as char(2)))
|
||||
2075208F
|
||||
select hex(weight_string('abc' as char(3)));
|
||||
hex(weight_string('abc' as char(3)))
|
||||
2075208F20A9
|
||||
select hex(weight_string('abc' as char(5)));
|
||||
hex(weight_string('abc' as char(5)))
|
||||
2075208F20A902090209
|
||||
select hex(weight_string('abc', 1, 2, 0xC0));
|
||||
hex(weight_string('abc', 1, 2, 0xC0))
|
||||
20
|
||||
select hex(weight_string('abc', 2, 2, 0xC0));
|
||||
hex(weight_string('abc', 2, 2, 0xC0))
|
||||
2075
|
||||
select hex(weight_string('abc', 3, 2, 0xC0));
|
||||
hex(weight_string('abc', 3, 2, 0xC0))
|
||||
207520
|
||||
select hex(weight_string('abc', 4, 2, 0xC0));
|
||||
hex(weight_string('abc', 4, 2, 0xC0))
|
||||
2075208F
|
||||
select hex(weight_string('abc', 5, 2, 0xC0));
|
||||
hex(weight_string('abc', 5, 2, 0xC0))
|
||||
2075208F02
|
||||
select hex(weight_string('abc',25, 2, 0xC0));
|
||||
hex(weight_string('abc',25, 2, 0xC0))
|
||||
2075208F020902090209020902090209020902090209020902
|
||||
select hex(weight_string('abc', 1, 3, 0xC0));
|
||||
hex(weight_string('abc', 1, 3, 0xC0))
|
||||
20
|
||||
select hex(weight_string('abc', 2, 3, 0xC0));
|
||||
hex(weight_string('abc', 2, 3, 0xC0))
|
||||
2075
|
||||
select hex(weight_string('abc', 3, 3, 0xC0));
|
||||
hex(weight_string('abc', 3, 3, 0xC0))
|
||||
207520
|
||||
select hex(weight_string('abc', 4, 3, 0xC0));
|
||||
hex(weight_string('abc', 4, 3, 0xC0))
|
||||
2075208F
|
||||
select hex(weight_string('abc', 5, 3, 0xC0));
|
||||
hex(weight_string('abc', 5, 3, 0xC0))
|
||||
2075208F20
|
||||
select hex(weight_string('abc',25, 3, 0xC0));
|
||||
hex(weight_string('abc',25, 3, 0xC0))
|
||||
2075208F20A902090209020902090209020902090209020902
|
||||
select hex(weight_string('abc', 1, 4, 0xC0));
|
||||
hex(weight_string('abc', 1, 4, 0xC0))
|
||||
20
|
||||
select hex(weight_string('abc', 2, 4, 0xC0));
|
||||
hex(weight_string('abc', 2, 4, 0xC0))
|
||||
2075
|
||||
select hex(weight_string('abc', 3, 4, 0xC0));
|
||||
hex(weight_string('abc', 3, 4, 0xC0))
|
||||
207520
|
||||
select hex(weight_string('abc', 4, 4, 0xC0));
|
||||
hex(weight_string('abc', 4, 4, 0xC0))
|
||||
2075208F
|
||||
select hex(weight_string('abc', 5, 4, 0xC0));
|
||||
hex(weight_string('abc', 5, 4, 0xC0))
|
||||
2075208F20
|
||||
select hex(weight_string('abc',25, 4, 0xC0));
|
||||
hex(weight_string('abc',25, 4, 0xC0))
|
||||
2075208F20A902090209020902090209020902090209020902
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb3_uca1400_ai_ci
|
||||
select hex(weight_string(cast(_latin1 0x80 as char)));
|
||||
hex(weight_string(cast(_latin1 0x80 as char)))
|
||||
2055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char)))
|
||||
205520552055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(2)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(2)))
|
||||
20552055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(3)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(3)))
|
||||
205520552055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(5)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(5)))
|
||||
20552055205502090209
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0))
|
||||
2055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0))
|
||||
205520
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0))
|
||||
20552055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0))
|
||||
2055205502
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0))
|
||||
20552055020902090209020902090209020902090209020902
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0))
|
||||
2055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0))
|
||||
205520
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0))
|
||||
20552055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0))
|
||||
2055205520
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0))
|
||||
20552055205502090209020902090209020902090209020902
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0))
|
||||
2055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0))
|
||||
205520
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0))
|
||||
20552055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0))
|
||||
2055205520
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0))
|
||||
20552055205502090209020902090209020902090209020902
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb3_uca1400_ai_ci
|
||||
select hex(weight_string('a' LEVEL 1));
|
||||
hex(weight_string('a' LEVEL 1))
|
||||
2075
|
||||
select hex(weight_string('A' LEVEL 1));
|
||||
hex(weight_string('A' LEVEL 1))
|
||||
2075
|
||||
select hex(weight_string('abc' LEVEL 1));
|
||||
hex(weight_string('abc' LEVEL 1))
|
||||
2075208F20A9
|
||||
select hex(weight_string('abc' as char(2) LEVEL 1));
|
||||
hex(weight_string('abc' as char(2) LEVEL 1))
|
||||
2075208F
|
||||
select hex(weight_string('abc' as char(3) LEVEL 1));
|
||||
hex(weight_string('abc' as char(3) LEVEL 1))
|
||||
2075208F20A9
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1))
|
||||
2075208F20A902090209
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
|
||||
09020902A9208F207520
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
|
||||
DF8ADF70DF56FDF6FDF6
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
|
||||
F6FDF6FD56DF70DF8ADF
|
||||
#
|
||||
# End of 5.6 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.0 tests
|
||||
#
|
||||
SET NAMES utf8mb3 COLLATE uca1400_ai_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
|
||||
union
|
||||
select null, null;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`s1` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`s2` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
delete from t1;
|
||||
insert into t1 values('aaa','aaa');
|
||||
insert into t1 values('aaa|qqq','qqq');
|
||||
insert into t1 values('gheis','^[^a-dXYZ]+$');
|
||||
insert into t1 values('aab','^aa?b');
|
||||
insert into t1 values('Baaan','^Ba*n');
|
||||
insert into t1 values('aaa','qqq|aaa');
|
||||
insert into t1 values('qqq','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq');
|
||||
insert into t1 values('aaa','aba');
|
||||
insert into t1 values(null,'abc');
|
||||
insert into t1 values('def',null);
|
||||
insert into t1 values(null,null);
|
||||
insert into t1 values('ghi','ghi[');
|
||||
select HIGH_PRIORITY s1 regexp s2 from t1;
|
||||
s1 regexp s2
|
||||
0
|
||||
0
|
||||
0
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
#
|
||||
# Bug #3928 regexp [[:>:]] and UTF-8
|
||||
#
|
||||
SELECT @@character_set_client, @@collation_connection;
|
||||
@@character_set_client @@collation_connection
|
||||
utf8mb3 utf8mb3_uca1400_ai_ci
|
||||
# This should return TRUE
|
||||
select 'вася' rlike '\\bвася\\b';
|
||||
'вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася ' rlike '\\bвася\\b';
|
||||
'вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася' rlike '\\bвася\\b';
|
||||
' вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася ' rlike '\\bвася\\b';
|
||||
' вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
# This should return FALSE
|
||||
select 'васяz' rlike '\\bвася\\b';
|
||||
'васяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвася' rlike '\\bвася\\b';
|
||||
'zвася' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвасяz' rlike '\\bвася\\b';
|
||||
'zвасяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'васяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвася' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
#
|
||||
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
|
||||
#
|
||||
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_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';
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
|
||||
DROP TABLE t1;
|
||||
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_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);
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
|
||||
#
|
||||
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_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 ';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,octet_length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` not like 'a ' and `test`.`t1`.`a` = 'a'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of MDEV-8694
|
||||
#
|
||||
#
|
||||
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
|
||||
#
|
||||
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_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('ae'),('ä');
|
||||
SELECT * FROM t1 WHERE c1='ä';
|
||||
c1
|
||||
ä
|
||||
SELECT * FROM t1 WHERE c1 LIKE 'ae';
|
||||
c1
|
||||
ae
|
||||
SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae';
|
||||
c1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where `test`.`t1`.`c1` = 'ä' and `test`.`t1`.`c1` like 'ae'
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='ä';
|
||||
c1
|
||||
ä
|
||||
SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'ae';
|
||||
c1
|
||||
ae
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae';
|
||||
c1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'ä' and concat(`test`.`t1`.`c1`) like 'ae'
|
||||
DROP TABLE IF EXISTS t1;
|
||||
#
|
||||
# End of 10.0 tests
|
||||
#
|
52
mysql-test/main/ctype_utf8mb3_uca1400_ai_ci.test
Normal file
52
mysql-test/main/ctype_utf8mb3_uca1400_ai_ci.test
Normal file
@ -0,0 +1,52 @@
|
||||
--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 #
|
@ -1,3 +1,7 @@
|
||||
SET character_set_collations= REGEXP_REPLACE(@@character_set_collations, '(utf8mb[34]=[a-z0-9_]*)', '');
|
||||
SELECT @@character_set_collations;
|
||||
@@character_set_collations
|
||||
ucs2=ucs2_uca1400_ai_ci,utf16=utf16_uca1400_ai_ci,utf32=utf32_uca1400_ai_ci
|
||||
drop table if exists t1,t2;
|
||||
#
|
||||
# Start of 5.5 tests
|
||||
@ -75,45 +79,6 @@ CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4) LIKE CONVERT(_koi8r'\xF7\xE1\xF3
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4);
|
||||
CONVERT(_koi8r'\xF7\xE1\xF3\xF1' USING utf8mb4) LIKE CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4)
|
||||
1
|
||||
SELECT 'a' = 'a ';
|
||||
'a' = 'a '
|
||||
1
|
||||
SELECT 'a\0' < 'a';
|
||||
'a\0' < 'a'
|
||||
1
|
||||
SELECT 'a\0' < 'a ';
|
||||
'a\0' < 'a '
|
||||
1
|
||||
SELECT 'a\t' < 'a';
|
||||
'a\t' < 'a'
|
||||
1
|
||||
SELECT 'a\t' < 'a ';
|
||||
'a\t' < 'a '
|
||||
1
|
||||
SELECT 'a' = 'a ' collate utf8mb4_bin;
|
||||
'a' = 'a ' collate utf8mb4_bin
|
||||
1
|
||||
SELECT 'a\0' < 'a' collate utf8mb4_bin;
|
||||
'a\0' < 'a' collate utf8mb4_bin
|
||||
1
|
||||
SELECT 'a\0' < 'a ' collate utf8mb4_bin;
|
||||
'a\0' < 'a ' collate utf8mb4_bin
|
||||
1
|
||||
SELECT 'a\t' < 'a' collate utf8mb4_bin;
|
||||
'a\t' < 'a' collate utf8mb4_bin
|
||||
1
|
||||
SELECT 'a\t' < 'a ' collate utf8mb4_bin;
|
||||
'a\t' < 'a ' collate utf8mb4_bin
|
||||
1
|
||||
CREATE TABLE t1 (a char(10) character set utf8mb4 not null);
|
||||
INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
|
||||
SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
|
||||
hex(a) STRCMP(a,'a') STRCMP(a,'a ')
|
||||
61 0 0
|
||||
6100 -1 -1
|
||||
6109 -1 -1
|
||||
61 0 0
|
||||
DROP TABLE t1;
|
||||
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
|
||||
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
|
||||
this is test
|
||||
@ -270,95 +235,6 @@ b
|
||||
select * from t1 where a = 'b' and a != 'b';
|
||||
a
|
||||
drop table t1;
|
||||
set names utf8mb4;
|
||||
drop table if exists t1;
|
||||
create table t1 as
|
||||
select repeat(' ', 64) as s1, repeat(' ',64) as s2
|
||||
union
|
||||
select null, null;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`s1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`s2` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
delete from t1;
|
||||
insert into t1 values('aaa','aaa');
|
||||
insert into t1 values('aaa|qqq','qqq');
|
||||
insert into t1 values('gheis','^[^a-dXYZ]+$');
|
||||
insert into t1 values('aab','^aa?b');
|
||||
insert into t1 values('Baaan','^Ba*n');
|
||||
insert into t1 values('aaa','qqq|aaa');
|
||||
insert into t1 values('qqq','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq');
|
||||
insert into t1 values('aaa','aba');
|
||||
insert into t1 values(null,'abc');
|
||||
insert into t1 values('def',null);
|
||||
insert into t1 values(null,null);
|
||||
insert into t1 values('ghi','ghi[');
|
||||
select HIGH_PRIORITY s1 regexp s2 from t1;
|
||||
s1 regexp s2
|
||||
0
|
||||
0
|
||||
0
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
SELECT @@character_set_client, @@collation_connection;
|
||||
@@character_set_client @@collation_connection
|
||||
utf8mb4 utf8mb4_general_ci
|
||||
select 'вася' rlike '\\bвася\\b';
|
||||
'вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася ' rlike '\\bвася\\b';
|
||||
'вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася' rlike '\\bвася\\b';
|
||||
' вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася ' rlike '\\bвася\\b';
|
||||
' вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select 'васяz' rlike '\\bвася\\b';
|
||||
'васяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвася' rlike '\\bвася\\b';
|
||||
'zвася' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвасяz' rlike '\\bвася\\b';
|
||||
'zвасяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'васяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвася' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8mb4_unicode_ci);
|
||||
ALTER TABLE t1 ADD COLUMN b CHAR(20);
|
||||
DROP TABLE t1;
|
||||
@ -1844,7 +1720,7 @@ SET CHARACTER SET utf8mb4;
|
||||
SHOW VARIABLES LIKE 'character\_set\_%';
|
||||
Variable_name Value
|
||||
character_set_client utf8mb4
|
||||
character_set_collations
|
||||
character_set_collations ucs2=ucs2_uca1400_ai_ci,utf16=utf16_uca1400_ai_ci,utf32=utf32_uca1400_ai_ci
|
||||
character_set_connection latin1
|
||||
character_set_database latin1
|
||||
character_set_filesystem binary
|
||||
@ -2908,500 +2784,6 @@ DROP TABLE t1;
|
||||
# End of 5.5 tests
|
||||
#
|
||||
#
|
||||
# WL#3664 WEIGHT_STRING
|
||||
#
|
||||
set names utf8mb4;
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb4_general_ci
|
||||
CREATE TABLE t1 AS SELECT 'a' AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
0041
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
0041
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(10) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
00410041004100410041
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
00410041004100410041
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(3)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(6) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(3))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(3)))
|
||||
004100410041
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
004100410041
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(10)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(20) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(10)))
|
||||
0041004100410041004100200020002000200020
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
0041004100410041004100200020002000200020
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
select hex(weight_string('a'));
|
||||
hex(weight_string('a'))
|
||||
0041
|
||||
select hex(weight_string('A'));
|
||||
hex(weight_string('A'))
|
||||
0041
|
||||
select hex(weight_string('abc'));
|
||||
hex(weight_string('abc'))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(2)));
|
||||
hex(weight_string('abc' as char(2)))
|
||||
00410042
|
||||
select hex(weight_string('abc' as char(3)));
|
||||
hex(weight_string('abc' as char(3)))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(5)));
|
||||
hex(weight_string('abc' as char(5)))
|
||||
00410042004300200020
|
||||
select hex(weight_string('abc', 1, 2, 0xC0));
|
||||
hex(weight_string('abc', 1, 2, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 2, 0xC0));
|
||||
hex(weight_string('abc', 2, 2, 0xC0))
|
||||
0041
|
||||
select hex(weight_string('abc', 3, 2, 0xC0));
|
||||
hex(weight_string('abc', 3, 2, 0xC0))
|
||||
004100
|
||||
select hex(weight_string('abc', 4, 2, 0xC0));
|
||||
hex(weight_string('abc', 4, 2, 0xC0))
|
||||
00410042
|
||||
select hex(weight_string('abc', 5, 2, 0xC0));
|
||||
hex(weight_string('abc', 5, 2, 0xC0))
|
||||
0041004200
|
||||
select hex(weight_string('abc',25, 2, 0xC0));
|
||||
hex(weight_string('abc',25, 2, 0xC0))
|
||||
00410042002000200020002000200020002000200020002000
|
||||
select hex(weight_string('abc', 1, 3, 0xC0));
|
||||
hex(weight_string('abc', 1, 3, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 3, 0xC0));
|
||||
hex(weight_string('abc', 2, 3, 0xC0))
|
||||
0041
|
||||
select hex(weight_string('abc', 3, 3, 0xC0));
|
||||
hex(weight_string('abc', 3, 3, 0xC0))
|
||||
004100
|
||||
select hex(weight_string('abc', 4, 3, 0xC0));
|
||||
hex(weight_string('abc', 4, 3, 0xC0))
|
||||
00410042
|
||||
select hex(weight_string('abc', 5, 3, 0xC0));
|
||||
hex(weight_string('abc', 5, 3, 0xC0))
|
||||
0041004200
|
||||
select hex(weight_string('abc',25, 3, 0xC0));
|
||||
hex(weight_string('abc',25, 3, 0xC0))
|
||||
00410042004300200020002000200020002000200020002000
|
||||
select hex(weight_string('abc', 1, 4, 0xC0));
|
||||
hex(weight_string('abc', 1, 4, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 4, 0xC0));
|
||||
hex(weight_string('abc', 2, 4, 0xC0))
|
||||
0041
|
||||
select hex(weight_string('abc', 3, 4, 0xC0));
|
||||
hex(weight_string('abc', 3, 4, 0xC0))
|
||||
004100
|
||||
select hex(weight_string('abc', 4, 4, 0xC0));
|
||||
hex(weight_string('abc', 4, 4, 0xC0))
|
||||
00410042
|
||||
select hex(weight_string('abc', 5, 4, 0xC0));
|
||||
hex(weight_string('abc', 5, 4, 0xC0))
|
||||
0041004200
|
||||
select hex(weight_string('abc',25, 4, 0xC0));
|
||||
hex(weight_string('abc',25, 4, 0xC0))
|
||||
00410042004300200020002000200020002000200020002000
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb4_general_ci
|
||||
select hex(weight_string(cast(_latin1 0x80 as char)));
|
||||
hex(weight_string(cast(_latin1 0x80 as char)))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char)))
|
||||
20AC20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(2)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(2)))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(3)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(3)))
|
||||
20AC20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(5)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(5)))
|
||||
20AC20AC20AC00200020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0))
|
||||
20AC20AC00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0))
|
||||
20AC20AC002000200020002000200020002000200020002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0))
|
||||
20AC20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0))
|
||||
20AC20AC20AC00200020002000200020002000200020002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0))
|
||||
20AC20AC20
|
||||
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 @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb4_general_ci
|
||||
select hex(weight_string('a' LEVEL 1));
|
||||
hex(weight_string('a' LEVEL 1))
|
||||
0041
|
||||
select hex(weight_string('A' LEVEL 1));
|
||||
hex(weight_string('A' LEVEL 1))
|
||||
0041
|
||||
select hex(weight_string('abc' LEVEL 1));
|
||||
hex(weight_string('abc' LEVEL 1))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(2) LEVEL 1));
|
||||
hex(weight_string('abc' as char(2) LEVEL 1))
|
||||
00410042
|
||||
select hex(weight_string('abc' as char(3) LEVEL 1));
|
||||
hex(weight_string('abc' as char(3) LEVEL 1))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1))
|
||||
00410042004300200020
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
|
||||
20002000430042004100
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
|
||||
FFBEFFBDFFBCFFDFFFDF
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
|
||||
DFFFDFFFBCFFBDFFBEFF
|
||||
set @@collation_connection=utf8mb4_bin;
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb4_bin
|
||||
CREATE TABLE t1 AS SELECT 'a' AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(3) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
000061
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
000061
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(15) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
000061000061000061000061000061
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
000061000061000061000061000061
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(3)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(9) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(3))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(3)))
|
||||
000061000061000061
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
000061000061000061
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(10)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(30) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(10)))
|
||||
000061000061000061000061000061000020000020000020000020000020
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
000061000061000061000061000061000020000020000020000020000020
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
select hex(weight_string('a'));
|
||||
hex(weight_string('a'))
|
||||
000061
|
||||
select hex(weight_string('A'));
|
||||
hex(weight_string('A'))
|
||||
000041
|
||||
select hex(weight_string('abc'));
|
||||
hex(weight_string('abc'))
|
||||
000061000062000063
|
||||
select hex(weight_string('abc' as char(2)));
|
||||
hex(weight_string('abc' as char(2)))
|
||||
000061000062
|
||||
select hex(weight_string('abc' as char(3)));
|
||||
hex(weight_string('abc' as char(3)))
|
||||
000061000062000063
|
||||
select hex(weight_string('abc' as char(5)));
|
||||
hex(weight_string('abc' as char(5)))
|
||||
000061000062000063000020000020
|
||||
select hex(weight_string('abc', 1, 2, 0xC0));
|
||||
hex(weight_string('abc', 1, 2, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 2, 0xC0));
|
||||
hex(weight_string('abc', 2, 2, 0xC0))
|
||||
0000
|
||||
select hex(weight_string('abc', 3, 2, 0xC0));
|
||||
hex(weight_string('abc', 3, 2, 0xC0))
|
||||
000061
|
||||
select hex(weight_string('abc', 4, 2, 0xC0));
|
||||
hex(weight_string('abc', 4, 2, 0xC0))
|
||||
00006100
|
||||
select hex(weight_string('abc', 5, 2, 0xC0));
|
||||
hex(weight_string('abc', 5, 2, 0xC0))
|
||||
0000610000
|
||||
select hex(weight_string('abc',25, 2, 0xC0));
|
||||
hex(weight_string('abc',25, 2, 0xC0))
|
||||
00006100006200002000002000002000002000002000002000
|
||||
select hex(weight_string('abc', 1, 3, 0xC0));
|
||||
hex(weight_string('abc', 1, 3, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 3, 0xC0));
|
||||
hex(weight_string('abc', 2, 3, 0xC0))
|
||||
0000
|
||||
select hex(weight_string('abc', 3, 3, 0xC0));
|
||||
hex(weight_string('abc', 3, 3, 0xC0))
|
||||
000061
|
||||
select hex(weight_string('abc', 4, 3, 0xC0));
|
||||
hex(weight_string('abc', 4, 3, 0xC0))
|
||||
00006100
|
||||
select hex(weight_string('abc', 5, 3, 0xC0));
|
||||
hex(weight_string('abc', 5, 3, 0xC0))
|
||||
0000610000
|
||||
select hex(weight_string('abc',25, 3, 0xC0));
|
||||
hex(weight_string('abc',25, 3, 0xC0))
|
||||
00006100006200006300002000002000002000002000002000
|
||||
select hex(weight_string('abc', 1, 4, 0xC0));
|
||||
hex(weight_string('abc', 1, 4, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 4, 0xC0));
|
||||
hex(weight_string('abc', 2, 4, 0xC0))
|
||||
0000
|
||||
select hex(weight_string('abc', 3, 4, 0xC0));
|
||||
hex(weight_string('abc', 3, 4, 0xC0))
|
||||
000061
|
||||
select hex(weight_string('abc', 4, 4, 0xC0));
|
||||
hex(weight_string('abc', 4, 4, 0xC0))
|
||||
00006100
|
||||
select hex(weight_string('abc', 5, 4, 0xC0));
|
||||
hex(weight_string('abc', 5, 4, 0xC0))
|
||||
0000610000
|
||||
select hex(weight_string('abc',25, 4, 0xC0));
|
||||
hex(weight_string('abc',25, 4, 0xC0))
|
||||
00006100006200006300002000002000002000002000002000
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb4_bin
|
||||
select hex(weight_string(cast(_latin1 0x80 as char)));
|
||||
hex(weight_string(cast(_latin1 0x80 as char)))
|
||||
0020AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char)))
|
||||
0020AC0020AC0020AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(2)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(2)))
|
||||
0020AC0020AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(3)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(3)))
|
||||
0020AC0020AC0020AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(5)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(5)))
|
||||
0020AC0020AC0020AC000020000020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0))
|
||||
00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0))
|
||||
0020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0))
|
||||
0020AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0))
|
||||
0020AC00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0))
|
||||
0020AC0020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0))
|
||||
0020AC0020AC00002000002000002000002000002000002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0))
|
||||
00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0))
|
||||
0020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0))
|
||||
0020AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0))
|
||||
0020AC00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0))
|
||||
0020AC0020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0))
|
||||
0020AC0020AC0020AC00002000002000002000002000002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0))
|
||||
00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0))
|
||||
0020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0))
|
||||
0020AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0))
|
||||
0020AC00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0))
|
||||
0020AC0020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0))
|
||||
0020AC0020AC0020AC00002000002000002000002000002000
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb4_bin
|
||||
select hex(weight_string('a' LEVEL 1));
|
||||
hex(weight_string('a' LEVEL 1))
|
||||
000061
|
||||
select hex(weight_string('A' LEVEL 1));
|
||||
hex(weight_string('A' LEVEL 1))
|
||||
000041
|
||||
select hex(weight_string('abc' LEVEL 1));
|
||||
hex(weight_string('abc' LEVEL 1))
|
||||
000061000062000063
|
||||
select hex(weight_string('abc' as char(2) LEVEL 1));
|
||||
hex(weight_string('abc' as char(2) LEVEL 1))
|
||||
000061000062
|
||||
select hex(weight_string('abc' as char(3) LEVEL 1));
|
||||
hex(weight_string('abc' as char(3) LEVEL 1))
|
||||
000061000062000063
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1))
|
||||
000061000062000063000020000020
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
|
||||
200000200000630000620000610000
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
|
||||
FFFF9EFFFF9DFFFF9CFFFFDFFFFFDF
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
|
||||
DFFFFFDFFFFF9CFFFF9DFFFF9EFFFF
|
||||
#
|
||||
# End of 5.6 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.0 tests
|
||||
#
|
||||
#
|
||||
|
@ -10,6 +10,16 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/default_optimizer_switch.inc
|
||||
|
||||
#
|
||||
# Remove the 'utf8mb3=xxx' and 'utf8mb4=xxx' substrings
|
||||
# from @@character_set_collations to change the default
|
||||
# utf8mb3 and utf8mb4 collations to the hard-coded defaults
|
||||
# utf8mb3_general_ci and utf8mb4_general_ci
|
||||
#
|
||||
SET character_set_collations= REGEXP_REPLACE(@@character_set_collations, '(utf8mb[34]=[a-z0-9_]*)', '');
|
||||
SELECT @@character_set_collations;
|
||||
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
@ -54,32 +64,6 @@ select convert(_latin1'G
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4);
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4);
|
||||
|
||||
#
|
||||
# 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 utf8mb4_bin;
|
||||
SELECT 'a\0' < 'a' collate utf8mb4_bin;
|
||||
SELECT 'a\0' < 'a ' collate utf8mb4_bin;
|
||||
SELECT 'a\t' < 'a' collate utf8mb4_bin;
|
||||
SELECT 'a\t' < 'a ' collate utf8mb4_bin;
|
||||
|
||||
CREATE TABLE t1 (a char(10) character set utf8mb4 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:
|
||||
#
|
||||
@ -198,13 +182,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 utf8mb4;
|
||||
--source include/ctype_regex.inc
|
||||
--source include/ctype_regex_utf8.inc
|
||||
|
||||
#
|
||||
# Bug #4555
|
||||
# ALTER TABLE crashes mysqld with enum column collated utf8mb4_unicode_ci
|
||||
@ -1880,24 +1857,6 @@ DROP TABLE t1;
|
||||
--echo #
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # WL#3664 WEIGHT_STRING
|
||||
--echo #
|
||||
|
||||
set names utf8mb4;
|
||||
--source include/weight_string.inc
|
||||
--source include/weight_string_euro.inc
|
||||
--source include/weight_string_l1.inc
|
||||
|
||||
set @@collation_connection=utf8mb4_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 #
|
||||
|
622
mysql-test/main/ctype_utf8mb4_bin.result
Normal file
622
mysql-test/main/ctype_utf8mb4_bin.result
Normal file
@ -0,0 +1,622 @@
|
||||
#
|
||||
# Start of 5.5 tests
|
||||
#
|
||||
SET NAMES utf8mb4 COLLATE utf8mb4_bin;
|
||||
SELECT COLLATION('a');
|
||||
COLLATION('a')
|
||||
utf8mb4_bin
|
||||
SELECT 'a' = 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\0' = 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' = 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' = 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' = 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a' < 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' < 'a' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\0' < 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\t' < 'a' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\t' < 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' > 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' > 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS a LIMIT 0;
|
||||
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;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
|
||||
`a_readable` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin GENERATED ALWAYS AS (rpad(quote(regexp_replace(`a`,'(\\x{00}|\\x{09})','.')),10)) VIRTUAL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 (a) VALUES ('a'),('a\0'),('a\t'),('a ');
|
||||
SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
|
||||
hex(a) STRCMP(a,'a') STRCMP(a,'a ')
|
||||
61 0 0
|
||||
6100 -1 -1
|
||||
6109 -1 -1
|
||||
6120 0 0
|
||||
SELECT HEX(a), a_readable FROM t1 ORDER BY a, BINARY a;
|
||||
HEX(a) a_readable
|
||||
6100 'a.'
|
||||
6109 'a.'
|
||||
61 'a'
|
||||
6120 '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;
|
||||
t1a cmp t2a a_readable a_readable
|
||||
61 = 61 'a' 'a'
|
||||
61 > 6100 'a' 'a.'
|
||||
61 > 6109 'a' 'a.'
|
||||
61 = 6120 'a' 'a '
|
||||
6100 < 61 'a.' 'a'
|
||||
6100 = 6100 'a.' 'a.'
|
||||
6100 < 6109 'a.' 'a.'
|
||||
6100 < 6120 'a.' 'a '
|
||||
6109 < 61 'a.' 'a'
|
||||
6109 > 6100 'a.' 'a.'
|
||||
6109 = 6109 'a.' 'a.'
|
||||
6109 < 6120 'a.' 'a '
|
||||
6120 = 61 'a ' 'a'
|
||||
6120 > 6100 'a ' 'a.'
|
||||
6120 > 6109 'a ' 'a.'
|
||||
6120 = 6120 'a ' 'a '
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
#
|
||||
# Start of 5.6 tests
|
||||
#
|
||||
#
|
||||
# WL#3664 WEIGHT_STRING
|
||||
#
|
||||
SET NAMES utf8mb4 COLLATE utf8mb4_bin;
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb4_bin
|
||||
CREATE TABLE t1 AS SELECT 'a' AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(3) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
000061
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
000061
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(15) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
000061000061000061000061000061
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
000061000061000061000061000061
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(3)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(9) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(3))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(3)))
|
||||
000061000061000061
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
000061000061000061
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(10)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(30) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(10)))
|
||||
000061000061000061000061000061000020000020000020000020000020
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
000061000061000061000061000061000020000020000020000020000020
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
select hex(weight_string('a'));
|
||||
hex(weight_string('a'))
|
||||
000061
|
||||
select hex(weight_string('A'));
|
||||
hex(weight_string('A'))
|
||||
000041
|
||||
select hex(weight_string('abc'));
|
||||
hex(weight_string('abc'))
|
||||
000061000062000063
|
||||
select hex(weight_string('abc' as char(2)));
|
||||
hex(weight_string('abc' as char(2)))
|
||||
000061000062
|
||||
select hex(weight_string('abc' as char(3)));
|
||||
hex(weight_string('abc' as char(3)))
|
||||
000061000062000063
|
||||
select hex(weight_string('abc' as char(5)));
|
||||
hex(weight_string('abc' as char(5)))
|
||||
000061000062000063000020000020
|
||||
select hex(weight_string('abc', 1, 2, 0xC0));
|
||||
hex(weight_string('abc', 1, 2, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 2, 0xC0));
|
||||
hex(weight_string('abc', 2, 2, 0xC0))
|
||||
0000
|
||||
select hex(weight_string('abc', 3, 2, 0xC0));
|
||||
hex(weight_string('abc', 3, 2, 0xC0))
|
||||
000061
|
||||
select hex(weight_string('abc', 4, 2, 0xC0));
|
||||
hex(weight_string('abc', 4, 2, 0xC0))
|
||||
00006100
|
||||
select hex(weight_string('abc', 5, 2, 0xC0));
|
||||
hex(weight_string('abc', 5, 2, 0xC0))
|
||||
0000610000
|
||||
select hex(weight_string('abc',25, 2, 0xC0));
|
||||
hex(weight_string('abc',25, 2, 0xC0))
|
||||
00006100006200002000002000002000002000002000002000
|
||||
select hex(weight_string('abc', 1, 3, 0xC0));
|
||||
hex(weight_string('abc', 1, 3, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 3, 0xC0));
|
||||
hex(weight_string('abc', 2, 3, 0xC0))
|
||||
0000
|
||||
select hex(weight_string('abc', 3, 3, 0xC0));
|
||||
hex(weight_string('abc', 3, 3, 0xC0))
|
||||
000061
|
||||
select hex(weight_string('abc', 4, 3, 0xC0));
|
||||
hex(weight_string('abc', 4, 3, 0xC0))
|
||||
00006100
|
||||
select hex(weight_string('abc', 5, 3, 0xC0));
|
||||
hex(weight_string('abc', 5, 3, 0xC0))
|
||||
0000610000
|
||||
select hex(weight_string('abc',25, 3, 0xC0));
|
||||
hex(weight_string('abc',25, 3, 0xC0))
|
||||
00006100006200006300002000002000002000002000002000
|
||||
select hex(weight_string('abc', 1, 4, 0xC0));
|
||||
hex(weight_string('abc', 1, 4, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 4, 0xC0));
|
||||
hex(weight_string('abc', 2, 4, 0xC0))
|
||||
0000
|
||||
select hex(weight_string('abc', 3, 4, 0xC0));
|
||||
hex(weight_string('abc', 3, 4, 0xC0))
|
||||
000061
|
||||
select hex(weight_string('abc', 4, 4, 0xC0));
|
||||
hex(weight_string('abc', 4, 4, 0xC0))
|
||||
00006100
|
||||
select hex(weight_string('abc', 5, 4, 0xC0));
|
||||
hex(weight_string('abc', 5, 4, 0xC0))
|
||||
0000610000
|
||||
select hex(weight_string('abc',25, 4, 0xC0));
|
||||
hex(weight_string('abc',25, 4, 0xC0))
|
||||
00006100006200006300002000002000002000002000002000
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb4_bin
|
||||
select hex(weight_string(cast(_latin1 0x80 as char)));
|
||||
hex(weight_string(cast(_latin1 0x80 as char)))
|
||||
0020AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char)))
|
||||
0020AC0020AC0020AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(2)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(2)))
|
||||
0020AC0020AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(3)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(3)))
|
||||
0020AC0020AC0020AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(5)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(5)))
|
||||
0020AC0020AC0020AC000020000020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0))
|
||||
00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0))
|
||||
0020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0))
|
||||
0020AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0))
|
||||
0020AC00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0))
|
||||
0020AC0020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0))
|
||||
0020AC0020AC00002000002000002000002000002000002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0))
|
||||
00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0))
|
||||
0020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0))
|
||||
0020AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0))
|
||||
0020AC00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0))
|
||||
0020AC0020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0))
|
||||
0020AC0020AC0020AC00002000002000002000002000002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0))
|
||||
00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0))
|
||||
0020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0))
|
||||
0020AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0))
|
||||
0020AC00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0))
|
||||
0020AC0020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0))
|
||||
0020AC0020AC0020AC00002000002000002000002000002000
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb4_bin
|
||||
select hex(weight_string('a' LEVEL 1));
|
||||
hex(weight_string('a' LEVEL 1))
|
||||
000061
|
||||
select hex(weight_string('A' LEVEL 1));
|
||||
hex(weight_string('A' LEVEL 1))
|
||||
000041
|
||||
select hex(weight_string('abc' LEVEL 1));
|
||||
hex(weight_string('abc' LEVEL 1))
|
||||
000061000062000063
|
||||
select hex(weight_string('abc' as char(2) LEVEL 1));
|
||||
hex(weight_string('abc' as char(2) LEVEL 1))
|
||||
000061000062
|
||||
select hex(weight_string('abc' as char(3) LEVEL 1));
|
||||
hex(weight_string('abc' as char(3) LEVEL 1))
|
||||
000061000062000063
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1))
|
||||
000061000062000063000020000020
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
|
||||
200000200000630000620000610000
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
|
||||
FFFF9EFFFF9DFFFF9CFFFFDFFFFFDF
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
|
||||
DFFFFFDFFFFF9CFFFF9DFFFF9EFFFF
|
||||
#
|
||||
# End of 5.6 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.0 tests
|
||||
#
|
||||
SET NAMES utf8mb4 COLLATE utf8mb4_bin;
|
||||
#
|
||||
# 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
|
||||
union
|
||||
select null, null;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`s1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
|
||||
`s2` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
delete from t1;
|
||||
insert into t1 values('aaa','aaa');
|
||||
insert into t1 values('aaa|qqq','qqq');
|
||||
insert into t1 values('gheis','^[^a-dXYZ]+$');
|
||||
insert into t1 values('aab','^aa?b');
|
||||
insert into t1 values('Baaan','^Ba*n');
|
||||
insert into t1 values('aaa','qqq|aaa');
|
||||
insert into t1 values('qqq','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq');
|
||||
insert into t1 values('aaa','aba');
|
||||
insert into t1 values(null,'abc');
|
||||
insert into t1 values('def',null);
|
||||
insert into t1 values(null,null);
|
||||
insert into t1 values('ghi','ghi[');
|
||||
select HIGH_PRIORITY s1 regexp s2 from t1;
|
||||
s1 regexp s2
|
||||
0
|
||||
0
|
||||
0
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
#
|
||||
# Bug #3928 regexp [[:>:]] and UTF-8
|
||||
#
|
||||
SELECT @@character_set_client, @@collation_connection;
|
||||
@@character_set_client @@collation_connection
|
||||
utf8mb4 utf8mb4_bin
|
||||
# This should return TRUE
|
||||
select 'вася' rlike '\\bвася\\b';
|
||||
'вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася ' rlike '\\bвася\\b';
|
||||
'вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася' rlike '\\bвася\\b';
|
||||
' вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася ' rlike '\\bвася\\b';
|
||||
' вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
# This should return FALSE
|
||||
select 'васяz' rlike '\\bвася\\b';
|
||||
'васяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвася' rlike '\\bвася\\b';
|
||||
'zвася' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвасяz' rlike '\\bвася\\b';
|
||||
'zвасяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'васяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвася' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
#
|
||||
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
|
||||
#
|
||||
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 utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('a'),('a ');
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='a';
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
|
||||
DROP TABLE t1;
|
||||
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 utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('a'),('a ');
|
||||
SELECT * FROM t1 WHERE 'a'=CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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 utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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 utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
|
||||
#
|
||||
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 utf8mb4 COLLATE utf8mb4_bin 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 ';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,octet_length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` = 'a' and `test`.`t1`.`a` not like 'a '
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of MDEV-8694
|
||||
#
|
||||
#
|
||||
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
|
||||
#
|
||||
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 utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('ae'),('ä');
|
||||
SELECT * FROM t1 WHERE c1='ä';
|
||||
c1
|
||||
ä
|
||||
SELECT * FROM t1 WHERE c1 LIKE 'ae';
|
||||
c1
|
||||
ae
|
||||
SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae';
|
||||
c1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where `test`.`t1`.`c1` = 'ä' and `test`.`t1`.`c1` like 'ae'
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='ä';
|
||||
c1
|
||||
ä
|
||||
SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'ae';
|
||||
c1
|
||||
ae
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae';
|
||||
c1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'ä' and concat(`test`.`t1`.`c1`) like 'ae'
|
||||
DROP TABLE IF EXISTS t1;
|
||||
#
|
||||
# End of 10.0 tests
|
||||
#
|
52
mysql-test/main/ctype_utf8mb4_bin.test
Normal file
52
mysql-test/main/ctype_utf8mb4_bin.test
Normal file
@ -0,0 +1,52 @@
|
||||
--echo #
|
||||
--echo # Start of 5.5 tests
|
||||
--echo #
|
||||
|
||||
SET NAMES utf8mb4 COLLATE utf8mb4_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 utf8mb4 COLLATE utf8mb4_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 utf8mb4 COLLATE utf8mb4_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 #
|
622
mysql-test/main/ctype_utf8mb4_general_ci.result
Normal file
622
mysql-test/main/ctype_utf8mb4_general_ci.result
Normal file
@ -0,0 +1,622 @@
|
||||
#
|
||||
# Start of 5.5 tests
|
||||
#
|
||||
SET NAMES utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
SELECT COLLATION('a');
|
||||
COLLATION('a')
|
||||
utf8mb4_general_ci
|
||||
SELECT 'a' = 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\0' = 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' = 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' = 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' = 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a' < 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' < 'a' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\0' < 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\t' < 'a' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\t' < 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' > 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' > 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS a LIMIT 0;
|
||||
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;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`a_readable` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci GENERATED ALWAYS AS (rpad(quote(regexp_replace(`a`,'(\\x{00}|\\x{09})','.')),10)) VIRTUAL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 (a) VALUES ('a'),('a\0'),('a\t'),('a ');
|
||||
SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
|
||||
hex(a) STRCMP(a,'a') STRCMP(a,'a ')
|
||||
61 0 0
|
||||
6100 -1 -1
|
||||
6109 -1 -1
|
||||
6120 0 0
|
||||
SELECT HEX(a), a_readable FROM t1 ORDER BY a, BINARY a;
|
||||
HEX(a) a_readable
|
||||
6100 'a.'
|
||||
6109 'a.'
|
||||
61 'a'
|
||||
6120 '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;
|
||||
t1a cmp t2a a_readable a_readable
|
||||
61 = 61 'a' 'a'
|
||||
61 > 6100 'a' 'a.'
|
||||
61 > 6109 'a' 'a.'
|
||||
61 = 6120 'a' 'a '
|
||||
6100 < 61 'a.' 'a'
|
||||
6100 = 6100 'a.' 'a.'
|
||||
6100 < 6109 'a.' 'a.'
|
||||
6100 < 6120 'a.' 'a '
|
||||
6109 < 61 'a.' 'a'
|
||||
6109 > 6100 'a.' 'a.'
|
||||
6109 = 6109 'a.' 'a.'
|
||||
6109 < 6120 'a.' 'a '
|
||||
6120 = 61 'a ' 'a'
|
||||
6120 > 6100 'a ' 'a.'
|
||||
6120 > 6109 'a ' 'a.'
|
||||
6120 = 6120 'a ' 'a '
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
#
|
||||
# Start of 5.6 tests
|
||||
#
|
||||
#
|
||||
# WL#3664 WEIGHT_STRING
|
||||
#
|
||||
SET NAMES utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb4_general_ci
|
||||
CREATE TABLE t1 AS SELECT 'a' AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
0041
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
0041
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(10) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
00410041004100410041
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
00410041004100410041
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(3)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(6) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(3))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(3)))
|
||||
004100410041
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
004100410041
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(10)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(20) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(10)))
|
||||
0041004100410041004100200020002000200020
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
0041004100410041004100200020002000200020
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
select hex(weight_string('a'));
|
||||
hex(weight_string('a'))
|
||||
0041
|
||||
select hex(weight_string('A'));
|
||||
hex(weight_string('A'))
|
||||
0041
|
||||
select hex(weight_string('abc'));
|
||||
hex(weight_string('abc'))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(2)));
|
||||
hex(weight_string('abc' as char(2)))
|
||||
00410042
|
||||
select hex(weight_string('abc' as char(3)));
|
||||
hex(weight_string('abc' as char(3)))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(5)));
|
||||
hex(weight_string('abc' as char(5)))
|
||||
00410042004300200020
|
||||
select hex(weight_string('abc', 1, 2, 0xC0));
|
||||
hex(weight_string('abc', 1, 2, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 2, 0xC0));
|
||||
hex(weight_string('abc', 2, 2, 0xC0))
|
||||
0041
|
||||
select hex(weight_string('abc', 3, 2, 0xC0));
|
||||
hex(weight_string('abc', 3, 2, 0xC0))
|
||||
004100
|
||||
select hex(weight_string('abc', 4, 2, 0xC0));
|
||||
hex(weight_string('abc', 4, 2, 0xC0))
|
||||
00410042
|
||||
select hex(weight_string('abc', 5, 2, 0xC0));
|
||||
hex(weight_string('abc', 5, 2, 0xC0))
|
||||
0041004200
|
||||
select hex(weight_string('abc',25, 2, 0xC0));
|
||||
hex(weight_string('abc',25, 2, 0xC0))
|
||||
00410042002000200020002000200020002000200020002000
|
||||
select hex(weight_string('abc', 1, 3, 0xC0));
|
||||
hex(weight_string('abc', 1, 3, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 3, 0xC0));
|
||||
hex(weight_string('abc', 2, 3, 0xC0))
|
||||
0041
|
||||
select hex(weight_string('abc', 3, 3, 0xC0));
|
||||
hex(weight_string('abc', 3, 3, 0xC0))
|
||||
004100
|
||||
select hex(weight_string('abc', 4, 3, 0xC0));
|
||||
hex(weight_string('abc', 4, 3, 0xC0))
|
||||
00410042
|
||||
select hex(weight_string('abc', 5, 3, 0xC0));
|
||||
hex(weight_string('abc', 5, 3, 0xC0))
|
||||
0041004200
|
||||
select hex(weight_string('abc',25, 3, 0xC0));
|
||||
hex(weight_string('abc',25, 3, 0xC0))
|
||||
00410042004300200020002000200020002000200020002000
|
||||
select hex(weight_string('abc', 1, 4, 0xC0));
|
||||
hex(weight_string('abc', 1, 4, 0xC0))
|
||||
00
|
||||
select hex(weight_string('abc', 2, 4, 0xC0));
|
||||
hex(weight_string('abc', 2, 4, 0xC0))
|
||||
0041
|
||||
select hex(weight_string('abc', 3, 4, 0xC0));
|
||||
hex(weight_string('abc', 3, 4, 0xC0))
|
||||
004100
|
||||
select hex(weight_string('abc', 4, 4, 0xC0));
|
||||
hex(weight_string('abc', 4, 4, 0xC0))
|
||||
00410042
|
||||
select hex(weight_string('abc', 5, 4, 0xC0));
|
||||
hex(weight_string('abc', 5, 4, 0xC0))
|
||||
0041004200
|
||||
select hex(weight_string('abc',25, 4, 0xC0));
|
||||
hex(weight_string('abc',25, 4, 0xC0))
|
||||
00410042004300200020002000200020002000200020002000
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb4_general_ci
|
||||
select hex(weight_string(cast(_latin1 0x80 as char)));
|
||||
hex(weight_string(cast(_latin1 0x80 as char)))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char)))
|
||||
20AC20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(2)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(2)))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(3)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(3)))
|
||||
20AC20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(5)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(5)))
|
||||
20AC20AC20AC00200020
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0))
|
||||
20AC20AC00
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0))
|
||||
20AC20AC002000200020002000200020002000200020002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0))
|
||||
20AC20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0))
|
||||
20AC20AC20AC00200020002000200020002000200020002000
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0))
|
||||
20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0))
|
||||
20AC20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0))
|
||||
20AC20AC
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0))
|
||||
20AC20AC20
|
||||
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 @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb4_general_ci
|
||||
select hex(weight_string('a' LEVEL 1));
|
||||
hex(weight_string('a' LEVEL 1))
|
||||
0041
|
||||
select hex(weight_string('A' LEVEL 1));
|
||||
hex(weight_string('A' LEVEL 1))
|
||||
0041
|
||||
select hex(weight_string('abc' LEVEL 1));
|
||||
hex(weight_string('abc' LEVEL 1))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(2) LEVEL 1));
|
||||
hex(weight_string('abc' as char(2) LEVEL 1))
|
||||
00410042
|
||||
select hex(weight_string('abc' as char(3) LEVEL 1));
|
||||
hex(weight_string('abc' as char(3) LEVEL 1))
|
||||
004100420043
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1))
|
||||
00410042004300200020
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
|
||||
20002000430042004100
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
|
||||
FFBEFFBDFFBCFFDFFFDF
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
|
||||
DFFFDFFFBCFFBDFFBEFF
|
||||
#
|
||||
# End of 5.6 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.0 tests
|
||||
#
|
||||
SET NAMES utf8mb4 COLLATE utf8mb4_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
|
||||
union
|
||||
select null, null;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`s1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`s2` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
delete from t1;
|
||||
insert into t1 values('aaa','aaa');
|
||||
insert into t1 values('aaa|qqq','qqq');
|
||||
insert into t1 values('gheis','^[^a-dXYZ]+$');
|
||||
insert into t1 values('aab','^aa?b');
|
||||
insert into t1 values('Baaan','^Ba*n');
|
||||
insert into t1 values('aaa','qqq|aaa');
|
||||
insert into t1 values('qqq','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq');
|
||||
insert into t1 values('aaa','aba');
|
||||
insert into t1 values(null,'abc');
|
||||
insert into t1 values('def',null);
|
||||
insert into t1 values(null,null);
|
||||
insert into t1 values('ghi','ghi[');
|
||||
select HIGH_PRIORITY s1 regexp s2 from t1;
|
||||
s1 regexp s2
|
||||
0
|
||||
0
|
||||
0
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
#
|
||||
# Bug #3928 regexp [[:>:]] and UTF-8
|
||||
#
|
||||
SELECT @@character_set_client, @@collation_connection;
|
||||
@@character_set_client @@collation_connection
|
||||
utf8mb4 utf8mb4_general_ci
|
||||
# This should return TRUE
|
||||
select 'вася' rlike '\\bвася\\b';
|
||||
'вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася ' rlike '\\bвася\\b';
|
||||
'вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася' rlike '\\bвася\\b';
|
||||
' вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася ' rlike '\\bвася\\b';
|
||||
' вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
# This should return FALSE
|
||||
select 'васяz' rlike '\\bвася\\b';
|
||||
'васяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвася' rlike '\\bвася\\b';
|
||||
'zвася' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвасяz' rlike '\\bвася\\b';
|
||||
'zвасяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'васяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвася' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
#
|
||||
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
|
||||
#
|
||||
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 utf8mb4 COLLATE utf8mb4_general_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';
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
|
||||
DROP TABLE t1;
|
||||
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 utf8mb4 COLLATE utf8mb4_general_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);
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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 utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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 utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
|
||||
#
|
||||
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 utf8mb4 COLLATE utf8mb4_general_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 ';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,octet_length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` not like 'a ' and `test`.`t1`.`a` = 'a'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of MDEV-8694
|
||||
#
|
||||
#
|
||||
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
|
||||
#
|
||||
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 utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('ae'),('ä');
|
||||
SELECT * FROM t1 WHERE c1='ä';
|
||||
c1
|
||||
ä
|
||||
SELECT * FROM t1 WHERE c1 LIKE 'ae';
|
||||
c1
|
||||
ae
|
||||
SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae';
|
||||
c1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where `test`.`t1`.`c1` = 'ä' and `test`.`t1`.`c1` like 'ae'
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='ä';
|
||||
c1
|
||||
ä
|
||||
SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'ae';
|
||||
c1
|
||||
ae
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae';
|
||||
c1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'ä' and concat(`test`.`t1`.`c1`) like 'ae'
|
||||
DROP TABLE IF EXISTS t1;
|
||||
#
|
||||
# End of 10.0 tests
|
||||
#
|
52
mysql-test/main/ctype_utf8mb4_general_ci.test
Normal file
52
mysql-test/main/ctype_utf8mb4_general_ci.test
Normal file
@ -0,0 +1,52 @@
|
||||
--echo #
|
||||
--echo # Start of 5.5 tests
|
||||
--echo #
|
||||
|
||||
SET NAMES utf8mb4 COLLATE utf8mb4_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 utf8mb4 COLLATE utf8mb4_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 utf8mb4 COLLATE utf8mb4_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 #
|
@ -75,20 +75,20 @@ CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4) LIKE CONVERT(_koi8r'\xF7\xE1\xF3
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4);
|
||||
CONVERT(_koi8r'\xF7\xE1\xF3\xF1' USING utf8mb4) LIKE CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4)
|
||||
1
|
||||
SELECT 'a' = 'a ';
|
||||
'a' = 'a '
|
||||
SELECT 'a' = 'a ' collate utf8mb4_general_ci;
|
||||
'a' = 'a ' collate utf8mb4_general_ci
|
||||
1
|
||||
SELECT 'a\0' < 'a';
|
||||
'a\0' < 'a'
|
||||
SELECT 'a\0' < 'a' collate utf8mb4_general_ci;
|
||||
'a\0' < 'a' collate utf8mb4_general_ci
|
||||
1
|
||||
SELECT 'a\0' < 'a ';
|
||||
'a\0' < 'a '
|
||||
SELECT 'a\0' < 'a ' collate utf8mb4_general_ci;
|
||||
'a\0' < 'a ' collate utf8mb4_general_ci
|
||||
1
|
||||
SELECT 'a\t' < 'a';
|
||||
'a\t' < 'a'
|
||||
SELECT 'a\t' < 'a' collate utf8mb4_general_ci;
|
||||
'a\t' < 'a' collate utf8mb4_general_ci
|
||||
1
|
||||
SELECT 'a\t' < 'a ';
|
||||
'a\t' < 'a '
|
||||
SELECT 'a\t' < 'a ' collate utf8mb4_general_ci;
|
||||
'a\t' < 'a ' collate utf8mb4_general_ci
|
||||
1
|
||||
SELECT 'a' = 'a ' collate utf8mb4_bin;
|
||||
'a' = 'a ' collate utf8mb4_bin
|
||||
@ -105,7 +105,7 @@ SELECT 'a\t' < 'a' collate utf8mb4_bin;
|
||||
SELECT 'a\t' < 'a ' collate utf8mb4_bin;
|
||||
'a\t' < 'a ' collate utf8mb4_bin
|
||||
1
|
||||
CREATE TABLE t1 (a char(10) character set utf8mb4 not null) ENGINE heap;
|
||||
CREATE TABLE t1 (a char(10) character set utf8mb4 collate utf8mb4_general_ci not null) ENGINE heap;
|
||||
INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
|
||||
SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
|
||||
hex(a) STRCMP(a,'a') STRCMP(a,'a ')
|
||||
@ -127,7 +127,7 @@ create table t1 ENGINE heap select date_format("2004-01-19 10:10:10", "%Y-%m-%d"
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`date_format("2004-01-19 10:10:10", "%Y-%m-%d")` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
`date_format("2004-01-19 10:10:10", "%Y-%m-%d")` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
select * from t1;
|
||||
date_format("2004-01-19 10:10:10", "%Y-%m-%d")
|
||||
@ -261,6 +261,9 @@ select * from t1 where a = 'b' and a != 'b';
|
||||
a
|
||||
drop table t1;
|
||||
set names utf8mb4;
|
||||
#
|
||||
# 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
|
||||
@ -269,8 +272,8 @@ select null, null;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`s1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`s2` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
`s1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
|
||||
`s2` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
delete from t1;
|
||||
insert into t1 values('aaa','aaa');
|
||||
@ -304,9 +307,13 @@ NULL
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
#
|
||||
# Bug #3928 regexp [[:>:]] and UTF-8
|
||||
#
|
||||
SELECT @@character_set_client, @@collation_connection;
|
||||
@@character_set_client @@collation_connection
|
||||
utf8mb4 utf8mb4_general_ci
|
||||
utf8mb4 utf8mb4_uca1400_ai_ci
|
||||
# This should return TRUE
|
||||
select 'вася' rlike '\\bвася\\b';
|
||||
'вася' rlike '\\bвася\\b'
|
||||
1
|
||||
@ -331,6 +338,7 @@ select ' вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
# This should return FALSE
|
||||
select 'васяz' rlike '\\bвася\\b';
|
||||
'васяz' rlike '\\bвася\\b'
|
||||
0
|
||||
@ -357,7 +365,7 @@ create table t1 (a enum('aaaa','проба') character set utf8mb4) engine heap;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` enum('aaaa','проба') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
`a` enum('aaaa','проба') CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
insert into t1 values ('проба');
|
||||
select * from t1;
|
||||
@ -367,7 +375,7 @@ create table t2 engine heap select ifnull(a,a) from t1;
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ifnull(a,a)` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
`ifnull(a,a)` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
select * from t2;
|
||||
ifnull(a,a)
|
||||
@ -493,7 +501,7 @@ unique key a using hash (c(1))
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
|
||||
UNIQUE KEY `a` (`c`(1)) USING HASH
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
||||
@ -529,7 +537,7 @@ unique key a using btree (c(1))
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
|
||||
UNIQUE KEY `a` (`c`(1)) USING BTREE
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
||||
@ -840,8 +848,8 @@ create table t2 engine heap select concat(a,_utf8mb4'') as a, concat(b,_utf8mb4'
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`a` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`b` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
`a` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
|
||||
`b` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
@ -1397,7 +1405,7 @@ char(a)
|
||||
1
|
||||
2
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (item varchar(255)) default character set utf8mb4 ENGINE heap;
|
||||
CREATE TABLE t1 (item varchar(255)) default character set utf8mb4 collate utf8mb4_general_ci ENGINE heap;
|
||||
INSERT INTO t1 VALUES (N'\\');
|
||||
INSERT INTO t1 VALUES (_utf8mb4'\\');
|
||||
INSERT INTO t1 VALUES (N'Cote d\'Ivoire');
|
||||
@ -1676,7 +1684,7 @@ SET CHARACTER SET utf8mb4;
|
||||
SHOW VARIABLES LIKE 'character\_set\_%';
|
||||
Variable_name Value
|
||||
character_set_client utf8mb4
|
||||
character_set_collations
|
||||
character_set_collations utf8mb3=utf8mb3_uca1400_ai_ci,ucs2=ucs2_uca1400_ai_ci,utf8mb4=utf8mb4_uca1400_ai_ci,utf16=utf16_uca1400_ai_ci,utf32=utf32_uca1400_ai_ci
|
||||
character_set_connection latin1
|
||||
character_set_database latin1
|
||||
character_set_filesystem binary
|
||||
@ -1686,18 +1694,18 @@ character_set_system utf8mb3
|
||||
SET @@character_set_server=@save_character_set_server;
|
||||
CREATE DATABASE crashtest DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
|
||||
USE crashtest;
|
||||
CREATE TABLE crashtest (crash char(10)) DEFAULT CHARSET=utf8mb4 ENGINE heap;
|
||||
CREATE TABLE crashtest (crash char(10)) DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci ENGINE heap;
|
||||
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;
|
||||
crash
|
||||
35
|
||||
36
|
||||
37
|
||||
INSERT INTO crashtest VALUES ('-1000');
|
||||
EXPLAIN SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
|
||||
EXPLAIN SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4) COLLATE utf8mb4_general_ci;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE crashtest ALL NULL NULL NULL NULL 4 Using filesort
|
||||
SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
|
||||
SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4) COLLATE utf8mb4_general_ci;
|
||||
crash
|
||||
-1000
|
||||
35
|
||||
@ -1874,7 +1882,7 @@ insert into t1 values('t1_val');
|
||||
create view v1 as select 'v1_val' as col1;
|
||||
select coercibility(col1), collation(col1) from v1;
|
||||
coercibility(col1) collation(col1)
|
||||
5 utf8mb4_general_ci
|
||||
5 utf8mb4_uca1400_ai_ci
|
||||
create view v2 as select col1 from v1 union select col1 from t1;
|
||||
select coercibility(col1), collation(col1)from v2;
|
||||
coercibility(col1) collation(col1)
|
||||
@ -1908,7 +1916,7 @@ select concat(a, if(b>10, _utf8mb4'x', _utf8mb4'y')) from t1;
|
||||
concat(a, if(b>10, _utf8mb4'x', _utf8mb4'y'))
|
||||
ay
|
||||
select concat(a, if(b>10, _utf8mb4'æ', _utf8mb4'ß')) from t1;
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_uca1400_ai_ci,COERCIBLE) for operation 'concat'
|
||||
drop table t1;
|
||||
set names utf8mb4;
|
||||
create table t1 (a varchar(10) character set latin1, b int) engine heap;
|
||||
@ -1917,7 +1925,7 @@ select concat(a, if(b>10, _utf8mb4 0x78, _utf8mb4 0x79)) from t1;
|
||||
concat(a, if(b>10, _utf8mb4 0x78, _utf8mb4 0x79))
|
||||
ay
|
||||
select concat(a, if(b>10, _utf8mb4 0xC3A6, _utf8mb4 0xC3AF)) from t1;
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_uca1400_ai_ci,COERCIBLE) for operation 'concat'
|
||||
drop table t1;
|
||||
set names utf8mb4;
|
||||
create table t1 (a varchar(10) character set latin1, b int) engine heap;
|
||||
@ -1926,7 +1934,7 @@ select concat(a, if(b>10, 'x' 'x', 'y' 'y')) from t1;
|
||||
concat(a, if(b>10, 'x' 'x', 'y' 'y'))
|
||||
ayy
|
||||
select concat(a, if(b>10, 'x' 'æ', 'y' 'ß')) from t1;
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_uca1400_ai_ci,COERCIBLE) for operation 'concat'
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
colA int(11) NOT NULL,
|
||||
@ -2059,7 +2067,7 @@ DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (
|
||||
predicted_order int NOT NULL,
|
||||
utf8mb4_encoding VARCHAR(10) NOT NULL
|
||||
) CHARACTER SET utf8mb4 ENGINE heap;
|
||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ENGINE heap;
|
||||
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;
|
||||
predicted_order hex(utf8mb4_encoding)
|
||||
@ -2233,7 +2241,7 @@ DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (
|
||||
u_decimal int NOT NULL,
|
||||
utf8mb4_encoding VARCHAR(10) NOT NULL
|
||||
) CHARACTER SET utf8mb4 ENGINE heap;
|
||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ENGINE heap;
|
||||
INSERT INTO t1 VALUES (119040, x'f09d8480'),
|
||||
# G CLEF
|
||||
(119070, x'f09d849e'),
|
||||
@ -2278,7 +2286,7 @@ DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t2 (
|
||||
u_decimal int NOT NULL,
|
||||
utf8mb3_encoding VARCHAR(10) NOT NULL
|
||||
) CHARACTER SET utf8mb3 ENGINE heap;
|
||||
) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci ENGINE heap;
|
||||
INSERT INTO t2 VALUES (42856, x'ea9da8');
|
||||
INSERT INTO t2 VALUES (65131, x'efb9ab');
|
||||
INSERT IGNORE INTO t2 VALUES (1114111, x'f48fbfbf');
|
||||
@ -2349,7 +2357,7 @@ WHERE t1.utf8mb4_encoding > t2.utf8mb3_encoding;
|
||||
count(*)
|
||||
33
|
||||
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;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
@ -2370,7 +2378,7 @@ u_decimal hex(utf8mb4_encoding) utf8mb4_encoding
|
||||
120735 3F ?
|
||||
65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB ﹫?????﹫﹫?﹫
|
||||
917999 3F ?
|
||||
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb4;
|
||||
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
@ -2382,7 +2390,7 @@ u_decimal hex(utf8mb3_encoding)
|
||||
1114111 3F3F3F3F
|
||||
42856 EA9DA8
|
||||
65131 EFB9AB
|
||||
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb3;
|
||||
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
@ -2394,7 +2402,7 @@ u_decimal hex(utf8mb3_encoding)
|
||||
1114111 3F3F3F3F
|
||||
42856 EA9DA8
|
||||
65131 EFB9AB
|
||||
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;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
@ -2415,7 +2423,7 @@ u_decimal hex(utf8mb4_encoding)
|
||||
120735 3F
|
||||
65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB
|
||||
917999 3F
|
||||
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;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
@ -2436,7 +2444,7 @@ u_decimal hex(utf8mb4_encoding)
|
||||
120735 3F
|
||||
65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB
|
||||
917999 3F
|
||||
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;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
@ -2452,13 +2460,13 @@ DROP TABLE IF EXISTS t3;
|
||||
CREATE TABLE t3 (
|
||||
u_decimal int NOT NULL,
|
||||
utf8mb3_encoding VARCHAR(10) NOT NULL
|
||||
) CHARACTER SET utf8 ENGINE heap;
|
||||
) CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE heap;
|
||||
INSERT INTO t3 SELECT * FROM t1;
|
||||
DROP TABLE IF EXISTS t4;
|
||||
CREATE TABLE t4 (
|
||||
u_decimal int NOT NULL,
|
||||
utf8mb4_encoding VARCHAR(10) NOT NULL
|
||||
) CHARACTER SET utf8mb4 ENGINE heap;
|
||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ENGINE heap;
|
||||
INSERT INTO t3 SELECT * FROM t2;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
@ -2470,11 +2478,11 @@ DROP TABLE t4;
|
||||
SELECT CHARSET(CONCAT(_utf8mb4'a',_utf8'b'));
|
||||
CHARSET(CONCAT(_utf8mb4'a',_utf8'b'))
|
||||
utf8mb4
|
||||
CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 NOT NULL) ENGINE heap;
|
||||
CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL) ENGINE heap;
|
||||
INSERT INTO t1 VALUES (x'ea9da8'),(x'f48fbfbf');
|
||||
SELECT CONCAT(utf8mb4, _utf8 x'ea9da8') FROM t1 LIMIT 0;
|
||||
CONCAT(utf8mb4, _utf8 x'ea9da8')
|
||||
CREATE TABLE t2 (utf8mb3 VARCHAR(10) CHARACTER SET utf8mb3 NOT NULL) ENGINE heap;
|
||||
CREATE TABLE t2 (utf8mb3 VARCHAR(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL) ENGINE heap;
|
||||
INSERT INTO t2 VALUES (x'ea9da8');
|
||||
SELECT HEX(CONCAT(utf8mb4, utf8mb3)) FROM t1,t2 ORDER BY 1;
|
||||
HEX(CONCAT(utf8mb4, utf8mb3))
|
||||
@ -2505,12 +2513,12 @@ DROP TABLE t2;
|
||||
#
|
||||
# Check that mixing utf8mb4 with an invalid utf8 constant returns error
|
||||
#
|
||||
CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4) ENGINE heap;
|
||||
CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci) ENGINE heap;
|
||||
INSERT INTO t1 VALUES (x'f48fbfbf');
|
||||
SELECT CONCAT(utf8mb4, _utf8 '<27>') FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb3_general_ci,COERCIBLE) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb3_uca1400_ai_ci,COERCIBLE) for operation 'concat'
|
||||
SELECT CONCAT('a', _utf8 '<27>') FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) and (utf8mb3_general_ci,COERCIBLE) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_uca1400_ai_ci,COERCIBLE) and (utf8mb3_uca1400_ai_ci,COERCIBLE) for operation 'concat'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 5.5 tests
|
||||
@ -2523,7 +2531,8 @@ DROP TABLE t1;
|
||||
#
|
||||
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);
|
||||
|
@ -75,20 +75,20 @@ CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4) LIKE CONVERT(_koi8r'\xF7\xE1\xF3
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4);
|
||||
CONVERT(_koi8r'\xF7\xE1\xF3\xF1' USING utf8mb4) LIKE CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4)
|
||||
1
|
||||
SELECT 'a' = 'a ';
|
||||
'a' = 'a '
|
||||
SELECT 'a' = 'a ' collate utf8mb4_general_ci;
|
||||
'a' = 'a ' collate utf8mb4_general_ci
|
||||
1
|
||||
SELECT 'a\0' < 'a';
|
||||
'a\0' < 'a'
|
||||
SELECT 'a\0' < 'a' collate utf8mb4_general_ci;
|
||||
'a\0' < 'a' collate utf8mb4_general_ci
|
||||
1
|
||||
SELECT 'a\0' < 'a ';
|
||||
'a\0' < 'a '
|
||||
SELECT 'a\0' < 'a ' collate utf8mb4_general_ci;
|
||||
'a\0' < 'a ' collate utf8mb4_general_ci
|
||||
1
|
||||
SELECT 'a\t' < 'a';
|
||||
'a\t' < 'a'
|
||||
SELECT 'a\t' < 'a' collate utf8mb4_general_ci;
|
||||
'a\t' < 'a' collate utf8mb4_general_ci
|
||||
1
|
||||
SELECT 'a\t' < 'a ';
|
||||
'a\t' < 'a '
|
||||
SELECT 'a\t' < 'a ' collate utf8mb4_general_ci;
|
||||
'a\t' < 'a ' collate utf8mb4_general_ci
|
||||
1
|
||||
SELECT 'a' = 'a ' collate utf8mb4_bin;
|
||||
'a' = 'a ' collate utf8mb4_bin
|
||||
@ -105,7 +105,7 @@ SELECT 'a\t' < 'a' collate utf8mb4_bin;
|
||||
SELECT 'a\t' < 'a ' collate utf8mb4_bin;
|
||||
'a\t' < 'a ' collate utf8mb4_bin
|
||||
1
|
||||
CREATE TABLE t1 (a char(10) character set utf8mb4 not null) ENGINE InnoDB;
|
||||
CREATE TABLE t1 (a char(10) character set utf8mb4 collate utf8mb4_general_ci not null) ENGINE InnoDB;
|
||||
INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
|
||||
SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
|
||||
hex(a) STRCMP(a,'a') STRCMP(a,'a ')
|
||||
@ -127,7 +127,7 @@ create table t1 ENGINE InnoDB select date_format("2004-01-19 10:10:10", "%Y-%m-%
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`date_format("2004-01-19 10:10:10", "%Y-%m-%d")` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
`date_format("2004-01-19 10:10:10", "%Y-%m-%d")` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
select * from t1;
|
||||
date_format("2004-01-19 10:10:10", "%Y-%m-%d")
|
||||
@ -273,6 +273,9 @@ select * from t1 where a = 'b' and a != 'b';
|
||||
a
|
||||
drop table t1;
|
||||
set names utf8mb4;
|
||||
#
|
||||
# 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
|
||||
@ -281,8 +284,8 @@ select null, null;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`s1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`s2` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
`s1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
|
||||
`s2` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
delete from t1;
|
||||
insert into t1 values('aaa','aaa');
|
||||
@ -316,9 +319,13 @@ NULL
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
#
|
||||
# Bug #3928 regexp [[:>:]] and UTF-8
|
||||
#
|
||||
SELECT @@character_set_client, @@collation_connection;
|
||||
@@character_set_client @@collation_connection
|
||||
utf8mb4 utf8mb4_general_ci
|
||||
utf8mb4 utf8mb4_uca1400_ai_ci
|
||||
# This should return TRUE
|
||||
select 'вася' rlike '\\bвася\\b';
|
||||
'вася' rlike '\\bвася\\b'
|
||||
1
|
||||
@ -343,6 +350,7 @@ select ' вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
# This should return FALSE
|
||||
select 'васяz' rlike '\\bвася\\b';
|
||||
'васяz' rlike '\\bвася\\b'
|
||||
0
|
||||
@ -369,7 +377,7 @@ create table t1 (a enum('aaaa','проба') character set utf8mb4) engine InnoD
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` enum('aaaa','проба') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
`a` enum('aaaa','проба') CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
insert into t1 values ('проба');
|
||||
select * from t1;
|
||||
@ -379,7 +387,7 @@ create table t2 engine InnoDB select ifnull(a,a) from t1;
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ifnull(a,a)` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
`ifnull(a,a)` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
select * from t2;
|
||||
ifnull(a,a)
|
||||
@ -505,7 +513,7 @@ unique key a using hash (c(1))
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
|
||||
UNIQUE KEY `a` (`c`(1)) USING HASH
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
||||
@ -541,7 +549,7 @@ unique key a using btree (c(1))
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
|
||||
UNIQUE KEY `a` (`c`(1)) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
||||
@ -903,8 +911,8 @@ create table t2 engine InnoDB select concat(a,_utf8mb4'') as a, concat(b,_utf8mb
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`a` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`b` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
`a` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
|
||||
`b` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
@ -1468,7 +1476,7 @@ LENGTH(bug)
|
||||
100
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (item varchar(255)) default character set utf8mb4 ENGINE InnoDB;
|
||||
CREATE TABLE t1 (item varchar(255)) default character set utf8mb4 collate utf8mb4_general_ci ENGINE InnoDB;
|
||||
INSERT INTO t1 VALUES (N'\\');
|
||||
INSERT INTO t1 VALUES (_utf8mb4'\\');
|
||||
INSERT INTO t1 VALUES (N'Cote d\'Ivoire');
|
||||
@ -1802,7 +1810,7 @@ SET CHARACTER SET utf8mb4;
|
||||
SHOW VARIABLES LIKE 'character\_set\_%';
|
||||
Variable_name Value
|
||||
character_set_client utf8mb4
|
||||
character_set_collations
|
||||
character_set_collations utf8mb3=utf8mb3_uca1400_ai_ci,ucs2=ucs2_uca1400_ai_ci,utf8mb4=utf8mb4_uca1400_ai_ci,utf16=utf16_uca1400_ai_ci,utf32=utf32_uca1400_ai_ci
|
||||
character_set_connection latin1
|
||||
character_set_database latin1
|
||||
character_set_filesystem binary
|
||||
@ -1812,18 +1820,18 @@ character_set_system utf8mb3
|
||||
SET @@character_set_server=@save_character_set_server;
|
||||
CREATE DATABASE crashtest DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
|
||||
USE crashtest;
|
||||
CREATE TABLE crashtest (crash char(10)) DEFAULT CHARSET=utf8mb4 ENGINE InnoDB;
|
||||
CREATE TABLE crashtest (crash char(10)) DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci ENGINE InnoDB;
|
||||
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;
|
||||
crash
|
||||
35
|
||||
36
|
||||
37
|
||||
INSERT INTO crashtest VALUES ('-1000');
|
||||
EXPLAIN SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
|
||||
EXPLAIN SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4) COLLATE utf8mb4_general_ci;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE crashtest ALL NULL NULL NULL NULL 4 Using filesort
|
||||
SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
|
||||
SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4) COLLATE utf8mb4_general_ci;
|
||||
crash
|
||||
-1000
|
||||
35
|
||||
@ -2000,7 +2008,7 @@ insert into t1 values('t1_val');
|
||||
create view v1 as select 'v1_val' as col1;
|
||||
select coercibility(col1), collation(col1) from v1;
|
||||
coercibility(col1) collation(col1)
|
||||
5 utf8mb4_general_ci
|
||||
5 utf8mb4_uca1400_ai_ci
|
||||
create view v2 as select col1 from v1 union select col1 from t1;
|
||||
select coercibility(col1), collation(col1)from v2;
|
||||
coercibility(col1) collation(col1)
|
||||
@ -2034,7 +2042,7 @@ select concat(a, if(b>10, _utf8mb4'x', _utf8mb4'y')) from t1;
|
||||
concat(a, if(b>10, _utf8mb4'x', _utf8mb4'y'))
|
||||
ay
|
||||
select concat(a, if(b>10, _utf8mb4'æ', _utf8mb4'ß')) from t1;
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_uca1400_ai_ci,COERCIBLE) for operation 'concat'
|
||||
drop table t1;
|
||||
set names utf8mb4;
|
||||
create table t1 (a varchar(10) character set latin1, b int) engine InnoDB;
|
||||
@ -2043,7 +2051,7 @@ select concat(a, if(b>10, _utf8mb4 0x78, _utf8mb4 0x79)) from t1;
|
||||
concat(a, if(b>10, _utf8mb4 0x78, _utf8mb4 0x79))
|
||||
ay
|
||||
select concat(a, if(b>10, _utf8mb4 0xC3A6, _utf8mb4 0xC3AF)) from t1;
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_uca1400_ai_ci,COERCIBLE) for operation 'concat'
|
||||
drop table t1;
|
||||
set names utf8mb4;
|
||||
create table t1 (a varchar(10) character set latin1, b int) engine InnoDB;
|
||||
@ -2052,7 +2060,7 @@ select concat(a, if(b>10, 'x' 'x', 'y' 'y')) from t1;
|
||||
concat(a, if(b>10, 'x' 'x', 'y' 'y'))
|
||||
ayy
|
||||
select concat(a, if(b>10, 'x' 'æ', 'y' 'ß')) from t1;
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_uca1400_ai_ci,COERCIBLE) for operation 'concat'
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
colA int(11) NOT NULL,
|
||||
@ -2185,7 +2193,7 @@ DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (
|
||||
predicted_order int NOT NULL,
|
||||
utf8mb4_encoding VARCHAR(10) NOT NULL
|
||||
) CHARACTER SET utf8mb4 ENGINE InnoDB;
|
||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ENGINE InnoDB;
|
||||
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;
|
||||
predicted_order hex(utf8mb4_encoding)
|
||||
@ -2367,7 +2375,7 @@ t1 CREATE TABLE `t1` (
|
||||
`Tape` tinytext DEFAULT NULL,
|
||||
PRIMARY KEY (`clipid`),
|
||||
KEY `tape` (`Tape`(255))
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Testing 4-byte values.
|
||||
@ -2376,7 +2384,7 @@ DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (
|
||||
u_decimal int NOT NULL,
|
||||
utf8mb4_encoding VARCHAR(10) NOT NULL
|
||||
) CHARACTER SET utf8mb4 ENGINE InnoDB;
|
||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ENGINE InnoDB;
|
||||
INSERT INTO t1 VALUES (119040, x'f09d8480'),
|
||||
# G CLEF
|
||||
(119070, x'f09d849e'),
|
||||
@ -2421,7 +2429,7 @@ DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t2 (
|
||||
u_decimal int NOT NULL,
|
||||
utf8mb3_encoding VARCHAR(10) NOT NULL
|
||||
) CHARACTER SET utf8mb3 ENGINE InnoDB;
|
||||
) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci ENGINE InnoDB;
|
||||
INSERT INTO t2 VALUES (42856, x'ea9da8');
|
||||
INSERT INTO t2 VALUES (65131, x'efb9ab');
|
||||
INSERT IGNORE INTO t2 VALUES (1114111, x'f48fbfbf');
|
||||
@ -2492,7 +2500,7 @@ WHERE t1.utf8mb4_encoding > t2.utf8mb3_encoding;
|
||||
count(*)
|
||||
33
|
||||
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;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
@ -2513,7 +2521,7 @@ u_decimal hex(utf8mb4_encoding) utf8mb4_encoding
|
||||
120735 3F ?
|
||||
65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB ﹫?????﹫﹫?﹫
|
||||
917999 3F ?
|
||||
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb4;
|
||||
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
@ -2525,7 +2533,7 @@ u_decimal hex(utf8mb3_encoding)
|
||||
1114111 3F3F3F3F
|
||||
42856 EA9DA8
|
||||
65131 EFB9AB
|
||||
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb3;
|
||||
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
@ -2537,7 +2545,7 @@ u_decimal hex(utf8mb3_encoding)
|
||||
1114111 3F3F3F3F
|
||||
42856 EA9DA8
|
||||
65131 EFB9AB
|
||||
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;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
@ -2558,7 +2566,7 @@ u_decimal hex(utf8mb4_encoding)
|
||||
120735 3F
|
||||
65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB
|
||||
917999 3F
|
||||
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;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
@ -2579,7 +2587,7 @@ u_decimal hex(utf8mb4_encoding)
|
||||
120735 3F
|
||||
65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB
|
||||
917999 3F
|
||||
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;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
@ -2595,13 +2603,13 @@ DROP TABLE IF EXISTS t3;
|
||||
CREATE TABLE t3 (
|
||||
u_decimal int NOT NULL,
|
||||
utf8mb3_encoding VARCHAR(10) NOT NULL
|
||||
) CHARACTER SET utf8 ENGINE InnoDB;
|
||||
) CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE InnoDB;
|
||||
INSERT INTO t3 SELECT * FROM t1;
|
||||
DROP TABLE IF EXISTS t4;
|
||||
CREATE TABLE t4 (
|
||||
u_decimal int NOT NULL,
|
||||
utf8mb4_encoding VARCHAR(10) NOT NULL
|
||||
) CHARACTER SET utf8mb4 ENGINE InnoDB;
|
||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ENGINE InnoDB;
|
||||
INSERT INTO t3 SELECT * FROM t2;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
@ -2613,11 +2621,11 @@ DROP TABLE t4;
|
||||
SELECT CHARSET(CONCAT(_utf8mb4'a',_utf8'b'));
|
||||
CHARSET(CONCAT(_utf8mb4'a',_utf8'b'))
|
||||
utf8mb4
|
||||
CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 NOT NULL) ENGINE InnoDB;
|
||||
CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL) ENGINE InnoDB;
|
||||
INSERT INTO t1 VALUES (x'ea9da8'),(x'f48fbfbf');
|
||||
SELECT CONCAT(utf8mb4, _utf8 x'ea9da8') FROM t1 LIMIT 0;
|
||||
CONCAT(utf8mb4, _utf8 x'ea9da8')
|
||||
CREATE TABLE t2 (utf8mb3 VARCHAR(10) CHARACTER SET utf8mb3 NOT NULL) ENGINE InnoDB;
|
||||
CREATE TABLE t2 (utf8mb3 VARCHAR(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL) ENGINE InnoDB;
|
||||
INSERT INTO t2 VALUES (x'ea9da8');
|
||||
SELECT HEX(CONCAT(utf8mb4, utf8mb3)) FROM t1,t2 ORDER BY 1;
|
||||
HEX(CONCAT(utf8mb4, utf8mb3))
|
||||
@ -2648,12 +2656,12 @@ DROP TABLE t2;
|
||||
#
|
||||
# Check that mixing utf8mb4 with an invalid utf8 constant returns error
|
||||
#
|
||||
CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4) ENGINE InnoDB;
|
||||
CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci) ENGINE InnoDB;
|
||||
INSERT INTO t1 VALUES (x'f48fbfbf');
|
||||
SELECT CONCAT(utf8mb4, _utf8 '<27>') FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb3_general_ci,COERCIBLE) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb3_uca1400_ai_ci,COERCIBLE) for operation 'concat'
|
||||
SELECT CONCAT('a', _utf8 '<27>') FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) and (utf8mb3_general_ci,COERCIBLE) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_uca1400_ai_ci,COERCIBLE) and (utf8mb3_uca1400_ai_ci,COERCIBLE) for operation 'concat'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 5.5 tests
|
||||
@ -2666,7 +2674,8 @@ DROP TABLE t1;
|
||||
#
|
||||
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);
|
||||
|
@ -75,20 +75,20 @@ CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4) LIKE CONVERT(_koi8r'\xF7\xE1\xF3
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4);
|
||||
CONVERT(_koi8r'\xF7\xE1\xF3\xF1' USING utf8mb4) LIKE CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4)
|
||||
1
|
||||
SELECT 'a' = 'a ';
|
||||
'a' = 'a '
|
||||
SELECT 'a' = 'a ' collate utf8mb4_general_ci;
|
||||
'a' = 'a ' collate utf8mb4_general_ci
|
||||
1
|
||||
SELECT 'a\0' < 'a';
|
||||
'a\0' < 'a'
|
||||
SELECT 'a\0' < 'a' collate utf8mb4_general_ci;
|
||||
'a\0' < 'a' collate utf8mb4_general_ci
|
||||
1
|
||||
SELECT 'a\0' < 'a ';
|
||||
'a\0' < 'a '
|
||||
SELECT 'a\0' < 'a ' collate utf8mb4_general_ci;
|
||||
'a\0' < 'a ' collate utf8mb4_general_ci
|
||||
1
|
||||
SELECT 'a\t' < 'a';
|
||||
'a\t' < 'a'
|
||||
SELECT 'a\t' < 'a' collate utf8mb4_general_ci;
|
||||
'a\t' < 'a' collate utf8mb4_general_ci
|
||||
1
|
||||
SELECT 'a\t' < 'a ';
|
||||
'a\t' < 'a '
|
||||
SELECT 'a\t' < 'a ' collate utf8mb4_general_ci;
|
||||
'a\t' < 'a ' collate utf8mb4_general_ci
|
||||
1
|
||||
SELECT 'a' = 'a ' collate utf8mb4_bin;
|
||||
'a' = 'a ' collate utf8mb4_bin
|
||||
@ -105,7 +105,7 @@ SELECT 'a\t' < 'a' collate utf8mb4_bin;
|
||||
SELECT 'a\t' < 'a ' collate utf8mb4_bin;
|
||||
'a\t' < 'a ' collate utf8mb4_bin
|
||||
1
|
||||
CREATE TABLE t1 (a char(10) character set utf8mb4 not null) ENGINE MyISAM;
|
||||
CREATE TABLE t1 (a char(10) character set utf8mb4 collate utf8mb4_general_ci not null) ENGINE MyISAM;
|
||||
INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
|
||||
SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
|
||||
hex(a) STRCMP(a,'a') STRCMP(a,'a ')
|
||||
@ -127,7 +127,7 @@ create table t1 ENGINE MyISAM select date_format("2004-01-19 10:10:10", "%Y-%m-%
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`date_format("2004-01-19 10:10:10", "%Y-%m-%d")` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
`date_format("2004-01-19 10:10:10", "%Y-%m-%d")` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
select * from t1;
|
||||
date_format("2004-01-19 10:10:10", "%Y-%m-%d")
|
||||
@ -276,6 +276,9 @@ select * from t1 where a = 'b' and a != 'b';
|
||||
a
|
||||
drop table t1;
|
||||
set names utf8mb4;
|
||||
#
|
||||
# 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
|
||||
@ -284,8 +287,8 @@ select null, null;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`s1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`s2` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
`s1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
|
||||
`s2` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
delete from t1;
|
||||
insert into t1 values('aaa','aaa');
|
||||
@ -319,9 +322,13 @@ NULL
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
#
|
||||
# Bug #3928 regexp [[:>:]] and UTF-8
|
||||
#
|
||||
SELECT @@character_set_client, @@collation_connection;
|
||||
@@character_set_client @@collation_connection
|
||||
utf8mb4 utf8mb4_general_ci
|
||||
utf8mb4 utf8mb4_uca1400_ai_ci
|
||||
# This should return TRUE
|
||||
select 'вася' rlike '\\bвася\\b';
|
||||
'вася' rlike '\\bвася\\b'
|
||||
1
|
||||
@ -346,6 +353,7 @@ select ' вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
# This should return FALSE
|
||||
select 'васяz' rlike '\\bвася\\b';
|
||||
'васяz' rlike '\\bвася\\b'
|
||||
0
|
||||
@ -372,7 +380,7 @@ create table t1 (a enum('aaaa','проба') character set utf8mb4) engine MyISA
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` enum('aaaa','проба') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
`a` enum('aaaa','проба') CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
insert into t1 values ('проба');
|
||||
select * from t1;
|
||||
@ -382,7 +390,7 @@ create table t2 engine MyISAM select ifnull(a,a) from t1;
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ifnull(a,a)` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
`ifnull(a,a)` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
select * from t2;
|
||||
ifnull(a,a)
|
||||
@ -508,7 +516,7 @@ unique key a using hash (c(1))
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
|
||||
UNIQUE KEY `a` (`c`(1)) USING HASH
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
||||
@ -544,7 +552,7 @@ unique key a using btree (c(1))
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
|
||||
UNIQUE KEY `a` (`c`(1)) USING BTREE
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
|
||||
@ -906,8 +914,8 @@ create table t2 engine MyISAM select concat(a,_utf8mb4'') as a, concat(b,_utf8mb
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`a` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`b` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
|
||||
`a` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
|
||||
`b` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
@ -1473,7 +1481,7 @@ LENGTH(bug)
|
||||
100
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (item varchar(255)) default character set utf8mb4 ENGINE MyISAM;
|
||||
CREATE TABLE t1 (item varchar(255)) default character set utf8mb4 collate utf8mb4_general_ci ENGINE MyISAM;
|
||||
INSERT INTO t1 VALUES (N'\\');
|
||||
INSERT INTO t1 VALUES (_utf8mb4'\\');
|
||||
INSERT INTO t1 VALUES (N'Cote d\'Ivoire');
|
||||
@ -1809,7 +1817,7 @@ SET CHARACTER SET utf8mb4;
|
||||
SHOW VARIABLES LIKE 'character\_set\_%';
|
||||
Variable_name Value
|
||||
character_set_client utf8mb4
|
||||
character_set_collations
|
||||
character_set_collations utf8mb3=utf8mb3_uca1400_ai_ci,ucs2=ucs2_uca1400_ai_ci,utf8mb4=utf8mb4_uca1400_ai_ci,utf16=utf16_uca1400_ai_ci,utf32=utf32_uca1400_ai_ci
|
||||
character_set_connection latin1
|
||||
character_set_database latin1
|
||||
character_set_filesystem binary
|
||||
@ -1819,18 +1827,18 @@ character_set_system utf8mb3
|
||||
SET @@character_set_server=@save_character_set_server;
|
||||
CREATE DATABASE crashtest DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
|
||||
USE crashtest;
|
||||
CREATE TABLE crashtest (crash char(10)) DEFAULT CHARSET=utf8mb4 ENGINE MyISAM;
|
||||
CREATE TABLE crashtest (crash char(10)) DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci ENGINE MyISAM;
|
||||
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;
|
||||
crash
|
||||
35
|
||||
36
|
||||
37
|
||||
INSERT INTO crashtest VALUES ('-1000');
|
||||
EXPLAIN SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
|
||||
EXPLAIN SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4) COLLATE utf8mb4_general_ci;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE crashtest ALL NULL NULL NULL NULL 4 Using filesort
|
||||
SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4);
|
||||
SELECT * FROM crashtest ORDER BY CHAR(crash USING utf8mb4) COLLATE utf8mb4_general_ci;
|
||||
crash
|
||||
-1000
|
||||
35
|
||||
@ -2007,7 +2015,7 @@ insert into t1 values('t1_val');
|
||||
create view v1 as select 'v1_val' as col1;
|
||||
select coercibility(col1), collation(col1) from v1;
|
||||
coercibility(col1) collation(col1)
|
||||
5 utf8mb4_general_ci
|
||||
5 utf8mb4_uca1400_ai_ci
|
||||
create view v2 as select col1 from v1 union select col1 from t1;
|
||||
select coercibility(col1), collation(col1)from v2;
|
||||
coercibility(col1) collation(col1)
|
||||
@ -2041,7 +2049,7 @@ select concat(a, if(b>10, _utf8mb4'x', _utf8mb4'y')) from t1;
|
||||
concat(a, if(b>10, _utf8mb4'x', _utf8mb4'y'))
|
||||
ay
|
||||
select concat(a, if(b>10, _utf8mb4'æ', _utf8mb4'ß')) from t1;
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_uca1400_ai_ci,COERCIBLE) for operation 'concat'
|
||||
drop table t1;
|
||||
set names utf8mb4;
|
||||
create table t1 (a varchar(10) character set latin1, b int) engine MyISAM;
|
||||
@ -2050,7 +2058,7 @@ select concat(a, if(b>10, _utf8mb4 0x78, _utf8mb4 0x79)) from t1;
|
||||
concat(a, if(b>10, _utf8mb4 0x78, _utf8mb4 0x79))
|
||||
ay
|
||||
select concat(a, if(b>10, _utf8mb4 0xC3A6, _utf8mb4 0xC3AF)) from t1;
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_uca1400_ai_ci,COERCIBLE) for operation 'concat'
|
||||
drop table t1;
|
||||
set names utf8mb4;
|
||||
create table t1 (a varchar(10) character set latin1, b int) engine MyISAM;
|
||||
@ -2059,7 +2067,7 @@ select concat(a, if(b>10, 'x' 'x', 'y' 'y')) from t1;
|
||||
concat(a, if(b>10, 'x' 'x', 'y' 'y'))
|
||||
ayy
|
||||
select concat(a, if(b>10, 'x' 'æ', 'y' 'ß')) from t1;
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_uca1400_ai_ci,COERCIBLE) for operation 'concat'
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
colA int(11) NOT NULL,
|
||||
@ -2192,7 +2200,7 @@ DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (
|
||||
predicted_order int NOT NULL,
|
||||
utf8mb4_encoding VARCHAR(10) NOT NULL
|
||||
) CHARACTER SET utf8mb4 ENGINE MyISAM;
|
||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ENGINE MyISAM;
|
||||
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;
|
||||
predicted_order hex(utf8mb4_encoding)
|
||||
@ -2376,7 +2384,7 @@ t1 CREATE TABLE `t1` (
|
||||
`Tape` tinytext DEFAULT NULL,
|
||||
PRIMARY KEY (`clipid`),
|
||||
KEY `tape` (`Tape`(250))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Testing 4-byte values.
|
||||
@ -2385,7 +2393,7 @@ DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (
|
||||
u_decimal int NOT NULL,
|
||||
utf8mb4_encoding VARCHAR(10) NOT NULL
|
||||
) CHARACTER SET utf8mb4 ENGINE MyISAM;
|
||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ENGINE MyISAM;
|
||||
INSERT INTO t1 VALUES (119040, x'f09d8480'),
|
||||
# G CLEF
|
||||
(119070, x'f09d849e'),
|
||||
@ -2430,7 +2438,7 @@ DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t2 (
|
||||
u_decimal int NOT NULL,
|
||||
utf8mb3_encoding VARCHAR(10) NOT NULL
|
||||
) CHARACTER SET utf8mb3 ENGINE MyISAM;
|
||||
) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci ENGINE MyISAM;
|
||||
INSERT INTO t2 VALUES (42856, x'ea9da8');
|
||||
INSERT INTO t2 VALUES (65131, x'efb9ab');
|
||||
INSERT IGNORE INTO t2 VALUES (1114111, x'f48fbfbf');
|
||||
@ -2501,7 +2509,7 @@ WHERE t1.utf8mb4_encoding > t2.utf8mb3_encoding;
|
||||
count(*)
|
||||
33
|
||||
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;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
@ -2522,7 +2530,7 @@ u_decimal hex(utf8mb4_encoding) utf8mb4_encoding
|
||||
120735 3F ?
|
||||
65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB ﹫?????﹫﹫?﹫
|
||||
917999 3F ?
|
||||
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb4;
|
||||
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
@ -2534,7 +2542,7 @@ u_decimal hex(utf8mb3_encoding)
|
||||
1114111 3F3F3F3F
|
||||
42856 EA9DA8
|
||||
65131 EFB9AB
|
||||
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb3;
|
||||
ALTER TABLE t2 CONVERT TO CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
@ -2546,7 +2554,7 @@ u_decimal hex(utf8mb3_encoding)
|
||||
1114111 3F3F3F3F
|
||||
42856 EA9DA8
|
||||
65131 EFB9AB
|
||||
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;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
@ -2567,7 +2575,7 @@ u_decimal hex(utf8mb4_encoding)
|
||||
120735 3F
|
||||
65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB
|
||||
917999 3F
|
||||
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;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
@ -2588,7 +2596,7 @@ u_decimal hex(utf8mb4_encoding)
|
||||
120735 3F
|
||||
65131 EFB9AB3F3F3F3F3FEFB9ABEFB9AB3FEFB9AB
|
||||
917999 3F
|
||||
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;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
@ -2604,13 +2612,13 @@ DROP TABLE IF EXISTS t3;
|
||||
CREATE TABLE t3 (
|
||||
u_decimal int NOT NULL,
|
||||
utf8mb3_encoding VARCHAR(10) NOT NULL
|
||||
) CHARACTER SET utf8 ENGINE MyISAM;
|
||||
) CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE MyISAM;
|
||||
INSERT INTO t3 SELECT * FROM t1;
|
||||
DROP TABLE IF EXISTS t4;
|
||||
CREATE TABLE t4 (
|
||||
u_decimal int NOT NULL,
|
||||
utf8mb4_encoding VARCHAR(10) NOT NULL
|
||||
) CHARACTER SET utf8mb4 ENGINE MyISAM;
|
||||
) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ENGINE MyISAM;
|
||||
INSERT INTO t3 SELECT * FROM t2;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
@ -2622,11 +2630,11 @@ DROP TABLE t4;
|
||||
SELECT CHARSET(CONCAT(_utf8mb4'a',_utf8'b'));
|
||||
CHARSET(CONCAT(_utf8mb4'a',_utf8'b'))
|
||||
utf8mb4
|
||||
CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 NOT NULL) ENGINE MyISAM;
|
||||
CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL) ENGINE MyISAM;
|
||||
INSERT INTO t1 VALUES (x'ea9da8'),(x'f48fbfbf');
|
||||
SELECT CONCAT(utf8mb4, _utf8 x'ea9da8') FROM t1 LIMIT 0;
|
||||
CONCAT(utf8mb4, _utf8 x'ea9da8')
|
||||
CREATE TABLE t2 (utf8mb3 VARCHAR(10) CHARACTER SET utf8mb3 NOT NULL) ENGINE MyISAM;
|
||||
CREATE TABLE t2 (utf8mb3 VARCHAR(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL) ENGINE MyISAM;
|
||||
INSERT INTO t2 VALUES (x'ea9da8');
|
||||
SELECT HEX(CONCAT(utf8mb4, utf8mb3)) FROM t1,t2 ORDER BY 1;
|
||||
HEX(CONCAT(utf8mb4, utf8mb3))
|
||||
@ -2657,12 +2665,12 @@ DROP TABLE t2;
|
||||
#
|
||||
# Check that mixing utf8mb4 with an invalid utf8 constant returns error
|
||||
#
|
||||
CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4) ENGINE MyISAM;
|
||||
CREATE TABLE t1 (utf8mb4 VARCHAR(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci) ENGINE MyISAM;
|
||||
INSERT INTO t1 VALUES (x'f48fbfbf');
|
||||
SELECT CONCAT(utf8mb4, _utf8 '<27>') FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb3_general_ci,COERCIBLE) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb3_uca1400_ai_ci,COERCIBLE) for operation 'concat'
|
||||
SELECT CONCAT('a', _utf8 '<27>') FROM t1;
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_general_ci,COERCIBLE) and (utf8mb3_general_ci,COERCIBLE) for operation 'concat'
|
||||
ERROR HY000: Illegal mix of collations (utf8mb4_uca1400_ai_ci,COERCIBLE) and (utf8mb3_uca1400_ai_ci,COERCIBLE) for operation 'concat'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 5.5 tests
|
||||
@ -2675,7 +2683,8 @@ DROP TABLE t1;
|
||||
#
|
||||
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);
|
||||
|
@ -7728,7 +7728,7 @@ VARIABLE_NAME VARIABLE_VALUE
|
||||
CHARACTER_SET_CLIENT utf8mb4
|
||||
CHARACTER_SET_CONNECTION utf8mb4
|
||||
CHARACTER_SET_RESULTS utf8mb4
|
||||
COLLATION_CONNECTION utf8mb4_general_ci
|
||||
COLLATION_CONNECTION utf8mb4_uca1400_ai_ci
|
||||
---
|
||||
SET NAMES utf8mb4 COLLATE `binary`;
|
||||
ERROR 42000: COLLATION 'binary' is not valid for CHARACTER SET 'utf8mb4'
|
||||
@ -7737,7 +7737,7 @@ VARIABLE_NAME VARIABLE_VALUE
|
||||
CHARACTER_SET_CLIENT utf8mb4
|
||||
CHARACTER_SET_CONNECTION utf8mb4
|
||||
CHARACTER_SET_RESULTS utf8mb4
|
||||
COLLATION_CONNECTION utf8mb4_general_ci
|
||||
COLLATION_CONNECTION utf8mb4_uca1400_ai_ci
|
||||
---
|
||||
SET NAMES utf8mb4 COLLATE DEFAULT;
|
||||
SELECT * FROM vars;
|
||||
@ -7745,7 +7745,7 @@ VARIABLE_NAME VARIABLE_VALUE
|
||||
CHARACTER_SET_CLIENT utf8mb4
|
||||
CHARACTER_SET_CONNECTION utf8mb4
|
||||
CHARACTER_SET_RESULTS utf8mb4
|
||||
COLLATION_CONNECTION utf8mb4_general_ci
|
||||
COLLATION_CONNECTION utf8mb4_uca1400_ai_ci
|
||||
---
|
||||
SET NAMES utf8mb4 COLLATE utf8mb4_uca1400_ai_ci;
|
||||
SELECT * FROM vars;
|
||||
@ -7783,7 +7783,7 @@ SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(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;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
|
||||
ALTER TABLE t1 CONVERT TO CHARACTER SET DEFAULT COLLATE latin1_bin;
|
||||
@ -7811,7 +7811,7 @@ SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(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;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
|
||||
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8mb4 COLLATE DEFAULT;
|
||||
@ -7819,7 +7819,7 @@ SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(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;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
|
||||
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8mb4 COLLATE latin1_bin;
|
||||
@ -7889,7 +7889,7 @@ DROP DATABASE db1;
|
||||
CREATE DATABASE db1 COLLATE DEFAULT;
|
||||
SHOW CREATE DATABASE db1;
|
||||
Database Create Database
|
||||
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */
|
||||
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci */
|
||||
DROP DATABASE db1;
|
||||
CREATE DATABASE db1 COLLATE uca1400_ai_ci;
|
||||
SHOW CREATE DATABASE db1;
|
||||
@ -7909,7 +7909,7 @@ DROP DATABASE db1;
|
||||
CREATE DATABASE db1 CHARACTER SET DEFAULT COLLATE DEFAULT;
|
||||
SHOW CREATE DATABASE db1;
|
||||
Database Create Database
|
||||
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */
|
||||
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci */
|
||||
DROP DATABASE db1;
|
||||
CREATE DATABASE db1 CHARACTER SET DEFAULT COLLATE uca1400_ai_ci;
|
||||
SHOW CREATE DATABASE db1;
|
||||
@ -7953,7 +7953,7 @@ SHOW CREATE TABLE db1.t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(1) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
|
||||
DROP TABLE db1.t1;
|
||||
CREATE TABLE db1.t1 (a CHAR(1)) COLLATE uca1400_ai_ci;
|
||||
SHOW CREATE TABLE db1.t1;
|
||||
@ -7981,7 +7981,7 @@ SHOW CREATE TABLE db1.t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(1) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
|
||||
DROP TABLE db1.t1;
|
||||
CREATE TABLE db1.t1 (a CHAR(1)) CHARACTER SET DEFAULT COLLATE uca1400_ai_ci;
|
||||
SHOW CREATE TABLE db1.t1;
|
||||
|
622
mysql-test/main/ctype_utf8mb4_uca1400_ai_ci.result
Normal file
622
mysql-test/main/ctype_utf8mb4_uca1400_ai_ci.result
Normal file
@ -0,0 +1,622 @@
|
||||
#
|
||||
# Start of 5.5 tests
|
||||
#
|
||||
SET NAMES utf8mb4 COLLATE uca1400_ai_ci;
|
||||
SELECT COLLATION('a');
|
||||
COLLATION('a')
|
||||
utf8mb4_uca1400_ai_ci
|
||||
SELECT 'a' = 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\0' = 'a' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\0' = 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\t' = 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' = 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a' < 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' < 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' < 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' < 'a' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a\t' < 'a ' AS c;
|
||||
c
|
||||
1
|
||||
SELECT 'a' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' > 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\0' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' > 'a' AS c;
|
||||
c
|
||||
0
|
||||
SELECT 'a\t' > 'a ' AS c;
|
||||
c
|
||||
0
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS a LIMIT 0;
|
||||
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;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
|
||||
`a_readable` text CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci GENERATED ALWAYS AS (rpad(quote(regexp_replace(`a`,'(\\x{00}|\\x{09})','.')),10)) VIRTUAL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 (a) VALUES ('a'),('a\0'),('a\t'),('a ');
|
||||
SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
|
||||
hex(a) STRCMP(a,'a') STRCMP(a,'a ')
|
||||
61 0 0
|
||||
6100 0 0
|
||||
6109 -1 -1
|
||||
6120 0 0
|
||||
SELECT HEX(a), a_readable FROM t1 ORDER BY a, BINARY a;
|
||||
HEX(a) a_readable
|
||||
6109 'a.'
|
||||
61 'a'
|
||||
6100 'a.'
|
||||
6120 '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;
|
||||
t1a cmp t2a a_readable a_readable
|
||||
61 = 61 'a' 'a'
|
||||
61 = 6100 'a' 'a.'
|
||||
61 > 6109 'a' 'a.'
|
||||
61 = 6120 'a' 'a '
|
||||
6100 = 61 'a.' 'a'
|
||||
6100 = 6100 'a.' 'a.'
|
||||
6100 > 6109 'a.' 'a.'
|
||||
6100 = 6120 'a.' 'a '
|
||||
6109 < 61 'a.' 'a'
|
||||
6109 < 6100 'a.' 'a.'
|
||||
6109 = 6109 'a.' 'a.'
|
||||
6109 < 6120 'a.' 'a '
|
||||
6120 = 61 'a ' 'a'
|
||||
6120 = 6100 'a ' 'a.'
|
||||
6120 > 6109 'a ' 'a.'
|
||||
6120 = 6120 'a ' 'a '
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
#
|
||||
# Start of 5.6 tests
|
||||
#
|
||||
#
|
||||
# WL#3664 WEIGHT_STRING
|
||||
#
|
||||
SET NAMES utf8mb4 COLLATE uca1400_ai_ci;
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb4_uca1400_ai_ci
|
||||
CREATE TABLE t1 AS SELECT 'a' AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(16) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
2075
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
2075
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(80) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
|
||||
HEX(WEIGHT_STRING(a))
|
||||
20752075207520752075
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
20752075207520752075
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(3)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(48) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(3))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(3)))
|
||||
207520752075
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
207520752075
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(10)) AS ws FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`ws` varbinary(160) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1;
|
||||
HEX(WEIGHT_STRING(a AS CHAR(10)))
|
||||
2075207520752075207502090209020902090209
|
||||
SELECT HEX(ws) FROM t2;
|
||||
HEX(ws)
|
||||
2075207520752075207502090209020902090209
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
select hex(weight_string('a'));
|
||||
hex(weight_string('a'))
|
||||
2075
|
||||
select hex(weight_string('A'));
|
||||
hex(weight_string('A'))
|
||||
2075
|
||||
select hex(weight_string('abc'));
|
||||
hex(weight_string('abc'))
|
||||
2075208F20A9
|
||||
select hex(weight_string('abc' as char(2)));
|
||||
hex(weight_string('abc' as char(2)))
|
||||
2075208F
|
||||
select hex(weight_string('abc' as char(3)));
|
||||
hex(weight_string('abc' as char(3)))
|
||||
2075208F20A9
|
||||
select hex(weight_string('abc' as char(5)));
|
||||
hex(weight_string('abc' as char(5)))
|
||||
2075208F20A902090209
|
||||
select hex(weight_string('abc', 1, 2, 0xC0));
|
||||
hex(weight_string('abc', 1, 2, 0xC0))
|
||||
20
|
||||
select hex(weight_string('abc', 2, 2, 0xC0));
|
||||
hex(weight_string('abc', 2, 2, 0xC0))
|
||||
2075
|
||||
select hex(weight_string('abc', 3, 2, 0xC0));
|
||||
hex(weight_string('abc', 3, 2, 0xC0))
|
||||
207520
|
||||
select hex(weight_string('abc', 4, 2, 0xC0));
|
||||
hex(weight_string('abc', 4, 2, 0xC0))
|
||||
2075208F
|
||||
select hex(weight_string('abc', 5, 2, 0xC0));
|
||||
hex(weight_string('abc', 5, 2, 0xC0))
|
||||
2075208F02
|
||||
select hex(weight_string('abc',25, 2, 0xC0));
|
||||
hex(weight_string('abc',25, 2, 0xC0))
|
||||
2075208F020902090209020902090209020902090209020902
|
||||
select hex(weight_string('abc', 1, 3, 0xC0));
|
||||
hex(weight_string('abc', 1, 3, 0xC0))
|
||||
20
|
||||
select hex(weight_string('abc', 2, 3, 0xC0));
|
||||
hex(weight_string('abc', 2, 3, 0xC0))
|
||||
2075
|
||||
select hex(weight_string('abc', 3, 3, 0xC0));
|
||||
hex(weight_string('abc', 3, 3, 0xC0))
|
||||
207520
|
||||
select hex(weight_string('abc', 4, 3, 0xC0));
|
||||
hex(weight_string('abc', 4, 3, 0xC0))
|
||||
2075208F
|
||||
select hex(weight_string('abc', 5, 3, 0xC0));
|
||||
hex(weight_string('abc', 5, 3, 0xC0))
|
||||
2075208F20
|
||||
select hex(weight_string('abc',25, 3, 0xC0));
|
||||
hex(weight_string('abc',25, 3, 0xC0))
|
||||
2075208F20A902090209020902090209020902090209020902
|
||||
select hex(weight_string('abc', 1, 4, 0xC0));
|
||||
hex(weight_string('abc', 1, 4, 0xC0))
|
||||
20
|
||||
select hex(weight_string('abc', 2, 4, 0xC0));
|
||||
hex(weight_string('abc', 2, 4, 0xC0))
|
||||
2075
|
||||
select hex(weight_string('abc', 3, 4, 0xC0));
|
||||
hex(weight_string('abc', 3, 4, 0xC0))
|
||||
207520
|
||||
select hex(weight_string('abc', 4, 4, 0xC0));
|
||||
hex(weight_string('abc', 4, 4, 0xC0))
|
||||
2075208F
|
||||
select hex(weight_string('abc', 5, 4, 0xC0));
|
||||
hex(weight_string('abc', 5, 4, 0xC0))
|
||||
2075208F20
|
||||
select hex(weight_string('abc',25, 4, 0xC0));
|
||||
hex(weight_string('abc',25, 4, 0xC0))
|
||||
2075208F20A902090209020902090209020902090209020902
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb4_uca1400_ai_ci
|
||||
select hex(weight_string(cast(_latin1 0x80 as char)));
|
||||
hex(weight_string(cast(_latin1 0x80 as char)))
|
||||
2055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char)))
|
||||
205520552055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(2)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(2)))
|
||||
20552055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(3)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(3)))
|
||||
205520552055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char) as char(5)));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char) as char(5)))
|
||||
20552055205502090209
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0))
|
||||
2055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0))
|
||||
205520
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0))
|
||||
20552055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0))
|
||||
2055205502
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0))
|
||||
20552055020902090209020902090209020902090209020902
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0))
|
||||
2055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0))
|
||||
205520
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0))
|
||||
20552055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0))
|
||||
2055205520
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0))
|
||||
20552055205502090209020902090209020902090209020902
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0))
|
||||
20
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0))
|
||||
2055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0))
|
||||
205520
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0))
|
||||
20552055
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0))
|
||||
2055205520
|
||||
select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0));
|
||||
hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0))
|
||||
20552055205502090209020902090209020902090209020902
|
||||
select @@collation_connection;
|
||||
@@collation_connection
|
||||
utf8mb4_uca1400_ai_ci
|
||||
select hex(weight_string('a' LEVEL 1));
|
||||
hex(weight_string('a' LEVEL 1))
|
||||
2075
|
||||
select hex(weight_string('A' LEVEL 1));
|
||||
hex(weight_string('A' LEVEL 1))
|
||||
2075
|
||||
select hex(weight_string('abc' LEVEL 1));
|
||||
hex(weight_string('abc' LEVEL 1))
|
||||
2075208F20A9
|
||||
select hex(weight_string('abc' as char(2) LEVEL 1));
|
||||
hex(weight_string('abc' as char(2) LEVEL 1))
|
||||
2075208F
|
||||
select hex(weight_string('abc' as char(3) LEVEL 1));
|
||||
hex(weight_string('abc' as char(3) LEVEL 1))
|
||||
2075208F20A9
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1))
|
||||
2075208F20A902090209
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
|
||||
09020902A9208F207520
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
|
||||
DF8ADF70DF56FDF6FDF6
|
||||
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
|
||||
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
|
||||
F6FDF6FD56DF70DF8ADF
|
||||
#
|
||||
# End of 5.6 tests
|
||||
#
|
||||
#
|
||||
# Start of 10.0 tests
|
||||
#
|
||||
SET NAMES utf8mb4 COLLATE uca1400_ai_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
|
||||
union
|
||||
select null, null;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`s1` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
|
||||
`s2` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
delete from t1;
|
||||
insert into t1 values('aaa','aaa');
|
||||
insert into t1 values('aaa|qqq','qqq');
|
||||
insert into t1 values('gheis','^[^a-dXYZ]+$');
|
||||
insert into t1 values('aab','^aa?b');
|
||||
insert into t1 values('Baaan','^Ba*n');
|
||||
insert into t1 values('aaa','qqq|aaa');
|
||||
insert into t1 values('qqq','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq|aaa');
|
||||
insert into t1 values('bbb','qqq');
|
||||
insert into t1 values('aaa','aba');
|
||||
insert into t1 values(null,'abc');
|
||||
insert into t1 values('def',null);
|
||||
insert into t1 values(null,null);
|
||||
insert into t1 values('ghi','ghi[');
|
||||
select HIGH_PRIORITY s1 regexp s2 from t1;
|
||||
s1 regexp s2
|
||||
0
|
||||
0
|
||||
0
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
drop table t1;
|
||||
#
|
||||
# Bug #3928 regexp [[:>:]] and UTF-8
|
||||
#
|
||||
SELECT @@character_set_client, @@collation_connection;
|
||||
@@character_set_client @@collation_connection
|
||||
utf8mb4 utf8mb4_uca1400_ai_ci
|
||||
# This should return TRUE
|
||||
select 'вася' rlike '\\bвася\\b';
|
||||
'вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася ' rlike '\\bвася\\b';
|
||||
'вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася' rlike '\\bвася\\b';
|
||||
' вася' rlike '\\bвася\\b'
|
||||
1
|
||||
select ' вася ' rlike '\\bвася\\b';
|
||||
' вася ' rlike '\\bвася\\b'
|
||||
1
|
||||
select 'вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select 'вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
'вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
select ' вася ' rlike '[[:<:]]вася[[:>:]]';
|
||||
' вася ' rlike '[[:<:]]вася[[:>:]]'
|
||||
1
|
||||
# This should return FALSE
|
||||
select 'васяz' rlike '\\bвася\\b';
|
||||
'васяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвася' rlike '\\bвася\\b';
|
||||
'zвася' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'zвасяz' rlike '\\bвася\\b';
|
||||
'zвасяz' rlike '\\bвася\\b'
|
||||
0
|
||||
select 'васяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'васяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвася' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвася' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
select 'zвасяz' rlike '[[:<:]]вася[[:>:]]';
|
||||
'zвасяz' rlike '[[:<:]]вася[[:>:]]'
|
||||
0
|
||||
#
|
||||
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
|
||||
#
|
||||
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 utf8mb4 COLLATE utf8mb4_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';
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a '
|
||||
DROP TABLE t1;
|
||||
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 utf8mb4 COLLATE utf8mb4_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);
|
||||
c1
|
||||
a
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
c1
|
||||
a
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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 utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
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 utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('%'),('% ');
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
%
|
||||
SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
c1
|
||||
%
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1);
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`)
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
|
||||
#
|
||||
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 utf8mb4 COLLATE utf8mb4_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 ';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
a LENGTH(a)
|
||||
a 1
|
||||
EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`a` AS `a`,octet_length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where `test`.`t1`.`a` not like 'a ' and `test`.`t1`.`a` = 'a'
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of MDEV-8694
|
||||
#
|
||||
#
|
||||
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
|
||||
#
|
||||
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 utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
INSERT INTO t1 VALUES ('ae'),('ä');
|
||||
SELECT * FROM t1 WHERE c1='ä';
|
||||
c1
|
||||
ä
|
||||
SELECT * FROM t1 WHERE c1 LIKE 'ae';
|
||||
c1
|
||||
ae
|
||||
SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae';
|
||||
c1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE c1='ä' AND c1 LIKE 'ae';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where `test`.`t1`.`c1` = 'ä' and `test`.`t1`.`c1` like 'ae'
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='ä';
|
||||
c1
|
||||
ä
|
||||
SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'ae';
|
||||
c1
|
||||
ae
|
||||
SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae';
|
||||
c1
|
||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='ä' AND CONCAT(c1) LIKE 'ae';
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'ä' and concat(`test`.`t1`.`c1`) like 'ae'
|
||||
DROP TABLE IF EXISTS t1;
|
||||
#
|
||||
# End of 10.0 tests
|
||||
#
|
52
mysql-test/main/ctype_utf8mb4_uca1400_ai_ci.test
Normal file
52
mysql-test/main/ctype_utf8mb4_uca1400_ai_ci.test
Normal file
@ -0,0 +1,52 @@
|
||||
--echo #
|
||||
--echo # Start of 5.5 tests
|
||||
--echo #
|
||||
|
||||
SET NAMES utf8mb4 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 utf8mb4 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 utf8mb4 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 #
|
@ -1060,9 +1060,9 @@ CREATE TABLE t1 AS SELECT f1() AS c1, COALESCE(f1()) AS c2, CONCAT(f1()) AS c3;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` tinytext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c2` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c3` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`c1` tinytext CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c2` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c3` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
@ -1079,9 +1079,9 @@ CREATE TABLE t1 AS SELECT f1() AS c1, COALESCE(f1()) AS c2, CONCAT(f1()) AS c3;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c2` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c3` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`c1` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c2` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c3` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
@ -1098,9 +1098,9 @@ CREATE TABLE t1 AS SELECT f1() AS c1, COALESCE(f1()) AS c2, CONCAT(f1()) AS c3;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c2` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c3` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`c1` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c2` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c3` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
@ -1117,9 +1117,9 @@ CREATE TABLE t1 AS SELECT f1() AS c1, COALESCE(f1()) AS c2, CONCAT(f1()) AS c3;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c2` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c3` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`c1` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c2` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c3` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION f1;
|
||||
|
@ -53,7 +53,7 @@ koi8r_general_ci binary
|
||||
|
||||
SELECT COLLATION(c1) FROM v2|
|
||||
COLLATION(c1)
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
|
||||
SELECT * FROM v3|
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@ -104,7 +104,7 @@ koi8r_general_ci binary
|
||||
|
||||
SELECT COLLATION(c1) FROM v2|
|
||||
COLLATION(c1)
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
|
||||
SELECT * FROM v3|
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@ -160,7 +160,7 @@ koi8r_general_ci binary
|
||||
|
||||
SELECT COLLATION(c1) FROM v2|
|
||||
COLLATION(c1)
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
|
||||
SELECT * FROM v3|
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@ -441,37 +441,37 @@ CALL p1(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
|
||||
ca cb
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
|
||||
CALL p2(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_general_ci utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
|
||||
ca cb
|
||||
utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
|
||||
CALL mysqltest2.p3(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
|
||||
ca cb
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
|
||||
CALL mysqltest2.p4(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_general_ci utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
|
||||
ca cb
|
||||
utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
|
||||
|
||||
ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
|
||||
@ -484,22 +484,22 @@ CALL p1(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
CALL p2(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_general_ci utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
CALL mysqltest2.p3(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
CALL mysqltest2.p4(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_general_ci utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
set names koi8r|
|
||||
|
||||
|
||||
@ -686,37 +686,37 @@ CALL p1(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
|
||||
ca cb
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
|
||||
CALL p2(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_general_ci utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
|
||||
ca cb
|
||||
utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
|
||||
CALL mysqltest2.p3(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
|
||||
ca cb
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
|
||||
CALL mysqltest2.p4(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_general_ci utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
|
||||
ca cb
|
||||
utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
|
||||
---> Dump of mysqltest1
|
||||
/*!999999\- enable the sandbox mode */
|
||||
@ -887,22 +887,22 @@ CALL p1(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
CALL p2(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_general_ci utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
CALL mysqltest2.p3(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
CALL mysqltest2.p4(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_general_ci utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
set names koi8r|
|
||||
|
||||
|
||||
@ -1089,37 +1089,37 @@ CALL p1(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
|
||||
ca cb
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
|
||||
CALL p2(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_general_ci utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
|
||||
ca cb
|
||||
utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
|
||||
CALL mysqltest2.p3(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
|
||||
ca cb
|
||||
utf8mb3_unicode_ci utf8mb3_unicode_ci
|
||||
|
||||
CALL mysqltest2.p4(@a, @b)|
|
||||
c1 c2 c3
|
||||
utf8mb3_general_ci utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
c4 c5 c6 c7 c8
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r
|
||||
koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r
|
||||
SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
|
||||
ca cb
|
||||
utf8mb3_general_ci utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci utf8mb3_uca1400_ai_ci
|
||||
connection default;
|
||||
disconnect con2;
|
||||
disconnect con3;
|
||||
@ -1404,9 +1404,9 @@ koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_unicode_ci
|
||||
|
||||
SELECT
|
||||
@ -1417,7 +1417,7 @@ COLLATION(@b1) AS cb1,
|
||||
COLLATION(@b2) AS cb2,
|
||||
COLLATION(@b3) AS cb3|
|
||||
ca1 ca2 ca3 cb1 cb2 cb3
|
||||
koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci
|
||||
koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci
|
||||
|
||||
DELETE FROM log|
|
||||
|
||||
@ -1435,9 +1435,9 @@ koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_unicode_ci
|
||||
|
||||
SELECT
|
||||
@ -1448,7 +1448,7 @@ COLLATION(@b1) AS cb1,
|
||||
COLLATION(@b2) AS cb2,
|
||||
COLLATION(@b3) AS cb3|
|
||||
ca1 ca2 ca3 cb1 cb2 cb3
|
||||
koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci
|
||||
koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci
|
||||
|
||||
DELETE FROM mysqltest2.log|
|
||||
|
||||
@ -1676,9 +1676,9 @@ koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_unicode_ci
|
||||
|
||||
SELECT
|
||||
@ -1689,7 +1689,7 @@ COLLATION(@b1) AS cb1,
|
||||
COLLATION(@b2) AS cb2,
|
||||
COLLATION(@b3) AS cb3|
|
||||
ca1 ca2 ca3 cb1 cb2 cb3
|
||||
koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci
|
||||
koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci
|
||||
|
||||
DELETE FROM log|
|
||||
|
||||
@ -1707,9 +1707,9 @@ koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_unicode_ci
|
||||
|
||||
SELECT
|
||||
@ -1720,7 +1720,7 @@ COLLATION(@b1) AS cb1,
|
||||
COLLATION(@b2) AS cb2,
|
||||
COLLATION(@b3) AS cb3|
|
||||
ca1 ca2 ca3 cb1 cb2 cb3
|
||||
koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci
|
||||
koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci
|
||||
|
||||
DELETE FROM mysqltest2.log|
|
||||
|
||||
@ -2118,9 +2118,9 @@ koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_unicode_ci
|
||||
|
||||
SELECT
|
||||
@ -2131,7 +2131,7 @@ COLLATION(@b1) AS cb1,
|
||||
COLLATION(@b2) AS cb2,
|
||||
COLLATION(@b3) AS cb3|
|
||||
ca1 ca2 ca3 cb1 cb2 cb3
|
||||
koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci
|
||||
koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci
|
||||
|
||||
DELETE FROM log|
|
||||
|
||||
@ -2149,9 +2149,9 @@ koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
koi8r_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_general_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_uca1400_ai_ci
|
||||
utf8mb3_unicode_ci
|
||||
|
||||
SELECT
|
||||
@ -2162,7 +2162,7 @@ COLLATION(@b1) AS cb1,
|
||||
COLLATION(@b2) AS cb2,
|
||||
COLLATION(@b3) AS cb3|
|
||||
ca1 ca2 ca3 cb1 cb2 cb3
|
||||
koi8r_general_ci utf8mb3_general_ci koi8r_general_ci koi8r_general_ci utf8mb3_general_ci koi8r_general_ci
|
||||
koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci koi8r_general_ci utf8mb3_uca1400_ai_ci koi8r_general_ci
|
||||
|
||||
DELETE FROM mysqltest2.log|
|
||||
connection default;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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');
|
||||
|
@ -4,16 +4,16 @@
|
||||
select hex(COLUMN_CREATE(1, NULL AS char character set utf8)) as exp;
|
||||
exp
|
||||
000000
|
||||
select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8)) as ex;
|
||||
select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8 collate utf8_general_ci)) as ex;
|
||||
ex
|
||||
0001000100032161666166
|
||||
select hex(COLUMN_CREATE(1, 1212 AS char character set utf8)) as ex;
|
||||
select hex(COLUMN_CREATE(1, 1212 AS char character set utf8 collate utf8_general_ci)) as ex;
|
||||
ex
|
||||
0001000100032131323132
|
||||
select hex(COLUMN_CREATE(1, 12.12 AS char character set utf8)) as ex;
|
||||
select hex(COLUMN_CREATE(1, 12.12 AS char character set utf8 collate utf8_general_ci)) as ex;
|
||||
ex
|
||||
0001000100032131322E3132
|
||||
select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8)) as ex;
|
||||
select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8 collate utf8_general_ci)) as ex;
|
||||
ex
|
||||
000100010003213939393939393939393939393939393939393939393939393939393939
|
||||
select hex(COLUMN_CREATE(1, NULL AS unsigned int));
|
||||
@ -128,7 +128,7 @@ hex(COLUMN_CREATE(1, NULL AS datetime))
|
||||
select hex(COLUMN_CREATE(1, "2011-04-05 0:45:49.000001" AS datetime)) as ex;
|
||||
ex
|
||||
00010001000585B60F010010B70000
|
||||
select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8,
|
||||
select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8 collate utf8_general_ci,
|
||||
2, 1212 AS unsigned int,
|
||||
3, 1212 AS int,
|
||||
4, 12.12 AS double,
|
||||
@ -150,7 +150,7 @@ select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8,
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select hex(column_create(1,'afaf' AS char charset utf8mb3 collate utf8mb3_general_ci ,2,1212 AS unsigned int,3,1212 AS int,4,12.12 AS double,4 + 1,12.12 AS decimal,6,'2011-04-05' AS date,7,'- 0:45:49.000001' AS time,8,'2011-04-05 0:45:49.000001' AS datetime)) AS `ex`
|
||||
Note 1003 select hex(column_create(1,'afaf' AS char charset utf8mb3 collate utf8mb3_uca1400_ai_ci ,2,1212 AS unsigned int,3,1212 AS int,4,12.12 AS double,4 + 1,12.12 AS decimal,6,'2011-04-05' AS date,7,'- 0:45:49.000001' AS time,8,'2011-04-05 0:45:49.000001' AS datetime)) AS `ex`
|
||||
select hex(column_create(1, 0.0 AS decimal));
|
||||
hex(column_create(1, 0.0 AS decimal))
|
||||
000100010004
|
||||
@ -354,7 +354,7 @@ select column_get(column_create(1, "1212" AS char charset utf8), 1 as char chars
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select column_get(column_create(1,'1212' AS char charset utf8mb3 collate utf8mb3_general_ci ),1 as char charset utf8mb3) AS `ex`
|
||||
Note 1003 select column_get(column_create(1,'1212' AS char charset utf8mb3 collate utf8mb3_uca1400_ai_ci ),1 as char charset utf8mb3) AS `ex`
|
||||
select column_get(column_create(1, 1212 AS unsigned int), 1 as char charset utf8) as ex;
|
||||
ex
|
||||
1212
|
||||
@ -414,7 +414,7 @@ select column_get(column_create(1, "1212" AS char charset utf8), 1 as char chars
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select column_get(column_create(1,'1212' AS char charset utf8mb3 collate utf8mb3_general_ci ),1 as char charset binary) AS `ex`
|
||||
Note 1003 select column_get(column_create(1,'1212' AS char charset utf8mb3 collate utf8mb3_uca1400_ai_ci ),1 as char charset binary) AS `ex`
|
||||
#
|
||||
# column get real
|
||||
#
|
||||
@ -1882,7 +1882,7 @@ drop table t1;
|
||||
create view v1 as select column_get(column_add(column_create(1 , 'blue' as char), 2, 'ttt'), 1 as char);
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select column_get(column_add(column_create(1,'blue' AS char charset utf8mb3 collate utf8mb3_general_ci ),2,'ttt'),1 as char charset utf8mb3) AS `Name_exp_1` utf8mb3 utf8mb3_general_ci
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select column_get(column_add(column_create(1,'blue' AS char charset utf8mb3 collate utf8mb3_uca1400_ai_ci ),2,'ttt'),1 as char charset utf8mb3) AS `Name_exp_1` utf8mb3 utf8mb3_uca1400_ai_ci
|
||||
select * from v1;
|
||||
Name_exp_1
|
||||
blue
|
||||
|
@ -8,10 +8,10 @@
|
||||
--echo # column create
|
||||
--echo #
|
||||
select hex(COLUMN_CREATE(1, NULL AS char character set utf8)) as exp;
|
||||
select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8)) as ex;
|
||||
select hex(COLUMN_CREATE(1, 1212 AS char character set utf8)) as ex;
|
||||
select hex(COLUMN_CREATE(1, 12.12 AS char character set utf8)) as ex;
|
||||
select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8)) as ex;
|
||||
select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8 collate utf8_general_ci)) as ex;
|
||||
select hex(COLUMN_CREATE(1, 1212 AS char character set utf8 collate utf8_general_ci)) as ex;
|
||||
select hex(COLUMN_CREATE(1, 12.12 AS char character set utf8 collate utf8_general_ci)) as ex;
|
||||
select hex(COLUMN_CREATE(1, 99999999999999999999999999999 AS char character set utf8 collate utf8_general_ci)) as ex;
|
||||
select hex(COLUMN_CREATE(1, NULL AS unsigned int));
|
||||
select hex(COLUMN_CREATE(1, 1212 AS unsigned int));
|
||||
select hex(COLUMN_CREATE(1, 7 AS unsigned int));
|
||||
@ -48,7 +48,7 @@ select hex(COLUMN_CREATE(1, NULL AS time));
|
||||
select hex(COLUMN_CREATE(1, "0:45:49.000001" AS time));
|
||||
select hex(COLUMN_CREATE(1, NULL AS datetime));
|
||||
select hex(COLUMN_CREATE(1, "2011-04-05 0:45:49.000001" AS datetime)) as ex;
|
||||
select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8,
|
||||
select hex(COLUMN_CREATE(1, "afaf" AS char character set utf8 collate utf8_general_ci,
|
||||
2, 1212 AS unsigned int,
|
||||
3, 1212 AS int,
|
||||
4, 12.12 AS double,
|
||||
|
@ -362,10 +362,10 @@ INSERT t1 VALUES ("
|
||||
("<22><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD>!"),("<22> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>!");
|
||||
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
||||
t collation(t)
|
||||
<EFBFBD><EFBFBD><EFBFBD> <20><> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> utf8mb3_general_ci
|
||||
<EFBFBD><EFBFBD><EFBFBD> <20><> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> utf8mb3_uca1400_ai_ci
|
||||
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('<27><><EFBFBD>*' IN BOOLEAN MODE);
|
||||
t collation(t)
|
||||
<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>! utf8mb3_general_ci
|
||||
<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>! utf8mb3_uca1400_ai_ci
|
||||
SELECT * FROM t1 WHERE MATCH t AGAINST ('<27><><EFBFBD>' IN BOOLEAN MODE);
|
||||
t
|
||||
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabr<62>ck');
|
||||
@ -373,12 +373,12 @@ t collation(t)
|
||||
SET NAMES latin1;
|
||||
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabr<62>ck');
|
||||
t collation(t)
|
||||
aus Osnabr<62>ck utf8mb3_general_ci
|
||||
aus Osnabr<62>ck utf8mb3_uca1400_ai_ci
|
||||
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
|
||||
t collation(t)
|
||||
SELECT t, collation(t),FORMAT(MATCH t AGAINST ('Osnabruck'),6) FROM t1 WHERE MATCH t AGAINST ('Osnabruck');
|
||||
t collation(t) FORMAT(MATCH t AGAINST ('Osnabruck'),6)
|
||||
aus Osnabr<62>ck utf8mb3_general_ci 1.591140
|
||||
aus Osnabr<62>ck utf8mb3_uca1400_ai_ci 1.591140
|
||||
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
|
||||
alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
|
||||
Warnings:
|
||||
|
@ -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;
|
||||
|
@ -3145,8 +3145,8 @@ FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`c1` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c2` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`c1` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c2` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT
|
||||
MAX(COALESCE(c1)) AS c1,
|
||||
@ -3196,9 +3196,9 @@ FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`c1` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c2` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c3` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`c1` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c2` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c3` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT
|
||||
MAX(COALESCE(c1)) AS c1,
|
||||
@ -3240,7 +3240,7 @@ FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`c1` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`c1` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT
|
||||
MAX(COALESCE(c1)) AS c1
|
||||
@ -3315,8 +3315,8 @@ FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`c1` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c2` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`c1` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c2` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT
|
||||
@c1:=c1 AS c1,
|
||||
@ -3364,9 +3364,9 @@ FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`c1` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c2` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c3` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`c1` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c2` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c3` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT
|
||||
@c:=c1 AS c1,
|
||||
@ -3406,7 +3406,7 @@ FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`c1` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`c1` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT
|
||||
@c:=c1 AS c1
|
||||
@ -3492,8 +3492,8 @@ COALESCE(_latin1'aaa',_utf8 0xC39F) AS c2;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
|
||||
`c2` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL
|
||||
`c1` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL,
|
||||
`c2` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
|
@ -414,6 +414,24 @@ select json_object('foo', json_unquote(json_object('bar', c)),'qux', c) as fld f
|
||||
fld
|
||||
{"foo": "{\"bar\": \"abc\"}", "qux": "abc"}
|
||||
{"foo": "{\"bar\": \"def\"}", "qux": "def"}
|
||||
select json_unquote(json_object('bar', c)) as c1 from t1;
|
||||
c1
|
||||
{"bar": "abc"}
|
||||
{"bar": "def"}
|
||||
select
|
||||
collation(json_unquote(json_object('bar', c))) as coll_json_unquote,
|
||||
coercibility(json_unquote(json_object('bar', c))) as coer_json_unquote,
|
||||
coercibility('bar') as coer_literal
|
||||
from t1 limit 1;
|
||||
coll_json_unquote coer_json_unquote coer_literal
|
||||
utf8mb3_general_ci 4 5
|
||||
create table t2 as select json_object('foo', json_unquote(json_object('bar', c)),'qux', c) as fld from t1 limit 0;
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`fld` varchar(39) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
select json_object("a", json_object("b", "abcd"));
|
||||
json_object("a", json_object("b", "abcd"))
|
||||
|
@ -178,6 +178,16 @@ create table t1 (c VARCHAR(8)) DEFAULT CHARSET=latin1;
|
||||
insert into t1 values ('abc'),('def');
|
||||
|
||||
select json_object('foo', json_unquote(json_object('bar', c)),'qux', c) as fld from t1;
|
||||
select json_unquote(json_object('bar', c)) as c1 from t1;
|
||||
select
|
||||
collation(json_unquote(json_object('bar', c))) as coll_json_unquote,
|
||||
coercibility(json_unquote(json_object('bar', c))) as coer_json_unquote,
|
||||
coercibility('bar') as coer_literal
|
||||
from t1 limit 1;
|
||||
|
||||
create table t2 as select json_object('foo', json_unquote(json_object('bar', c)),'qux', c) as fld from t1 limit 0;
|
||||
show create table t2;
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
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
|
||||
|
@ -62,7 +62,7 @@ INSERT INTO t2 VALUES ('\\p{Han}'),('\\p{Hangul}');
|
||||
INSERT INTO t2 VALUES ('\\p{Sinhala}'), ('\\p{Tamil}');
|
||||
INSERT INTO t2 VALUES ('\\p{L}'),('\\p{Ll}'),('\\p{Lu}'),('\\p{L&}');
|
||||
INSERT INTO t2 VALUES ('[[:alpha:]]'),('[[:digit:]]');
|
||||
SELECT class, ch, ch RLIKE class FROM t1, t2 ORDER BY class, BINARY ch;
|
||||
SELECT class, ch, ch RLIKE class FROM t1, t2 ORDER BY BINARY class, BINARY ch;
|
||||
class ch ch RLIKE class
|
||||
[[:alpha:]] 1 0
|
||||
[[:alpha:]] A 1
|
||||
@ -436,7 +436,7 @@ CREATE TABLE t1 AS SELECT REGEXP_REPLACE('abc','b','x');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`REGEXP_REPLACE('abc','b','x')` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`REGEXP_REPLACE('abc','b','x')` longtext CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1;
|
||||
EXPLAIN EXTENDED SELECT REGEXP_REPLACE('abc','b','x');
|
||||
@ -739,7 +739,7 @@ CREATE TABLE t1 AS SELECT REGEXP_SUBSTR('abc','b');
|
||||
#
|
||||
# Checking REGEXP_SUBSTR
|
||||
#
|
||||
CREATE TABLE t1 AS SELECT REGEXP_SUBSTR('abc','b');
|
||||
CREATE TABLE t1 AS SELECT REGEXP_SUBSTR('abc','b');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
|
@ -43,7 +43,8 @@ INSERT INTO t2 VALUES ('\\p{Han}'),('\\p{Hangul}');
|
||||
INSERT INTO t2 VALUES ('\\p{Sinhala}'), ('\\p{Tamil}');
|
||||
INSERT INTO t2 VALUES ('\\p{L}'),('\\p{Ll}'),('\\p{Lu}'),('\\p{L&}');
|
||||
INSERT INTO t2 VALUES ('[[:alpha:]]'),('[[:digit:]]');
|
||||
SELECT class, ch, ch RLIKE class FROM t1, t2 ORDER BY class, BINARY ch;
|
||||
# Use "ORDER BY BINARY" to avoid dependency on the default utf8 collation
|
||||
SELECT class, ch, ch RLIKE class FROM t1, t2 ORDER BY BINARY class, BINARY ch;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
# Checking that UCP is disabled by default for binary data
|
||||
|
@ -428,7 +428,7 @@ create table t1 as select sformat(_ucs2 x'003D007B007D003D', _ucs2 x'04420435044
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`x` longtext CHARACTER SET ucs2 COLLATE ucs2_general_ci DEFAULT NULL
|
||||
`x` longtext CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
drop table t1;
|
||||
set names latin1;
|
||||
|
@ -5150,9 +5150,9 @@ FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`cn` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c0` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c1` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`cn` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c0` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c1` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
@ -5168,9 +5168,9 @@ FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`cn` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c0` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c1` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`cn` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c0` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c1` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (i BIGINT);
|
||||
@ -5183,9 +5183,9 @@ FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`cn` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c0` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c1` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`cn` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c0` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c1` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (i BIGINT);
|
||||
@ -5198,9 +5198,9 @@ FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`cn` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c0` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c1` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`cn` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c0` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c1` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1, t2;
|
||||
CREATE TABLE t1 (i BIGINT);
|
||||
@ -5213,9 +5213,9 @@ FROM t1;
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`cn` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c0` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c1` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`cn` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c0` char(0) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`c1` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
SELECT c1 FROM t2;
|
||||
c1
|
||||
@ -5261,7 +5261,7 @@ conv(i,16,2)
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`conv(i,16,2)` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`conv(i,16,2)` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
@ -5689,6 +5689,15 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
||||
Warnings:
|
||||
Note 1003 select cast(1 as char charset binary) AS `c`,convert('a' using binary) AS `CONVERT('a' USING binary)`,cast('a' as char charset binary) AS `BINARY'a'`
|
||||
SELECT
|
||||
coercibility(collation('a')),
|
||||
coercibility(charset('a')),
|
||||
coercibility(user()),
|
||||
coercibility(database());
|
||||
coercibility(collation('a')) 3
|
||||
coercibility(charset('a')) 3
|
||||
coercibility(user()) 3
|
||||
coercibility(database()) 3
|
||||
#
|
||||
# End of 11.5 tests
|
||||
#
|
||||
|
@ -2597,6 +2597,14 @@ EXPLAIN EXTENDED SELECT
|
||||
CONVERT('a' USING binary),
|
||||
BINARY'a';
|
||||
|
||||
--vertical_results
|
||||
SELECT
|
||||
coercibility(collation('a')),
|
||||
coercibility(charset('a')),
|
||||
coercibility(user()),
|
||||
coercibility(database());
|
||||
--horizontal_results
|
||||
|
||||
--echo #
|
||||
--echo # End of 11.5 tests
|
||||
--echo #
|
||||
|
@ -649,11 +649,11 @@ alter table t1 default character set utf8;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`CHARACTER_SET_NAME` varchar(32) NOT NULL,
|
||||
`DEFAULT_COLLATE_NAME` varchar(64) NOT NULL,
|
||||
`DESCRIPTION` varchar(60) NOT NULL,
|
||||
`CHARACTER_SET_NAME` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
|
||||
`DEFAULT_COLLATE_NAME` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
|
||||
`DESCRIPTION` varchar(60) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
|
||||
`MAXLEN` bigint(3) 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 view v1 as select * from information_schema.TABLES;
|
||||
drop view v1;
|
||||
@ -2514,7 +2514,7 @@ DROP TABLE t1;
|
||||
#
|
||||
# MDEV-24868 Server crashes in optimize_schema_tables_memory_usage after select from information_schema.innodb_sys_columns
|
||||
#
|
||||
create table t1 ( name varchar(64) character set utf8, len int);
|
||||
create table t1 ( name varchar(64) character set utf8 collate utf8_general_ci, len int);
|
||||
select * from t1 where (name, len) in (select name, len from information_schema.innodb_sys_columns having len = 8);
|
||||
name len
|
||||
drop table t1;
|
||||
|
@ -2070,7 +2070,7 @@ DROP TABLE t1;
|
||||
--echo #
|
||||
--echo # MDEV-24868 Server crashes in optimize_schema_tables_memory_usage after select from information_schema.innodb_sys_columns
|
||||
--echo #
|
||||
create table t1 ( name varchar(64) character set utf8, len int);
|
||||
create table t1 ( name varchar(64) character set utf8 collate utf8_general_ci, len int);
|
||||
select * from t1 where (name, len) in (select name, len from information_schema.innodb_sys_columns having len = 8);
|
||||
drop table t1;
|
||||
|
||||
|
@ -553,8 +553,8 @@ RETURN CONCAT('XYZ, ' ,s);
|
||||
SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
|
||||
WHERE SPECIFIC_SCHEMA = 'i_s_parameters_test' AND SPECIFIC_NAME = 'test_func5';
|
||||
SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE PARAMETER_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_TYPE
|
||||
def i_s_parameters_test test_func5 0 NULL NULL varchar 30 90 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(30) FUNCTION
|
||||
def i_s_parameters_test test_func5 1 IN s char 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(20) FUNCTION
|
||||
def i_s_parameters_test test_func5 0 NULL NULL varchar 30 90 NULL NULL NULL utf8mb3 utf8mb3_uca1400_ai_ci varchar(30) FUNCTION
|
||||
def i_s_parameters_test test_func5 1 IN s char 20 60 NULL NULL NULL utf8mb3 utf8mb3_uca1400_ai_ci char(20) FUNCTION
|
||||
DROP DATABASE i_s_parameters_test;
|
||||
USE test;
|
||||
#
|
||||
|
@ -911,7 +911,7 @@ RETURN CONCAT('XYZ, ' ,s);
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES
|
||||
WHERE ROUTINE_SCHEMA = 'i_s_routines_test' AND ROUTINE_NAME = 'test_func5';
|
||||
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
test_func5 def i_s_routines_test test_func5 FUNCTION varchar 30 90 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(30) SQL RETURN CONCAT('XYZ, ' ,s) NULL NULL SQL NO CONTAINS SQL NULL DEFINER <created> <modified> root@localhost latin1 latin1_swedish_ci utf8mb3_general_ci
|
||||
test_func5 def i_s_routines_test test_func5 FUNCTION varchar 30 90 NULL NULL NULL utf8mb3 utf8mb3_uca1400_ai_ci varchar(30) SQL RETURN CONCAT('XYZ, ' ,s) NULL NULL SQL NO CONTAINS SQL NULL DEFINER <created> <modified> root@localhost latin1 latin1_swedish_ci utf8mb3_uca1400_ai_ci
|
||||
DROP DATABASE i_s_routines_test;
|
||||
#
|
||||
# MDEV-20609 Full table scan in INFORMATION_SCHEMA.PARAMETERS/ROUTINES
|
||||
|
@ -26,7 +26,7 @@ json json_normalize(json)
|
||||
create view v1 as (select json, json_normalize(json) norm_json from t1);
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`json` AS `json`,json_normalize(`t1`.`json`) AS `norm_json` from `t1`) utf8mb3 utf8mb3_general_ci
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`json` AS `json`,json_normalize(`t1`.`json`) AS `norm_json` from `t1`) utf8mb3 utf8mb3_uca1400_ai_ci
|
||||
select * from v1
|
||||
order by json;
|
||||
json norm_json
|
||||
|
@ -244,8 +244,8 @@ create table t1 (c varchar(30) character set utf8, t text character set utf8, un
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`t` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
|
||||
`c` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
`t` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
|
||||
UNIQUE KEY `c` (`c`(2)),
|
||||
UNIQUE KEY `t` (`t`(3))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
|
@ -105,9 +105,9 @@ Warnings:
|
||||
Note 1265 Data truncated for column 'd' at row 1
|
||||
SET lc_time_names=ru_RU;
|
||||
SELECT c FROM t1 WHERE DAYNAME(d)<>c;
|
||||
ERROR HY000: Illegal mix of collations (utf8mb3_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<>'
|
||||
ERROR HY000: Illegal mix of collations (utf8mb3_uca1400_ai_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<>'
|
||||
SELECT c FROM t1 WHERE MONTHNAME(d)<>c;
|
||||
ERROR HY000: Illegal mix of collations (utf8mb3_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<>'
|
||||
ERROR HY000: Illegal mix of collations (utf8mb3_uca1400_ai_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<>'
|
||||
SET lc_time_names=en_US;
|
||||
SELECT c FROM t1 WHERE DAYNAME(d)<>c;
|
||||
c
|
||||
@ -232,7 +232,7 @@ a a1 b b1
|
||||
10 Oct October 10 Окт Октября 123,456,789.00 123'456'789,00
|
||||
show create view v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select date_format('2001-10-02','%c %b %M') AS `a`,date_format('2001-10-02','%c %b %M','ru_RU') AS `a1`,format(123456789,2) AS `b`,format(123456789,2,'rm_CH') AS `b1` utf8mb3 utf8mb3_general_ci
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select date_format('2001-10-02','%c %b %M') AS `a`,date_format('2001-10-02','%c %b %M','ru_RU') AS `a1`,format(123456789,2) AS `b`,format(123456789,2,'rm_CH') AS `b1` utf8mb3 utf8mb3_uca1400_ai_ci
|
||||
drop view v1;
|
||||
#
|
||||
# End of 10.2 tests
|
||||
|
@ -288,7 +288,7 @@ ON UPDATE CURRENT_TIMESTAMP,
|
||||
`server_id` int(10) unsigned NOT NULL,
|
||||
`command_type` varchar(64) NOT NULL,
|
||||
`argument` mediumtext NOT NULL
|
||||
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log';
|
||||
) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='General log';
|
||||
CREATE TABLE `slow_log` (
|
||||
`start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
ON UPDATE CURRENT_TIMESTAMP,
|
||||
@ -304,7 +304,7 @@ ON UPDATE CURRENT_TIMESTAMP,
|
||||
`sql_text` mediumtext NOT NULL,
|
||||
`thread_id` BIGINT(21) UNSIGNED NOT NULL,
|
||||
`rows_affected` bigint(20) unsigned NOT NULL
|
||||
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log';
|
||||
) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='Slow log';
|
||||
set global general_log='ON';
|
||||
set global slow_query_log='ON';
|
||||
use test;
|
||||
|
@ -288,7 +288,7 @@ CREATE TABLE `general_log` (
|
||||
`server_id` int(10) unsigned NOT NULL,
|
||||
`command_type` varchar(64) NOT NULL,
|
||||
`argument` mediumtext NOT NULL
|
||||
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log';
|
||||
) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='General log';
|
||||
|
||||
CREATE TABLE `slow_log` (
|
||||
`start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
@ -305,7 +305,7 @@ CREATE TABLE `slow_log` (
|
||||
`sql_text` mediumtext NOT NULL,
|
||||
`thread_id` BIGINT(21) UNSIGNED NOT NULL,
|
||||
`rows_affected` bigint(20) unsigned NOT NULL
|
||||
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log';
|
||||
) ENGINE=CSV DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='Slow log';
|
||||
|
||||
set global general_log='ON';
|
||||
set global slow_query_log='ON';
|
||||
|
@ -301,7 +301,7 @@ unique key a using hash (c(1))
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`c` char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
|
||||
UNIQUE KEY `a` (`c`(1)) USING HASH
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
insert into t1 values ('б');
|
||||
|
@ -357,6 +357,27 @@ drop user 'mysqltest_1'@'localhost';
|
||||
drop tables a, B;
|
||||
drop database db1;
|
||||
#
|
||||
# MDEV-32025 Crashes in MDL_key::mdl_key_init with lower-case-table-names=2
|
||||
#
|
||||
CREATE DATABASE `#mysql50#D+b1`;
|
||||
ALTER DATABASE `#mysql50#D+b1` UPGRADE DATA DIRECTORY NAME;
|
||||
SHOW CREATE DATABASE `D+b1`;
|
||||
Database Create Database
|
||||
D+b1 CREATE DATABASE `D+b1` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */
|
||||
SHOW CREATE DATABASE `d+b1`;
|
||||
Database Create Database
|
||||
d+b1 CREATE DATABASE `d+b1` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */
|
||||
DROP DATABASE `D+b1`;
|
||||
CREATE DATABASE Db1;
|
||||
ALTER DATABASE Db1 DEFAULT CHARACTER SET utf8;
|
||||
SHOW CREATE DATABASE Db1;
|
||||
Database Create Database
|
||||
Db1 CREATE DATABASE `Db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci */
|
||||
SHOW CREATE DATABASE db1;
|
||||
Database Create Database
|
||||
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci */
|
||||
DROP DATABASE Db1;
|
||||
#
|
||||
# MDEV-32026 lowercase_table2.test failures in 11.3
|
||||
#
|
||||
CREATE DATABASE Db1;
|
||||
@ -396,10 +417,10 @@ CREATE DATABASE Db1;
|
||||
ALTER DATABASE Db1 DEFAULT CHARACTER SET utf8;
|
||||
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 */
|
||||
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 */
|
||||
DROP DATABASE Db1;
|
||||
USE test;
|
||||
# End of 10.4 tests
|
||||
|
@ -1,14 +1,14 @@
|
||||
CREATE DATABASE mysql_TEST CHARACTER SET utf8;
|
||||
SHOW CREATE DATABASE mysql_TEST;
|
||||
Database Create Database
|
||||
mysql_TEST CREATE DATABASE `mysql_TEST` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */
|
||||
mysql_TEST CREATE DATABASE `mysql_TEST` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci */
|
||||
CREATE DATABASE mysql_test CHARACTER SET latin2;
|
||||
SHOW CREATE DATABASE mysql_test;
|
||||
Database Create Database
|
||||
mysql_test CREATE DATABASE `mysql_test` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_general_ci */
|
||||
SHOW CREATE DATABASE mysql_TEST;
|
||||
Database Create Database
|
||||
mysql_TEST CREATE DATABASE `mysql_TEST` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */
|
||||
mysql_TEST CREATE DATABASE `mysql_TEST` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci */
|
||||
DROP DATABASE mysql_test;
|
||||
DROP DATABASE mysql_TEST;
|
||||
#
|
||||
|
@ -1957,7 +1957,7 @@ create table t1 (v char(10) character set utf8);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` char(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`v` char(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
drop table t1;
|
||||
create table t1 (v varchar(10), c char(10)) row_format=fixed;
|
||||
@ -2009,7 +2009,7 @@ Note 1246 Converting column 'v' from VARCHAR to TEXT
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`v` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
drop table t1;
|
||||
set default_storage_engine=MEMORY;
|
||||
|
@ -766,7 +766,7 @@ create table t1 (v char(10) character set utf8);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` char(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`v` char(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
drop table t1;
|
||||
create table t1 (v varchar(10), c char(10)) row_format=fixed;
|
||||
|
@ -1678,7 +1678,7 @@ create table t1 (v char(10) character set utf8);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` char(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`v` char(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
drop table t1;
|
||||
create table t1 (v varchar(10), c char(10)) row_format=fixed;
|
||||
@ -1730,7 +1730,7 @@ Note 1246 Converting column 'v' from VARCHAR to TEXT
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`v` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
|
||||
`v` mediumtext CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
drop table t1;
|
||||
set statement sql_mode='' for
|
||||
@ -2408,7 +2408,7 @@ KEY (c2)
|
||||
|
||||
MyISAM file: MYSQLD_DATADIR/test/t1
|
||||
Record format: Packed
|
||||
Character set: utf8mb3_general_ci (33)
|
||||
Character set: ? (0)
|
||||
Data records: 0 Deleted blocks: 0
|
||||
Recordlength: 94
|
||||
|
||||
|
@ -564,7 +564,7 @@ SET @@session.sql_mode=#/*!*/;
|
||||
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=#/*!*/;
|
||||
SET @@session.character_set_collations=''/*!*/;
|
||||
SET @@session.character_set_collations='utf8mb3=utf8mb3_uca1400_ai_ci,ucs2=ucs2_uca1400_ai_ci,utf8mb4=utf8mb4_uca1400_ai_ci,utf16=utf16_uca1400_ai_ci,utf32=utf32_uca1400_ai_ci'/*!*/;
|
||||
SET @@session.lc_time_names=0/*!*/;
|
||||
SET @@session.collation_database=DEFAULT/*!*/;
|
||||
create table t1 (a varchar(64) character set utf8)
|
||||
|
@ -262,8 +262,8 @@ USE `a@b`;
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
|
||||
WHERE TRIGGER_SCHEMA="a@b" ORDER BY trigger_name;
|
||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
def a@b tr1 INSERT def a@b c@d 1 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
|
||||
def a@b tr2 INSERT def a@b t1 1 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8mb3 utf8mb3_general_ci latin1_swedish_ci
|
||||
def a@b tr1 INSERT def a@b c@d 1 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8mb3 utf8mb3_uca1400_ai_ci latin1_swedish_ci
|
||||
def a@b tr2 INSERT def a@b t1 1 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8mb3 utf8mb3_uca1400_ai_ci latin1_swedish_ci
|
||||
INSERT INTO `c@d` VALUES (2), (1);
|
||||
SELECT * FROM `c@d`;
|
||||
a
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user