1
# Test of charset cp1251
4
drop table if exists t1;
10
# Test problem with LEFT() (Bug #514)
13
create table t1 (a varchar(10) not null) character set cp1251;
14
insert into t1 values ("a"),("ab"),("abc");
16
select a, left(a,1) as b from t1;
17
select a, left(a,1) as b from t1 group by a;
18
SELECT DISTINCT RIGHT(a,1) from t1;
22
# Test of binary and upper/lower
24
create table t1 (a char(3) binary, b binary(3)) character set cp1251;
25
insert into t1 values ('aaa','bbb'),('AAA','BBB');
26
select upper(a),upper(b) from t1;
27
select lower(a),lower(b) from t1;
28
select * from t1 where upper(a)='AAA';
29
select * from t1 where lower(a)='aaa';
30
select * from t1 where upper(b)='BBB';
31
select * from t1 where lower(b)='bbb';
32
select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
33
select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
38
a varchar(16) character set cp1251 collate cp1251_bin not null,
39
b int(10) default null,
42
insert into t1 (a) values ('air'),
43
('we'),('g'),('we_toshko'), ('s0urce'),('we_ivo'),('we_iliyan'),
44
('we_martin'),('vw_grado'),('vw_vasko'),('tn_vili'),('tn_kalina'),
45
('tn_fakira'),('vw_silvia'),('vw_starshi'),('vw_geo'),('vw_b0x1');
48
select * from t1 where a like 'we_%';
52
# Bug#158 ENUM and SET types does not accept valid cp1251 character
57
) ENGINE=MYISAM character set cp1251;
64
--echo # Start of 5.1 tests
67
--source include/ctype_8bit.inc
70
# Bug #48053 String::c_ptr has a race and/or does an invalid
72
# (triggered by Valgrind tests)
73
# (see also ctype_eucjpms.test, ctype_cp1250.test, ctype_cp1251.test)
76
set global LC_TIME_NAMES=convert((-8388608) using cp1251);
80
--echo # End of 5.1 tests
84
--echo # Start of 5.5 tests
87
--source include/ctype_numconv.inc
90
--echo # Bug#60101 COALESCE with cp1251 tables causes [Err] 1267 - Illegal mix of collations
92
CREATE TABLE t1 (test1 INT, test2 VARCHAR(255));
94
SELECT COALESCE(IF(test1=1, 1, NULL), test2) FROM t1;
95
SELECT COALESCE(IF(test1=1, NULL, 1), test2) FROM t1;
100
--echo # End of 5.5 tests