~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-proposed

« back to all changes in this revision

Viewing changes to mysql-test/t/ctype_cp1251.test

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2013-12-22 10:27:05 UTC
  • Revision ID: package-import@ubuntu.com-20131222102705-mndw7s12mz0szrcn
Tags: upstream-5.5.32
Import upstream version 5.5.32

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Test of charset cp1251
 
2
 
 
3
--disable_warnings
 
4
drop table if exists t1;
 
5
--enable_warnings
 
6
 
 
7
SET NAMES cp1251;
 
8
 
 
9
#
 
10
# Test problem with LEFT() (Bug #514)
 
11
#
 
12
 
 
13
create table t1 (a varchar(10) not null) character set cp1251;
 
14
insert into t1 values ("a"),("ab"),("abc");
 
15
select * from t1;
 
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;
 
19
drop table t1;
 
20
 
 
21
#
 
22
# Test of binary and upper/lower
 
23
#
 
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;
 
34
drop table t1;
 
35
 
 
36
# Test for BUG#8560
 
37
create table t1 (
 
38
 a varchar(16) character set cp1251 collate cp1251_bin not null,
 
39
 b int(10) default null,
 
40
 primary key(a)
 
41
) charset=cp1251;
 
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');
 
46
 
 
47
--sorted_result
 
48
select * from t1 where a like 'we_%';
 
49
drop table t1;
 
50
 
 
51
#
 
52
# Bug#158 ENUM and SET types does not accept valid cp1251 character
 
53
#
 
54
CREATE TABLE t1 (
 
55
  e1 enum('������'),
 
56
  e2 enum('�����')
 
57
) ENGINE=MYISAM character set cp1251;
 
58
SHOW CREATE TABLE t1;
 
59
DROP TABLE t1;
 
60
 
 
61
# End of 4.1 tests
 
62
 
 
63
--echo #
 
64
--echo # Start of 5.1 tests
 
65
--echo #
 
66
 
 
67
--source include/ctype_8bit.inc
 
68
 
 
69
#
 
70
# Bug #48053 String::c_ptr has a race and/or does an invalid 
 
71
#            memory reference
 
72
#            (triggered by Valgrind tests)
 
73
#  (see also ctype_eucjpms.test, ctype_cp1250.test, ctype_cp1251.test)
 
74
#
 
75
--error 1649
 
76
set global LC_TIME_NAMES=convert((-8388608) using cp1251);
 
77
 
 
78
 
 
79
--echo #
 
80
--echo # End of 5.1 tests
 
81
--echo #
 
82
 
 
83
--echo #
 
84
--echo # Start of 5.5 tests
 
85
--echo #
 
86
 
 
87
--source include/ctype_numconv.inc
 
88
 
 
89
--echo #
 
90
--echo # Bug#60101 COALESCE with cp1251 tables causes [Err] 1267 - Illegal mix of collations
 
91
--echo #
 
92
CREATE TABLE t1 (test1 INT, test2 VARCHAR(255));
 
93
SHOW CREATE TABLE t1;
 
94
SELECT COALESCE(IF(test1=1, 1, NULL), test2) FROM t1;
 
95
SELECT COALESCE(IF(test1=1, NULL, 1), test2) FROM t1;
 
96
DROP TABLE t1;
 
97
 
 
98
 
 
99
--echo #
 
100
--echo # End of 5.5 tests
 
101
--echo #