1drop table if exists t1; 2DROP TABLE IF EXISTS t1; 3SHOW COLLATION LIKE 'cp1250_czech_cs'; 4Collation Charset Id Default Compiled Sortlen 5cp1250_czech_cs cp1250 34 Yes 2 6SET @test_character_set= 'cp1250'; 7SET @test_collation= 'cp1250_general_ci'; 8SET @safe_character_set_server= @@character_set_server; 9SET @safe_collation_server= @@collation_server; 10SET @safe_character_set_client= @@character_set_client; 11SET @safe_character_set_results= @@character_set_results; 12SET character_set_server= @test_character_set; 13SET collation_server= @test_collation; 14CREATE DATABASE d1; 15USE d1; 16CREATE TABLE t1 (c CHAR(10), KEY(c)); 17SHOW FULL COLUMNS FROM t1; 18Field Type Collation Null Key Default Extra Privileges Comment 19c char(10) cp1250_general_ci YES MUL NULL 20INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); 21SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; 22want3results 23aaa 24aaaa 25aaaaa 26DROP TABLE t1; 27CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); 28SHOW FULL COLUMNS FROM t1; 29Field Type Collation Null Key Default Extra Privileges Comment 30c1 varchar(15) cp1250_general_ci YES MUL NULL 31INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); 32SELECT c1 as want3results from t1 where c1 like 'l%'; 33want3results 34location 35loberge 36lotre 37SELECT c1 as want3results from t1 where c1 like 'lo%'; 38want3results 39location 40loberge 41lotre 42SELECT c1 as want1result from t1 where c1 like 'loc%'; 43want1result 44location 45SELECT c1 as want1result from t1 where c1 like 'loca%'; 46want1result 47location 48SELECT c1 as want1result from t1 where c1 like 'locat%'; 49want1result 50location 51SELECT c1 as want1result from t1 where c1 like 'locati%'; 52want1result 53location 54SELECT c1 as want1result from t1 where c1 like 'locatio%'; 55want1result 56location 57SELECT c1 as want1result from t1 where c1 like 'location%'; 58want1result 59location 60DROP TABLE t1; 61create table t1 (a set('a') not null); 62insert ignore into t1 values (),(); 63Warnings: 64Warning 1364 Field 'a' doesn't have a default value 65select cast(a as char(1)) from t1; 66cast(a as char(1)) 67 68 69select a sounds like a from t1; 70a sounds like a 711 721 73select 1 from t1 order by cast(a as char(1)); 741 751 761 77drop table t1; 78# 79# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found 80# 81SET character_set_client=latin1; 82SET character_set_connection= @test_character_set; 83SET collation_connection= @test_collation; 84SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1; 85COLLATION('.') c1 86cp1250_general_ci .wwwmysqlcom 87set names utf8; 88create table t1 ( 89name varchar(10), 90level smallint unsigned); 91show create table t1; 92Table Create Table 93t1 CREATE TABLE `t1` ( 94 `name` varchar(10) DEFAULT NULL, 95 `level` smallint(5) unsigned DEFAULT NULL 96) ENGINE=MyISAM DEFAULT CHARSET=cp1250 97insert into t1 values ('string',1); 98select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; 99concat(name,space(level)) concat(name, repeat(' ',level)) 100string string 101drop table t1; 102DROP DATABASE d1; 103USE test; 104SET character_set_server= @safe_character_set_server; 105SET collation_server= @safe_collation_server; 106SET character_set_client= @safe_character_set_client; 107SET character_set_results= @safe_character_set_results; 108# 109# MDEV-7149 Constant condition propagation erroneously applied for LIKE 110# 111CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; 112SHOW CREATE TABLE t1; 113Table Create Table 114t1 CREATE TABLE `t1` ( 115 `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL 116) ENGINE=MyISAM DEFAULT CHARSET=latin1 117INSERT INTO t1 VALUES ('a'),('a '); 118SELECT * FROM t1 WHERE CONCAT(c1)='a'; 119c1 120a 121a 122SELECT * FROM t1 WHERE CONCAT(c1) LIKE 'a '; 123c1 124a 125SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; 126c1 127a 128EXPLAIN EXTENDED SELECT * FROM t1 WHERE CONCAT(c1)='a' AND CONCAT(c1) LIKE 'a '; 129id select_type table type possible_keys key key_len ref rows filtered Extra 1301 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where 131Warnings: 132Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where concat(`test`.`t1`.`c1`) = 'a' and concat(`test`.`t1`.`c1`) like 'a ' 133DROP TABLE t1; 134CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; 135SHOW CREATE TABLE t1; 136Table Create Table 137t1 CREATE TABLE `t1` ( 138 `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL 139) ENGINE=MyISAM DEFAULT CHARSET=latin1 140INSERT INTO t1 VALUES ('a'),('a '); 141SELECT * FROM t1 WHERE 'a'=CONCAT(c1); 142c1 143a 144a 145SELECT * FROM t1 WHERE 'a ' LIKE CONCAT(c1); 146c1 147a 148SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); 149c1 150a 151EXPLAIN EXTENDED SELECT * FROM t1 WHERE 'a'=CONCAT(c1) AND 'a ' LIKE CONCAT(c1); 152id select_type table type possible_keys key key_len ref rows filtered Extra 1531 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where 154Warnings: 155Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 'a' = concat(`test`.`t1`.`c1`) and 'a ' like concat(`test`.`t1`.`c1`) 156DROP TABLE t1; 157CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; 158SHOW CREATE TABLE t1; 159Table Create Table 160t1 CREATE TABLE `t1` ( 161 `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL 162) ENGINE=MyISAM DEFAULT CHARSET=latin1 163INSERT INTO t1 VALUES ('%'),('% '); 164SELECT * FROM t1 WHERE '% '=CONCAT(c1); 165c1 166% 167% 168SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); 169c1 170% 171SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); 172c1 173% 174EXPLAIN EXTENDED SELECT * FROM t1 WHERE '% '=CONCAT(c1) AND 'a' LIKE CONCAT(c1); 175id select_type table type possible_keys key key_len ref rows filtered Extra 1761 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where 177Warnings: 178Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '% ' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) 179DROP TABLE t1; 180CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS c1 LIMIT 0; 181SHOW CREATE TABLE t1; 182Table Create Table 183t1 CREATE TABLE `t1` ( 184 `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL 185) ENGINE=MyISAM DEFAULT CHARSET=latin1 186INSERT INTO t1 VALUES ('%'),('% '); 187SELECT * FROM t1 WHERE '%'=CONCAT(c1); 188c1 189% 190% 191SELECT * FROM t1 WHERE 'a' LIKE CONCAT(c1); 192c1 193% 194SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); 195c1 196% 197EXPLAIN EXTENDED SELECT * FROM t1 WHERE '%'=CONCAT(c1) AND 'a' LIKE CONCAT(c1); 198id select_type table type possible_keys key key_len ref rows filtered Extra 1991 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where 200Warnings: 201Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where '%' = concat(`test`.`t1`.`c1`) and 'a' like concat(`test`.`t1`.`c1`) 202DROP TABLE t1; 203# 204# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' 205# 206CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; 207SHOW CREATE TABLE t1; 208Table Create Table 209t1 CREATE TABLE `t1` ( 210 `a` varchar(10) CHARACTER SET utf8 DEFAULT NULL 211) ENGINE=MyISAM DEFAULT CHARSET=latin1 212INSERT INTO t1 VALUES ('a'),('a '); 213SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a '; 214a LENGTH(a) 215a 1 216SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; 217a LENGTH(a) 218a 1 219EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; 220id select_type table type possible_keys key key_len ref rows filtered Extra 2211 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where 222Warnings: 223Note 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' 224DROP TABLE t1; 225# 226# End of MDEV-8694 227# 228SET @test_character_set= 'cp1250'; 229SET @test_collation= 'cp1250_czech_cs'; 230SET @safe_character_set_server= @@character_set_server; 231SET @safe_collation_server= @@collation_server; 232SET @safe_character_set_client= @@character_set_client; 233SET @safe_character_set_results= @@character_set_results; 234SET character_set_server= @test_character_set; 235SET collation_server= @test_collation; 236CREATE DATABASE d1; 237USE d1; 238CREATE TABLE t1 (c CHAR(10), KEY(c)); 239SHOW FULL COLUMNS FROM t1; 240Field Type Collation Null Key Default Extra Privileges Comment 241c char(10) cp1250_czech_cs YES MUL NULL 242INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); 243SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; 244want3results 245aaa 246aaaa 247aaaaa 248DROP TABLE t1; 249CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); 250SHOW FULL COLUMNS FROM t1; 251Field Type Collation Null Key Default Extra Privileges Comment 252c1 varchar(15) cp1250_czech_cs YES MUL NULL 253INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); 254SELECT c1 as want3results from t1 where c1 like 'l%'; 255want3results 256location 257loberge 258lotre 259SELECT c1 as want3results from t1 where c1 like 'lo%'; 260want3results 261location 262loberge 263lotre 264SELECT c1 as want1result from t1 where c1 like 'loc%'; 265want1result 266location 267SELECT c1 as want1result from t1 where c1 like 'loca%'; 268want1result 269location 270SELECT c1 as want1result from t1 where c1 like 'locat%'; 271want1result 272location 273SELECT c1 as want1result from t1 where c1 like 'locati%'; 274want1result 275location 276SELECT c1 as want1result from t1 where c1 like 'locatio%'; 277want1result 278location 279SELECT c1 as want1result from t1 where c1 like 'location%'; 280want1result 281location 282DROP TABLE t1; 283create table t1 (a set('a') not null); 284insert ignore into t1 values (),(); 285Warnings: 286Warning 1364 Field 'a' doesn't have a default value 287select cast(a as char(1)) from t1; 288cast(a as char(1)) 289 290 291select a sounds like a from t1; 292a sounds like a 2931 2941 295select 1 from t1 order by cast(a as char(1)); 2961 2971 2981 299drop table t1; 300# 301# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found 302# 303SET character_set_client=latin1; 304SET character_set_connection= @test_character_set; 305SET collation_connection= @test_collation; 306SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1; 307COLLATION('.') c1 308cp1250_czech_cs .wwwmysqlcom 309set names utf8; 310create table t1 ( 311name varchar(10), 312level smallint unsigned); 313show create table t1; 314Table Create Table 315t1 CREATE TABLE `t1` ( 316 `name` varchar(10) COLLATE cp1250_czech_cs DEFAULT NULL, 317 `level` smallint(5) unsigned DEFAULT NULL 318) ENGINE=MyISAM DEFAULT CHARSET=cp1250 COLLATE=cp1250_czech_cs 319insert into t1 values ('string',1); 320select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; 321concat(name,space(level)) concat(name, repeat(' ',level)) 322string string 323drop table t1; 324DROP DATABASE d1; 325USE test; 326SET character_set_server= @safe_character_set_server; 327SET collation_server= @safe_collation_server; 328SET character_set_client= @safe_character_set_client; 329SET character_set_results= @safe_character_set_results; 330CREATE TABLE t1 (a char(16)) character set cp1250 collate cp1250_czech_cs; 331INSERT INTO t1 VALUES (''); 332SELECT a, length(a), a='', a=' ', a=' ' FROM t1; 333a length(a) a='' a=' ' a=' ' 334 0 1 1 1 335DROP TABLE t1; 336CREATE TABLE t1 ( 337popisek varchar(30) collate cp1250_general_ci NOT NULL default '', 338PRIMARY KEY (`popisek`) 339); 340INSERT INTO t1 VALUES ('2005-01-1'); 341SELECT * FROM t1 WHERE popisek = '2005-01-1'; 342popisek 3432005-01-1 344SELECT * FROM t1 WHERE popisek LIKE '2005-01-1'; 345popisek 3462005-01-1 347drop table t1; 348set names cp1250; 349CREATE TABLE t1 350( 351id INT AUTO_INCREMENT PRIMARY KEY, 352str VARCHAR(32) CHARACTER SET cp1250 COLLATE cp1250_czech_cs NOT NULL default '', 353UNIQUE KEY (str) 354); 355INSERT INTO t1 VALUES (NULL, 'a'); 356INSERT INTO t1 VALUES (NULL, 'aa'); 357INSERT INTO t1 VALUES (NULL, 'aaa'); 358INSERT INTO t1 VALUES (NULL, 'aaaa'); 359INSERT INTO t1 VALUES (NULL, 'aaaaa'); 360INSERT INTO t1 VALUES (NULL, 'aaaaaa'); 361INSERT INTO t1 VALUES (NULL, 'aaaaaaa'); 362select * from t1 where str like 'aa%'; 363id str 3642 aa 3653 aaa 3664 aaaa 3675 aaaaa 3686 aaaaaa 3697 aaaaaaa 370drop table t1; 371set names cp1250; 372create table t1 (a varchar(15) collate cp1250_czech_cs NOT NULL, primary key(a)); 373insert into t1 values("abcdefgh�"); 374insert into t1 values("����"); 375select a from t1 where a like "abcdefgh�"; 376a 377abcdefgh� 378drop table t1; 379set names cp1250 collate cp1250_czech_cs; 380SELECT strcmp('a','a '), strcmp('a ','a'); 381strcmp('a','a ') strcmp('a ','a') 3820 0 383SELECT strcmp('a\0','a' ), strcmp('a','a\0'); 384strcmp('a\0','a' ) strcmp('a','a\0') 3851 -1 386SELECT strcmp('a\0','a '), strcmp('a ','a\0'); 387strcmp('a\0','a ') strcmp('a ','a\0') 3881 -1 389SELECT strcmp('a\t','a' ), strcmp('a', 'a\t'); 390strcmp('a\t','a' ) strcmp('a', 'a\t') 3911 -1 392SELECT strcmp('a\t','a '), strcmp('a ', 'a\t'); 393strcmp('a\t','a ') strcmp('a ', 'a\t') 3941 -1 395create table t1 select repeat('a',4000) a; 396delete from t1; 397insert into t1 values ('a'), ('a '), ('a\t'); 398select collation(a),hex(a) from t1 order by a; 399collation(a) hex(a) 400cp1250_czech_cs 61 401cp1250_czech_cs 6109 402cp1250_czech_cs 6120 403drop table t1; 404# 405# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP 406# 407SELECT @@collation_connection; 408@@collation_connection 409cp1250_czech_cs 410CREATE TABLE t1 (i INT) ENGINE=MyISAM; 411INSERT INTO t1 VALUES (1),(2); 412SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP; 413i 4141 4151 416SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP; 417i 4181 4191 420DROP TABLE t1; 421# 422# MDEV-6170 Incorrect ordering with utf8_bin and utf8mb4_bin collations 423# 424SELECT @@collation_connection; 425@@collation_connection 426cp1250_czech_cs 427CREATE TABLE t1 ENGINE=MEMORY AS SELECT REPEAT('a',5) AS a LIMIT 0; 428INSERT INTO t1 (a) VALUES ("a"); 429INSERT INTO t1 (a) VALUES ("b"); 430INSERT INTO t1 (a) VALUES ("c"); 431INSERT INTO t1 (a) VALUES ("d"); 432INSERT INTO t1 (a) VALUES ("e"); 433INSERT INTO t1 (a) VALUES ("f"); 434INSERT INTO t1 (a) VALUES ("g"); 435INSERT INTO t1 (a) VALUES ("h"); 436INSERT INTO t1 (a) VALUES ("i"); 437INSERT INTO t1 (a) VALUES ("j"); 438INSERT INTO t1 (a) VALUES ("k"); 439INSERT INTO t1 (a) VALUES ("l"); 440INSERT INTO t1 (a) VALUES ("m"); 441SELECT * FROM t1 ORDER BY LOWER(a); 442a 443a 444b 445c 446d 447e 448f 449g 450h 451i 452j 453k 454l 455m 456SELECT * FROM t1 ORDER BY LOWER(a) DESC; 457a 458m 459l 460k 461j 462i 463h 464g 465f 466e 467d 468c 469b 470a 471DROP TABLE t1; 472set global LC_MESSAGES=convert((@@global.log_bin_trust_function_creators) 473using cp1250); 474ERROR HY000: Unknown locale: 'ON' 475# 476# Start of 5.6 tests 477# 478# 479# WL#3664 WEIGHT_STRING 480# 481# 482# Note: 483# cp1250_czech_cs does not support WEIGHT_STRING in full extent 484# 485set names cp1250 collate cp1250_czech_cs; 486select @@collation_connection; 487@@collation_connection 488cp1250_czech_cs 489CREATE TABLE t1 AS SELECT 'a' AS a; 490SHOW CREATE TABLE t1; 491Table Create Table 492t1 CREATE TABLE `t1` ( 493 `a` varchar(1) CHARACTER SET cp1250 COLLATE cp1250_czech_cs NOT NULL 494) ENGINE=MyISAM DEFAULT CHARSET=latin1 495CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1; 496SHOW CREATE TABLE t2; 497Table Create Table 498t2 CREATE TABLE `t2` ( 499 `ws` varbinary(2) DEFAULT NULL 500) ENGINE=MyISAM DEFAULT CHARSET=latin1 501SELECT HEX(WEIGHT_STRING(a)) FROM t1; 502HEX(WEIGHT_STRING(a)) 503A402 504SELECT HEX(ws) FROM t2; 505HEX(ws) 506A402 507DROP TABLE t2; 508DROP TABLE t1; 509CREATE TABLE t1 AS SELECT REPEAT('a',5) AS a; 510SHOW CREATE TABLE t1; 511Table Create Table 512t1 CREATE TABLE `t1` ( 513 `a` varchar(5) CHARACTER SET cp1250 COLLATE cp1250_czech_cs DEFAULT NULL 514) ENGINE=MyISAM DEFAULT CHARSET=latin1 515CREATE TABLE t2 AS SELECT WEIGHT_STRING(a) AS ws FROM t1; 516SHOW CREATE TABLE t2; 517Table Create Table 518t2 CREATE TABLE `t2` ( 519 `ws` varbinary(10) DEFAULT NULL 520) ENGINE=MyISAM DEFAULT CHARSET=latin1 521SELECT HEX(WEIGHT_STRING(a)) FROM t1; 522HEX(WEIGHT_STRING(a)) 523A4A4A4A4A40202020202 524SELECT HEX(ws) FROM t2; 525HEX(ws) 526A4A4A4A4A40202020202 527DROP TABLE t2; 528CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(3)) AS ws FROM t1; 529SHOW CREATE TABLE t2; 530Table Create Table 531t2 CREATE TABLE `t2` ( 532 `ws` varbinary(10) DEFAULT NULL 533) ENGINE=MyISAM DEFAULT CHARSET=latin1 534SELECT HEX(WEIGHT_STRING(a AS CHAR(3))) FROM t1; 535HEX(WEIGHT_STRING(a AS CHAR(3))) 536A4A4A4A4A40202020202 537SELECT HEX(ws) FROM t2; 538HEX(ws) 539A4A4A4A4A40202020202 540DROP TABLE t2; 541CREATE TABLE t2 AS SELECT WEIGHT_STRING(a AS CHAR(10)) AS ws FROM t1; 542SHOW CREATE TABLE t2; 543Table Create Table 544t2 CREATE TABLE `t2` ( 545 `ws` varbinary(10) DEFAULT NULL 546) ENGINE=MyISAM DEFAULT CHARSET=latin1 547SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1; 548HEX(WEIGHT_STRING(a AS CHAR(10))) 549A4A4A4A4A40202020202 550SELECT HEX(ws) FROM t2; 551HEX(ws) 552A4A4A4A4A40202020202 553DROP TABLE t2; 554DROP TABLE t1; 555select hex(weight_string('a')); 556hex(weight_string('a')) 557A402 558select hex(weight_string('A')); 559hex(weight_string('A')) 560A401 561select hex(weight_string('abc')); 562hex(weight_string('abc')) 563A4A5A6020202 564select hex(weight_string('abc' as char(2))); 565hex(weight_string('abc' as char(2))) 566A4A5A6020202 567select hex(weight_string('abc' as char(3))); 568hex(weight_string('abc' as char(3))) 569A4A5A6020202 570select hex(weight_string('abc' as char(5))); 571hex(weight_string('abc' as char(5))) 572A4A5A6020202 573select hex(weight_string('abc', 1, 2, 0xC0)); 574hex(weight_string('abc', 1, 2, 0xC0)) 575A4 576select hex(weight_string('abc', 2, 2, 0xC0)); 577hex(weight_string('abc', 2, 2, 0xC0)) 578A4A5 579select hex(weight_string('abc', 3, 2, 0xC0)); 580hex(weight_string('abc', 3, 2, 0xC0)) 581A4A5A6 582select hex(weight_string('abc', 4, 2, 0xC0)); 583hex(weight_string('abc', 4, 2, 0xC0)) 584A4A5A602 585select hex(weight_string('abc', 5, 2, 0xC0)); 586hex(weight_string('abc', 5, 2, 0xC0)) 587A4A5A60202 588select hex(weight_string('abc',25, 2, 0xC0)); 589hex(weight_string('abc',25, 2, 0xC0)) 590A4A5A602020200000000000000000000000000000000000000 591select hex(weight_string('abc', 1, 3, 0xC0)); 592hex(weight_string('abc', 1, 3, 0xC0)) 593A4 594select hex(weight_string('abc', 2, 3, 0xC0)); 595hex(weight_string('abc', 2, 3, 0xC0)) 596A4A5 597select hex(weight_string('abc', 3, 3, 0xC0)); 598hex(weight_string('abc', 3, 3, 0xC0)) 599A4A5A6 600select hex(weight_string('abc', 4, 3, 0xC0)); 601hex(weight_string('abc', 4, 3, 0xC0)) 602A4A5A602 603select hex(weight_string('abc', 5, 3, 0xC0)); 604hex(weight_string('abc', 5, 3, 0xC0)) 605A4A5A60202 606select hex(weight_string('abc',25, 3, 0xC0)); 607hex(weight_string('abc',25, 3, 0xC0)) 608A4A5A602020200000000000000000000000000000000000000 609select hex(weight_string('abc', 1, 4, 0xC0)); 610hex(weight_string('abc', 1, 4, 0xC0)) 611A4 612select hex(weight_string('abc', 2, 4, 0xC0)); 613hex(weight_string('abc', 2, 4, 0xC0)) 614A4A5 615select hex(weight_string('abc', 3, 4, 0xC0)); 616hex(weight_string('abc', 3, 4, 0xC0)) 617A4A5A6 618select hex(weight_string('abc', 4, 4, 0xC0)); 619hex(weight_string('abc', 4, 4, 0xC0)) 620A4A5A602 621select hex(weight_string('abc', 5, 4, 0xC0)); 622hex(weight_string('abc', 5, 4, 0xC0)) 623A4A5A60202 624select hex(weight_string('abc',25, 4, 0xC0)); 625hex(weight_string('abc',25, 4, 0xC0)) 626A4A5A602020200000000000000000000000000000000000000 627select @@collation_connection; 628@@collation_connection 629cp1250_czech_cs 630select hex(weight_string(cast(_latin1 0x80 as char))); 631hex(weight_string(cast(_latin1 0x80 as char))) 6328123 633select hex(weight_string(cast(_latin1 0x808080 as char))); 634hex(weight_string(cast(_latin1 0x808080 as char))) 635818181232323 636select hex(weight_string(cast(_latin1 0x808080 as char) as char(2))); 637hex(weight_string(cast(_latin1 0x808080 as char) as char(2))) 638818181232323 639select hex(weight_string(cast(_latin1 0x808080 as char) as char(3))); 640hex(weight_string(cast(_latin1 0x808080 as char) as char(3))) 641818181232323 642select hex(weight_string(cast(_latin1 0x808080 as char) as char(5))); 643hex(weight_string(cast(_latin1 0x808080 as char) as char(5))) 644818181232323 645select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)); 646hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0)) 64781 648select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)); 649hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0)) 6508181 651select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)); 652hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0)) 653818181 654select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)); 655hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0)) 65681818123 657select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)); 658hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0)) 6598181812323 660select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)); 661hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0)) 66281818123232300000000000000000000000000000000000000 663select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)); 664hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0)) 66581 666select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)); 667hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0)) 6688181 669select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)); 670hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0)) 671818181 672select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)); 673hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0)) 67481818123 675select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)); 676hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0)) 6778181812323 678select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)); 679hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0)) 68081818123232300000000000000000000000000000000000000 681select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)); 682hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0)) 68381 684select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)); 685hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0)) 6868181 687select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)); 688hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0)) 689818181 690select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)); 691hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0)) 69281818123 693select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)); 694hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0)) 6958181812323 696select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)); 697hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0)) 69881818123232300000000000000000000000000000000000000 699select @@collation_connection; 700@@collation_connection 701cp1250_czech_cs 702select collation(cast(_latin1 0xDF as char)); 703collation(cast(_latin1 0xDF as char)) 704cp1250_czech_cs 705select hex(weight_string('s')); 706hex(weight_string('s')) 707B902 708select hex(weight_string(cast(_latin1 0xDF as char))); 709hex(weight_string(cast(_latin1 0xDF as char))) 710BB01 711select hex(weight_string(cast(_latin1 0xDF as char) as char(1))); 712hex(weight_string(cast(_latin1 0xDF as char) as char(1))) 713BB01 714select hex(weight_string('c')); 715hex(weight_string('c')) 716A602 717select hex(weight_string('h')); 718hex(weight_string('h')) 719AC02 720select hex(weight_string('ch')); 721hex(weight_string('ch')) 722AD03 723select hex(weight_string('i')); 724hex(weight_string('i')) 725AE02 726select hex(weight_string(cast(_latin1 0x6368DF as char))); 727hex(weight_string(cast(_latin1 0x6368DF as char))) 728ADBB0301 729select hex(weight_string(cast(_latin1 0x6368DF as char) as char(1))); 730hex(weight_string(cast(_latin1 0x6368DF as char) as char(1))) 731ADBB0301 732select hex(weight_string(cast(_latin1 0x6368DF as char) as char(2))); 733hex(weight_string(cast(_latin1 0x6368DF as char) as char(2))) 734ADBB0301 735select hex(weight_string(cast(_latin1 0x6368DF as char) as char(3))); 736hex(weight_string(cast(_latin1 0x6368DF as char) as char(3))) 737ADBB0301 738select hex(weight_string(cast(_latin1 0x6368DF as char) as char(4))); 739hex(weight_string(cast(_latin1 0x6368DF as char) as char(4))) 740ADBB0301 741select hex(weight_string(cast(_latin1 0xDF6368 as char))); 742hex(weight_string(cast(_latin1 0xDF6368 as char))) 743BBAD0103 744select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1))); 745hex(weight_string(cast(_latin1 0xDF6368 as char) as char(1))) 746BBAD0103 747select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2))); 748hex(weight_string(cast(_latin1 0xDF6368 as char) as char(2))) 749BBAD0103 750select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3))); 751hex(weight_string(cast(_latin1 0xDF6368 as char) as char(3))) 752BBAD0103 753select hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4))); 754hex(weight_string(cast(_latin1 0xDF6368 as char) as char(4))) 755BBAD0103 756select hex(weight_string(cast(_latin1 0x6368DF as char), 1, 2, 0xC0)); 757hex(weight_string(cast(_latin1 0x6368DF as char), 1, 2, 0xC0)) 758AD 759select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 2, 0xC0)); 760hex(weight_string(cast(_latin1 0x6368DF as char), 2, 2, 0xC0)) 761ADBB 762select hex(weight_string(cast(_latin1 0x6368DF as char), 3, 2, 0xC0)); 763hex(weight_string(cast(_latin1 0x6368DF as char), 3, 2, 0xC0)) 764ADBB03 765select hex(weight_string(cast(_latin1 0x6368DF as char), 4, 2, 0xC0)); 766hex(weight_string(cast(_latin1 0x6368DF as char), 4, 2, 0xC0)) 767ADBB0301 768select hex(weight_string(cast(_latin1 0x6368DF as char),25, 2, 0xC0)); 769hex(weight_string(cast(_latin1 0x6368DF as char),25, 2, 0xC0)) 770ADBB0301000000000000000000000000000000000000000000 771select hex(weight_string(cast(_latin1 0x6368DF as char), 1, 3, 0xC0)); 772hex(weight_string(cast(_latin1 0x6368DF as char), 1, 3, 0xC0)) 773AD 774select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 3, 0xC0)); 775hex(weight_string(cast(_latin1 0x6368DF as char), 2, 3, 0xC0)) 776ADBB 777select hex(weight_string(cast(_latin1 0x6368DF as char), 3, 3, 0xC0)); 778hex(weight_string(cast(_latin1 0x6368DF as char), 3, 3, 0xC0)) 779ADBB03 780select hex(weight_string(cast(_latin1 0x6368DF as char), 4, 3, 0xC0)); 781hex(weight_string(cast(_latin1 0x6368DF as char), 4, 3, 0xC0)) 782ADBB0301 783select hex(weight_string(cast(_latin1 0x6368DF as char),25, 3, 0xC0)); 784hex(weight_string(cast(_latin1 0x6368DF as char),25, 3, 0xC0)) 785ADBB0301000000000000000000000000000000000000000000 786select hex(weight_string(cast(_latin1 0x6368DF as char), 1, 4, 0xC0)); 787hex(weight_string(cast(_latin1 0x6368DF as char), 1, 4, 0xC0)) 788AD 789select hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0)); 790hex(weight_string(cast(_latin1 0x6368DF as char), 2, 4, 0xC0)) 791ADBB 792select hex(weight_string(cast(_latin1 0x6368DF as char), 3, 4, 0xC0)); 793hex(weight_string(cast(_latin1 0x6368DF as char), 3, 4, 0xC0)) 794ADBB03 795select hex(weight_string(cast(_latin1 0x6368DF as char), 4, 4, 0xC0)); 796hex(weight_string(cast(_latin1 0x6368DF as char), 4, 4, 0xC0)) 797ADBB0301 798select hex(weight_string(cast(_latin1 0x6368DF as char),25, 4, 0xC0)); 799hex(weight_string(cast(_latin1 0x6368DF as char),25, 4, 0xC0)) 800ADBB0301000000000000000000000000000000000000000000 801select hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 2,0xC0)); 802hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 2,0xC0)) 803BB 804select hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 2,0xC0)); 805hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 2,0xC0)) 806BBAD 807select hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 2,0xC0)); 808hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 2,0xC0)) 809BBAD01 810select hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 2,0xC0)); 811hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 2,0xC0)) 812BBAD0103 813select hex(weight_string(cast(_latin1 0xDF6368 as char),25, 2,0xC0)); 814hex(weight_string(cast(_latin1 0xDF6368 as char),25, 2,0xC0)) 815BBAD0103000000000000000000000000000000000000000000 816select hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 3,0xC0)); 817hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 3,0xC0)) 818BB 819select hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 3,0xC0)); 820hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 3,0xC0)) 821BBAD 822select hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 3,0xC0)); 823hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 3,0xC0)) 824BBAD01 825select hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 3,0xC0)); 826hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 3,0xC0)) 827BBAD0103 828select hex(weight_string(cast(_latin1 0xDF6368 as char),25, 3,0xC0)); 829hex(weight_string(cast(_latin1 0xDF6368 as char),25, 3,0xC0)) 830BBAD0103000000000000000000000000000000000000000000 831select hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 4,0xC0)); 832hex(weight_string(cast(_latin1 0xDF6368 as char), 1, 4,0xC0)) 833BB 834select hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 4,0xC0)); 835hex(weight_string(cast(_latin1 0xDF6368 as char), 2, 4,0xC0)) 836BBAD 837select hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 4,0xC0)); 838hex(weight_string(cast(_latin1 0xDF6368 as char), 3, 4,0xC0)) 839BBAD01 840select hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 4,0xC0)); 841hex(weight_string(cast(_latin1 0xDF6368 as char), 4, 4,0xC0)) 842BBAD0103 843select hex(weight_string(cast(_latin1 0xDF6368 as char),25, 4,0xC0)); 844hex(weight_string(cast(_latin1 0xDF6368 as char),25, 4,0xC0)) 845BBAD0103000000000000000000000000000000000000000000 846select @@collation_connection; 847@@collation_connection 848cp1250_czech_cs 849select hex(weight_string('a' LEVEL 1)); 850hex(weight_string('a' LEVEL 1)) 851A4 852select hex(weight_string('A' LEVEL 1)); 853hex(weight_string('A' LEVEL 1)) 854A4 855select hex(weight_string('abc' LEVEL 1)); 856hex(weight_string('abc' LEVEL 1)) 857A4A5A6 858select hex(weight_string('abc' as char(2) LEVEL 1)); 859hex(weight_string('abc' as char(2) LEVEL 1)) 860A4A5A6 861select hex(weight_string('abc' as char(3) LEVEL 1)); 862hex(weight_string('abc' as char(3) LEVEL 1)) 863A4A5A6 864select hex(weight_string('abc' as char(5) LEVEL 1)); 865hex(weight_string('abc' as char(5) LEVEL 1)) 866A4A5A6 867select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE)); 868hex(weight_string('abc' as char(5) LEVEL 1 REVERSE)) 869A4A5A6 870select hex(weight_string('abc' as char(5) LEVEL 1 DESC)); 871hex(weight_string('abc' as char(5) LEVEL 1 DESC)) 872A4A5A6 873select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE)); 874hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE)) 875A4A5A6 876select @@collation_connection; 877@@collation_connection 878cp1250_czech_cs 879select hex(weight_string('a' LEVEL 2)); 880hex(weight_string('a' LEVEL 2)) 88102 882select hex(weight_string('A' LEVEL 2)); 883hex(weight_string('A' LEVEL 2)) 88401 885select hex(weight_string('abc' LEVEL 2)); 886hex(weight_string('abc' LEVEL 2)) 887020202 888select hex(weight_string('abc' as char(2) LEVEL 2)); 889hex(weight_string('abc' as char(2) LEVEL 2)) 890020202 891select hex(weight_string('abc' as char(3) LEVEL 2)); 892hex(weight_string('abc' as char(3) LEVEL 2)) 893020202 894select hex(weight_string('abc' as char(5) LEVEL 2)); 895hex(weight_string('abc' as char(5) LEVEL 2)) 896020202 897select @@collation_connection; 898@@collation_connection 899cp1250_czech_cs 900select hex(weight_string('a' LEVEL 1,2)); 901hex(weight_string('a' LEVEL 1,2)) 902A402 903select hex(weight_string('a' LEVEL 1-2)); 904hex(weight_string('a' LEVEL 1-2)) 905A402 906select hex(weight_string('A' LEVEL 1,2)); 907hex(weight_string('A' LEVEL 1,2)) 908A401 909select hex(weight_string('A' LEVEL 1-2)); 910hex(weight_string('A' LEVEL 1-2)) 911A401 912# 913# End of 5.6 tests 914# 915