~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/r/type_set.result

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
Import upstream version 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
drop table if exists t1;
 
2
create table t1 (a set (' ','a','b') not null);
 
3
show create table t1;
 
4
Table   Create Table
 
5
t1      CREATE TABLE `t1` (
 
6
  `a` set('','a','b') NOT NULL
 
7
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
8
drop table t1;
 
9
create table t1 (a set (' ','a','b ') not null default 'b ');
 
10
show create table t1;
 
11
Table   Create Table
 
12
t1      CREATE TABLE `t1` (
 
13
  `a` set('','a','b') NOT NULL DEFAULT 'b'
 
14
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
15
drop table t1;
 
16
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;
 
17
DROP TABLE t1;
 
18
set names latin1;
 
19
create table t1 (s set ('a','A') character set latin1 collate latin1_bin);
 
20
show create table t1;
 
21
Table   Create Table
 
22
t1      CREATE TABLE `t1` (
 
23
  `s` set('a','A') CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL
 
24
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
25
insert into t1 values ('a'),('a,A'),('A,a'),('A');
 
26
select s from t1 order by s;
 
27
s
 
28
a
 
29
A
 
30
a,A
 
31
a,A
 
32
select s from t1 order by concat(s);
 
33
s
 
34
A
 
35
a
 
36
a,A
 
37
a,A
 
38
drop table t1;
 
39
CREATE TABLE t1 (c set('ae','oe','ue','ss') collate latin1_german2_ci);
 
40
INSERT INTO t1 VALUES ('�'),('�'),('�'),('�');
 
41
INSERT INTO t1 VALUES ('ae'),('oe'),('ue'),('ss');
 
42
INSERT INTO t1 VALUES ('�,�,�,�');
 
43
INSERT INTO t1 VALUES ('ae,oe,ue,ss');
 
44
SELECT c FROM t1 ORDER BY c;
 
45
c
 
46
ae
 
47
ae
 
48
oe
 
49
oe
 
50
ue
 
51
ue
 
52
ss
 
53
ss
 
54
ae,oe,ue,ss
 
55
ae,oe,ue,ss
 
56
SELECT c FROM t1 ORDER BY concat(c);
 
57
c
 
58
ae
 
59
ae
 
60
ae,oe,ue,ss
 
61
ae,oe,ue,ss
 
62
oe
 
63
oe
 
64
ss
 
65
ss
 
66
ue
 
67
ue
 
68
DROP TABLE t1;
 
69
create table t1(f1
 
70
set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17',
 
71
'18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33',
 
72
'34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49',
 
73
'50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','128'));
 
74
ERROR HY000: Too many strings for column f1 and SET
 
75
create table t1(f1
 
76
set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17',
 
77
'18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33',
 
78
'34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49',
 
79
'50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','1'));
 
80
Warnings:
 
81
Note    1291    Column 'f1' has duplicated value '1' in SET
 
82
show create table t1;
 
83
Table   Create Table
 
84
t1      CREATE TABLE `t1` (
 
85
  `f1` set('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','1') DEFAULT NULL
 
86
) ENGINE=MyISAM DEFAULT CHARSET=latin1
 
87
drop table t1;
 
88
CREATE TABLE t1(c set('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'));
 
89
INSERT INTO t1 VALUES(7);
 
90
INSERT INTO t1 VALUES(9223372036854775808);
 
91
SELECT * FROM t1;
 
92
c
 
93
1,2,3
 
94
64
 
95
DROP TABLE t1;
 
96
CREATE TABLE t1 (
 
97
set_unique_utf8 set ('a','b','c','d','e','f','g','h','i','j','k','l',
 
98
'm','n','o','p','q','r','s','t','u','v','w','x',
 
99
'y','z') CHARACTER SET utf8,
 
100
unique (set_unique_utf8)
 
101
);
 
102
INSERT INTO t1 ( set_unique_utf8 ) VALUES ( '' );
 
103
INSERT INTO t1 ( set_unique_utf8 ) VALUES ( '' );
 
104
ERROR 23000: Duplicate entry '' for key 'set_unique_utf8'
 
105
DROP TABLE t1;
 
106
End of 5.0 tests