1
SET DEFAULT_STORAGE_ENGINE='tokudb';
2
drop table if exists t1;
4
create table t1 (a varchar(10) not null) character set cp1251;
5
insert into t1 values ("a"),("ab"),("abc");
11
select a, left(a,1) as b from t1;
16
select a, left(a,1) as b from t1 group by a;
21
SELECT DISTINCT RIGHT(a,1) from t1;
27
create table t1 (a char(3) binary, b binary(3)) character set cp1251;
28
insert into t1 values ('aaa','bbb'),('AAA','BBB');
29
select upper(a),upper(b) from t1;
33
select lower(a),lower(b) from t1;
37
select * from t1 where upper(a)='AAA';
41
select * from t1 where lower(a)='aaa';
45
select * from t1 where upper(b)='BBB';
48
select * from t1 where lower(b)='bbb';
51
select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
52
charset(a) charset(b) charset(binary 'ccc')
54
select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
55
collation(a) collation(b) collation(binary 'ccc')
56
cp1251_bin binary binary
59
a varchar(16) character set cp1251 collate cp1251_bin not null,
60
b int(10) default null,
63
insert into t1 (a) values ('air'),
64
('we'),('g'),('we_toshko'), ('s0urce'),('we_ivo'),('we_iliyan'),
65
('we_martin'),('vw_grado'),('vw_vasko'),('tn_vili'),('tn_kalina'),
66
('tn_fakira'),('vw_silvia'),('vw_starshi'),('vw_geo'),('vw_b0x1');
67
select * from t1 where a like 'we_%';