~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

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

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Test of SET with space
 
3
#
 
4
 
 
5
--disable_warnings
 
6
drop table if exists t1;
 
7
--enable_warnings
 
8
 
 
9
create table t1 (a set (' ','a','b') not null);
 
10
show create table t1;
 
11
drop table t1;
 
12
create table t1 (a set (' ','a','b ') not null default 'b ');
 
13
show create table t1;
 
14
drop table t1;
 
15
CREATE TABLE t1 (   user varchar(64) NOT NULL default '',   path varchar(255) NOT NULL default '',   privilege   set('select','RESERVED30','RESERVED29','RESERVED28','RESERVED27','RESERVED26',   'RESERVED25','RESERVED24','data.delete','RESERVED22','RESERVED21',   'RESERVED20','data.insert.none','data.insert.approve',   'data.insert.delete','data.insert.move','data.insert.propose',   'data.insert.reject','RESERVED13','RESERVED12','RESERVED11','RESERVED10',   'RESERVED09','data.update','RESERVED07','RESERVED06','RESERVED05',   'RESERVED04','metadata.delete','metadata.put','RESERVED01','RESERVED00')   NOT NULL default '',   KEY user (user)   ) ENGINE=MyISAM CHARSET=utf8;
 
16
DROP TABLE t1;
 
17
 
 
18
#
 
19
# Check that SET is case sensitive with a binary collation
 
20
#
 
21
set names latin1;
 
22
create table t1 (s set ('a','A') character set latin1 collate latin1_bin);
 
23
show create table t1;
 
24
insert into t1 values ('a'),('a,A'),('A,a'),('A');
 
25
select s from t1 order by s;
 
26
select s from t1 order by concat(s);
 
27
drop table t1;
 
28
 
 
29
#
 
30
# Check that SET honors a more complex collation correctly
 
31
#
 
32
CREATE TABLE t1 (c set('ae','oe','ue','ss') collate latin1_german2_ci);
 
33
INSERT INTO t1 VALUES ('�'),('�'),('�'),('�');
 
34
INSERT INTO t1 VALUES ('ae'),('oe'),('ue'),('ss');
 
35
INSERT INTO t1 VALUES ('�,�,�,�');
 
36
INSERT INTO t1 VALUES ('ae,oe,ue,ss');
 
37
SELECT c FROM t1 ORDER BY c;
 
38
SELECT c FROM t1 ORDER BY concat(c);
 
39
DROP TABLE t1;
 
40
 
 
41
# End of 4.1 tests
 
42
 
 
43
#
 
44
# Bug#27069 set with identical elements are created
 
45
#
 
46
--error 1097
 
47
create table t1(f1
 
48
set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17',
 
49
'18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33',
 
50
'34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49',
 
51
'50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','128'));
 
52
create table t1(f1
 
53
set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17',
 
54
'18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33',
 
55
'34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49',
 
56
'50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','1'));
 
57
show create table t1;
 
58
drop table t1;
 
59
 
 
60
#
 
61
# Bug#15409: Columns with SET datatype with 64-element sets
 
62
#            may not be updated with integers
 
63
#
 
64
 
 
65
let $i=64;
 
66
let $s='$i';
 
67
dec $i;
 
68
while ($i) {
 
69
  let $s='$i',$s;
 
70
  dec $i;
 
71
}
 
72
--eval CREATE TABLE t1(c set($s))
 
73
INSERT INTO t1 VALUES(7); 
 
74
INSERT INTO t1 VALUES(9223372036854775808);
 
75
SELECT * FROM t1;
 
76
DROP TABLE t1;
 
77
 
 
78
--echo End of 5.0 tests