1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837
|
set names latin1;
set @@collation_connection=latin1_german2_ci;
select @@collation_connection;
@@collation_connection
latin1_german2_ci
drop table if exists t1;
create table t1 (a char (20) not null, b int not null auto_increment, index (a,b));
insert into t1 (a) values (''),('ac'),('ae'),('ad'),('c'),('aeb');
insert into t1 (a) values ('c'),('uc'),('ue'),('ud'),(''),('ueb'),('uf');
insert into t1 (a) values (''),('oc'),('a'),('oe'),('od'),('c'),('oeb');
insert into t1 (a) values ('s'),('ss'),(''),('b'),('ssa'),('ssc'),('a');
insert into t1 (a) values ('e'),('u'),('o'),(''),('a'),('aeae');
insert into t1 (a) values ('q'),('a'),('u'),('o'),(''),(''),('a');
select a,b from t1 order by a,b;
a b
a 1
a 2
ac 1
ad 1
1
ae 2
1
aeae 2
a 1
aeb 1
c 1
1
2
e 1
o 1
oc 1
od 1
1
oe 2
a 1
oeb 1
c 1
o 1
q 1
s 1
ss 1
2
ssa 1
a 2
b 1
ssc 1
u 1
uc 1
ud 1
ue 1
2
ueb 1
c 1
uf 1
u 1
select a,b from t1 order by upper(a),b;
a b
a 1
a 2
ac 1
ad 1
1
ae 2
1
aeae 2
a 1
aeb 1
c 1
1
2
e 1
o 1
oc 1
od 1
1
oe 2
a 1
oeb 1
c 1
o 1
q 1
s 1
ss 1
2
ssa 1
a 2
b 1
ssc 1
u 1
uc 1
ud 1
ue 1
2
ueb 1
c 1
uf 1
u 1
select a from t1 order by a desc;
a
u
uf
c
ueb
ue
ud
uc
u
ssc
b
a
ssa
ss
s
q
o
c
oeb
a
oe
od
oc
o
e
c
aeb
a
aeae
ae
ad
ac
a
a
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
select * from t1 where a like "%";
a b
1
a 1
c 1
o 1
select * from t1 where a like binary "%%";
a b
2
select * from t1 where a like "%%";
a b
a 1
a 2
ac 1
ad 1
ae 2
aeae 2
a 1
aeb 1
a 1
ssa 1
a 2
select * from t1 where a like "%U%";
a b
u 1
uc 1
ud 1
ue 1
ueb 1
uf 1
u 1
select * from t1 where a like "%ss%";
a b
ss 1
ssa 1
ssc 1
drop table t1;
select strcmp('','ae'),strcmp('ae',''),strcmp('aeq','q'),strcmp('q','aeq');
strcmp('','ae') strcmp('ae','') strcmp('aeq','q') strcmp('q','aeq')
0 0 0 0
select strcmp('ss',''),strcmp('','ss'),strcmp('s','sss'),strcmp('q','ssq');
strcmp('ss','') strcmp('','ss') strcmp('s','sss') strcmp('q','ssq')
0 0 0 0
select strcmp('','af'),strcmp('a',''),strcmp('','aeq'),strcmp('','aeaeq');
strcmp('','af') strcmp('a','') strcmp('','aeq') strcmp('','aeaeq')
-1 -1 -1 -1
select strcmp('ss','a'),strcmp('','ssa'),strcmp('sa','sssb'),strcmp('s','');
strcmp('ss','a') strcmp('','ssa') strcmp('sa','sssb') strcmp('s','')
-1 -1 -1 -1
select strcmp('','o'),strcmp('','u'),strcmp('','oeb');
strcmp('','o') strcmp('','u') strcmp('','oeb')
-1 -1 -1
select strcmp('af',''),strcmp('','a'),strcmp('aeq',''),strcmp('aeaeq','');
strcmp('af','') strcmp('','a') strcmp('aeq','') strcmp('aeaeq','')
1 1 1 1
select strcmp('a','ss'),strcmp('ssa',''),strcmp('sssb','sa'),strcmp('','s');
strcmp('a','ss') strcmp('ssa','') strcmp('sssb','sa') strcmp('','s')
1 1 1 1
select strcmp('u','a'),strcmp('u','');
strcmp('u','a') strcmp('u','')
1 1
select strcmp('s', 'a'), strcmp('a', 'x');
strcmp('s', 'a') strcmp('a', 'x')
-1 -1
create table t1 (a varchar(10), key(a), fulltext (a));
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
select * from t1 where a like "abc%";
a
abc
abcd
select * from t1 where a like "test%";
a
test
select * from t1 where a like "te_t";
a
test
select * from t1 where match a against ("te*" in boolean mode)+0;
a
test
drop table t1;
create table t1 (word varchar(255) not null, word2 varchar(255) not null default '', index(word));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`word` varchar(255) COLLATE latin1_german2_ci NOT NULL,
`word2` varchar(255) COLLATE latin1_german2_ci NOT NULL DEFAULT '',
KEY `word` (`word`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
insert into t1 (word) values ('ss'),(0xDF),(0xE4),('ae');
update t1 set word2=word;
select word, word=binary 0xdf as t from t1 having t > 0;
word t
1
select word, word=cast(0xdf AS CHAR) as t from t1 having t > 0;
word t
ss 1
1
select * from t1 where word=binary 0xDF;
word word2
select * from t1 where word=CAST(0xDF as CHAR);
word word2
ss ss
select * from t1 where word2=binary 0xDF;
word word2
select * from t1 where word2=CAST(0xDF as CHAR);
word word2
ss ss
select * from t1 where word='ae';
word word2
ae ae
select * from t1 where word= 0xe4 or word=CAST(0xe4 as CHAR);
word word2
ae ae
select * from t1 where word between binary 0xDF and binary 0xDF;
word word2
select * from t1 where word between CAST(0xDF AS CHAR) and CAST(0xDF AS CHAR);
word word2
ss ss
select * from t1 where word like 'ae';
word word2
ae ae
select * from t1 where word like 'AE';
word word2
ae ae
select * from t1 where word like binary 0xDF;
word word2
select * from t1 where word like CAST(0xDF as CHAR);
word word2
drop table t1;
CREATE TABLE t1 (
autor varchar(80) NOT NULL default '',
PRIMARY KEY (autor)
);
INSERT INTO t1 VALUES ('Powell, B.'),('Powell, Bud.'),('Powell, L. H.'),('Power, H.'),
('Poynter, M. A. L. Lane'),('Poynting, J. H. und J. J. Thomson.'),('Pozzi, S(amuel-Jean).'),
('Pozzi, Samuel-Jean.'),('Pozzo, A.'),('Pozzoli, Serge.');
SELECT * FROM t1 WHERE autor LIKE 'Poz%' ORDER BY autor;
autor
Pozzi, S(amuel-Jean).
Pozzi, Samuel-Jean.
Pozzo, A.
Pozzoli, Serge.
DROP TABLE t1;
CREATE TABLE t1 (
s1 CHAR(5) CHARACTER SET latin1 COLLATE latin1_german2_ci
);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`s1` char(5) COLLATE latin1_german2_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
INSERT INTO t1 VALUES ('');
INSERT INTO t1 VALUES ('ue');
SELECT DISTINCT s1 FROM t1;
s1
SELECT s1,COUNT(*) FROM t1 GROUP BY s1;
s1 COUNT(*)
2
SELECT COUNT(DISTINCT s1) FROM t1;
COUNT(DISTINCT s1)
1
SELECT FIELD('ue',s1), FIELD('',s1), s1='ue', s1='' FROM t1;
FIELD('ue',s1) FIELD('',s1) s1='ue' s1=''
1 1 1 1
1 1 1 1
DROP TABLE t1;
create table t1 select repeat('a',4000) a;
delete from t1;
insert into t1 values ('a'), ('a '), ('a\t');
select collation(a),hex(a) from t1 order by a;
collation(a) hex(a)
latin1_german2_ci 6109
latin1_german2_ci 61
latin1_german2_ci 6120
drop table t1;
#
# MDEV-5453 Assertion `src' fails in my_strnxfrm_unicode on GROUP BY MID(..) WITH ROLLUP
#
SELECT @@collation_connection;
@@collation_connection
latin1_german2_ci
CREATE TABLE t1 (i INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
SELECT * FROM t1 GROUP BY MID(CURRENT_USER,0) WITH ROLLUP;
i
1
1
SELECT * FROM t1 GROUP BY MID('test',0) WITH ROLLUP;
i
1
1
DROP TABLE t1;
#
# MDEV-6170 Incorrect ordering with utf8_bin and utf8mb4_bin collations
#
SELECT @@collation_connection;
@@collation_connection
latin1_german2_ci
CREATE TABLE t1 ENGINE=MEMORY AS SELECT REPEAT('a',5) AS a LIMIT 0;
INSERT INTO t1 (a) VALUES ("a");
INSERT INTO t1 (a) VALUES ("b");
INSERT INTO t1 (a) VALUES ("c");
INSERT INTO t1 (a) VALUES ("d");
INSERT INTO t1 (a) VALUES ("e");
INSERT INTO t1 (a) VALUES ("f");
INSERT INTO t1 (a) VALUES ("g");
INSERT INTO t1 (a) VALUES ("h");
INSERT INTO t1 (a) VALUES ("i");
INSERT INTO t1 (a) VALUES ("j");
INSERT INTO t1 (a) VALUES ("k");
INSERT INTO t1 (a) VALUES ("l");
INSERT INTO t1 (a) VALUES ("m");
SELECT * FROM t1 ORDER BY LOWER(a);
a
a
b
c
d
e
f
g
h
i
j
k
l
m
SELECT * FROM t1 ORDER BY LOWER(a) DESC;
a
m
l
k
j
i
h
g
f
e
d
c
b
a
DROP TABLE t1;
"BEGIN ctype_german.inc"
drop table if exists t1;
create table t1 as select repeat(' ', 64) as s1;
select collation(s1) from t1;
collation(s1)
latin1_german2_ci
delete from t1;
INSERT INTO t1 VALUES ('ud'),('uf');
INSERT INTO t1 VALUES ('od'),('of');
INSERT INTO t1 VALUES ('e');
INSERT INTO t1 VALUES ('ad'),('af');
insert into t1 values ('a'),('ae'),(_latin1 0xE4);
insert into t1 values ('o'),('oe'),(_latin1 0xF6);
insert into t1 values ('s'),('ss'),(_latin1 0xDF);
insert into t1 values ('u'),('ue'),(_latin1 0xFC);
INSERT INTO t1 VALUES (_latin1 0xE6), (_latin1 0xC6);
INSERT INTO t1 VALUES (_latin1 0x9C), (_latin1 0x8C);
select s1, hex(s1) from t1 order by s1, binary s1;
s1 hex(s1)
a 61
ad 6164
ae 6165
E4
af 6166
e 65
o 6F
od 6F64
oe 6F65
F6
of 6F66
s 73
ss 7373
DF
u 75
ud 7564
ue 7565
FC
uf 7566
C6
E6
8C
9C
select group_concat(s1 order by binary s1) from t1 group by s1;
group_concat(s1 order by binary s1)
a
ad
ae,
af
e
o
od
oe,
of
s
ss,
u
ud
ue,
uf
,
SELECT s1, hex(s1), hex(weight_string(s1)) FROM t1 ORDER BY s1, BINARY(s1);
s1 hex(s1) hex(weight_string(s1))
a 61 41
ad 6164 4144
ae 6165 4145
E4 4145
af 6166 4146
e 65 45
o 6F 4F
od 6F64 4F44
oe 6F65 4F45
F6 4F45
of 6F66 4F46
s 73 53
ss 7373 5353
DF 5353
u 75 55
ud 7564 5544
ue 7565 5545
FC 5545
uf 7566 5546
C6 5C
E6 5C
8C 8C
9C 9C
SELECT s1, hex(s1) FROM t1 WHERE s1='ae' ORDER BY s1, BINARY(s1);
s1 hex(s1)
ae 6165
E4
drop table t1;
CREATE TABLE t1 AS SELECT REPEAT('a',1) AS a, 1 AS b LIMIT 0;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(1) COLLATE latin1_german2_ci NOT NULL DEFAULT '',
`b` int(1) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
INSERT INTO t1 VALUES ('s',0),(_latin1 0xDF,1);
SELECT * FROM t1 ORDER BY a, b;
a b
s 0
1
SELECT * FROM t1 ORDER BY a DESC, b;
a b
1
s 0
SELECT * FROM t1 ORDER BY CONCAT(a), b;
a b
s 0
1
SELECT * FROM t1 ORDER BY CONCAT(a) DESC, b;
a b
1
s 0
DROP TABLE t1;
"END ctype_german.inc"
SET NAMES latin1;
CREATE TABLE t1 (
col1 varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1 collate latin1_german2_ci;
INSERT INTO t1 VALUES (''),('ss'),('ss');
ALTER TABLE t1 ADD KEY ifword(col1);
SELECT * FROM t1 WHERE col1='' ORDER BY col1, BINARY col1;
col1
ss
ss
DROP TABLE t1;
create table t1 (s1 char(5) character set latin1 collate latin1_german2_ci);
insert into t1 values (0xf6) /* this is o-umlaut */;
select * from t1 where length(s1)=1 and s1='oe';
s1
drop table t1;
End of 5.1 tests
#
# Start of 5.6 tests
#
#
# WL#3664 WEIGHT_STRING
#
set @@collation_connection=latin1_german2_ci;
select @@collation_connection;
@@collation_connection
latin1_german2_ci
CREATE TABLE t1 AS SELECT 'a' AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(1) COLLATE latin1_german2_ci NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_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_german2_ci
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
HEX(WEIGHT_STRING(a))
41
SELECT HEX(ws) FROM t2;
HEX(ws)
41
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) COLLATE latin1_german2_ci NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_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_german2_ci
SELECT HEX(WEIGHT_STRING(a)) FROM t1;
HEX(WEIGHT_STRING(a))
4141414141
SELECT HEX(ws) FROM t2;
HEX(ws)
4141414141
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_german2_ci
SELECT HEX(WEIGHT_STRING(a AS CHAR(3))) FROM t1;
HEX(WEIGHT_STRING(a AS CHAR(3)))
414141
SELECT HEX(ws) FROM t2;
HEX(ws)
414141
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_german2_ci
SELECT HEX(WEIGHT_STRING(a AS CHAR(10))) FROM t1;
HEX(WEIGHT_STRING(a AS CHAR(10)))
41414141412020202020
SELECT HEX(ws) FROM t2;
HEX(ws)
41414141412020202020
DROP TABLE t2;
DROP TABLE t1;
select hex(weight_string('a'));
hex(weight_string('a'))
41
select hex(weight_string('A'));
hex(weight_string('A'))
41
select hex(weight_string('abc'));
hex(weight_string('abc'))
414243
select hex(weight_string('abc' as char(2)));
hex(weight_string('abc' as char(2)))
4142
select hex(weight_string('abc' as char(3)));
hex(weight_string('abc' as char(3)))
414243
select hex(weight_string('abc' as char(5)));
hex(weight_string('abc' as char(5)))
4142432020
select hex(weight_string('abc', 1, 2, 0xC0));
hex(weight_string('abc', 1, 2, 0xC0))
41
select hex(weight_string('abc', 2, 2, 0xC0));
hex(weight_string('abc', 2, 2, 0xC0))
4142
select hex(weight_string('abc', 3, 2, 0xC0));
hex(weight_string('abc', 3, 2, 0xC0))
414220
select hex(weight_string('abc', 4, 2, 0xC0));
hex(weight_string('abc', 4, 2, 0xC0))
41422020
select hex(weight_string('abc', 5, 2, 0xC0));
hex(weight_string('abc', 5, 2, 0xC0))
4142202020
select hex(weight_string('abc',25, 2, 0xC0));
hex(weight_string('abc',25, 2, 0xC0))
41422020202020202020202020202020202020202020202020
select hex(weight_string('abc', 1, 3, 0xC0));
hex(weight_string('abc', 1, 3, 0xC0))
41
select hex(weight_string('abc', 2, 3, 0xC0));
hex(weight_string('abc', 2, 3, 0xC0))
4142
select hex(weight_string('abc', 3, 3, 0xC0));
hex(weight_string('abc', 3, 3, 0xC0))
414243
select hex(weight_string('abc', 4, 3, 0xC0));
hex(weight_string('abc', 4, 3, 0xC0))
41424320
select hex(weight_string('abc', 5, 3, 0xC0));
hex(weight_string('abc', 5, 3, 0xC0))
4142432020
select hex(weight_string('abc',25, 3, 0xC0));
hex(weight_string('abc',25, 3, 0xC0))
41424320202020202020202020202020202020202020202020
select hex(weight_string('abc', 1, 4, 0xC0));
hex(weight_string('abc', 1, 4, 0xC0))
41
select hex(weight_string('abc', 2, 4, 0xC0));
hex(weight_string('abc', 2, 4, 0xC0))
4142
select hex(weight_string('abc', 3, 4, 0xC0));
hex(weight_string('abc', 3, 4, 0xC0))
414243
select hex(weight_string('abc', 4, 4, 0xC0));
hex(weight_string('abc', 4, 4, 0xC0))
41424320
select hex(weight_string('abc', 5, 4, 0xC0));
hex(weight_string('abc', 5, 4, 0xC0))
4142432020
select hex(weight_string('abc',25, 4, 0xC0));
hex(weight_string('abc',25, 4, 0xC0))
41424320202020202020202020202020202020202020202020
select @@collation_connection;
@@collation_connection
latin1_german2_ci
select hex(weight_string(cast(_latin1 0x80 as char)));
hex(weight_string(cast(_latin1 0x80 as char)))
80
select hex(weight_string(cast(_latin1 0x808080 as char)));
hex(weight_string(cast(_latin1 0x808080 as char)))
808080
select hex(weight_string(cast(_latin1 0x808080 as char) as char(2)));
hex(weight_string(cast(_latin1 0x808080 as char) as char(2)))
8080
select hex(weight_string(cast(_latin1 0x808080 as char) as char(3)));
hex(weight_string(cast(_latin1 0x808080 as char) as char(3)))
808080
select hex(weight_string(cast(_latin1 0x808080 as char) as char(5)));
hex(weight_string(cast(_latin1 0x808080 as char) as char(5)))
8080802020
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char), 1, 2, 0xC0))
80
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char), 2, 2, 0xC0))
8080
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char), 3, 2, 0xC0))
808020
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char), 4, 2, 0xC0))
80802020
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char), 5, 2, 0xC0))
8080202020
select hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char),25, 2, 0xC0))
80802020202020202020202020202020202020202020202020
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char), 1, 3, 0xC0))
80
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char), 2, 3, 0xC0))
8080
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char), 3, 3, 0xC0))
808080
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char), 4, 3, 0xC0))
80808020
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char), 5, 3, 0xC0))
8080802020
select hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char),25, 3, 0xC0))
80808020202020202020202020202020202020202020202020
select hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char), 1, 4, 0xC0))
80
select hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char), 2, 4, 0xC0))
8080
select hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char), 3, 4, 0xC0))
808080
select hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char), 4, 4, 0xC0))
80808020
select hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char), 5, 4, 0xC0))
8080802020
select hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0));
hex(weight_string(cast(_latin1 0x808080 as char),25, 4, 0xC0))
80808020202020202020202020202020202020202020202020
select @@collation_connection;
@@collation_connection
latin1_german2_ci
select hex(weight_string('a' LEVEL 1));
hex(weight_string('a' LEVEL 1))
41
select hex(weight_string('A' LEVEL 1));
hex(weight_string('A' LEVEL 1))
41
select hex(weight_string('abc' LEVEL 1));
hex(weight_string('abc' LEVEL 1))
414243
select hex(weight_string('abc' as char(2) LEVEL 1));
hex(weight_string('abc' as char(2) LEVEL 1))
4142
select hex(weight_string('abc' as char(3) LEVEL 1));
hex(weight_string('abc' as char(3) LEVEL 1))
414243
select hex(weight_string('abc' as char(5) LEVEL 1));
hex(weight_string('abc' as char(5) LEVEL 1))
4142432020
select hex(weight_string('abc' as char(5) LEVEL 1 REVERSE));
hex(weight_string('abc' as char(5) LEVEL 1 REVERSE))
2020434241
select hex(weight_string('abc' as char(5) LEVEL 1 DESC));
hex(weight_string('abc' as char(5) LEVEL 1 DESC))
BEBDBCDFDF
select hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE));
hex(weight_string('abc' as char(5) LEVEL 1 DESC REVERSE))
DFDFBCBDBE
select hex(weight_string(''));
hex(weight_string(''))
4145
select hex(weight_string(''));
hex(weight_string(''))
4145
select hex(weight_string(''));
hex(weight_string(''))
4F45
select hex(weight_string(''));
hex(weight_string(''))
4F45
select hex(weight_string(''));
hex(weight_string(''))
5545
select hex(weight_string(''));
hex(weight_string(''))
5545
select hex(weight_string('S'));
hex(weight_string('S'))
53
select hex(weight_string('s'));
hex(weight_string('s'))
53
select hex(weight_string(''));
hex(weight_string(''))
5353
select hex(weight_string('' as char(1)));
hex(weight_string('' as char(1)))
41
select hex(weight_string('' as char(1)));
hex(weight_string('' as char(1)))
4F
select hex(weight_string('' as char(1)));
hex(weight_string('' as char(1)))
55
select hex(weight_string('' as char(1)));
hex(weight_string('' as char(1)))
53
select hex(weight_string('x' as char(2)));
hex(weight_string('x' as char(2)))
5841
select hex(weight_string('x' as char(2)));
hex(weight_string('x' as char(2)))
584F
select hex(weight_string('x' as char(2)));
hex(weight_string('x' as char(2)))
5855
select hex(weight_string('x' as char(2)));
hex(weight_string('x' as char(2)))
5853
#
# End of 5.6 tests
#
|