2
# This failed for Elizabeth Mattijsen
5
drop table if exists t1,t2,t3;
8
name CHAR(32) NOT NULL,
10
INDEX indexIDname (ID(8),name(8))
14
('keyword','indexdir','/export/home/local/www/database/indexes/keyword');
15
INSERT INTO t1 VALUES ('keyword','urlprefix','text/ /text');
16
INSERT INTO t1 VALUES ('keyword','urlmap','/text/ /');
17
INSERT INTO t1 VALUES ('keyword','attr','personal employee company');
19
('emailgids','indexdir','/export/home/local/www/database/indexes/emailgids');
20
INSERT INTO t1 VALUES ('emailgids','urlprefix','text/ /text');
21
INSERT INTO t1 VALUES ('emailgids','urlmap','/text/ /');
22
INSERT INTO t1 VALUES ('emailgids','attr','personal employee company');
24
SELECT value FROM t1 WHERE ID='emailgids' AND name='attr';
29
# Problem with many key parts and many or
33
price int(5) DEFAULT '0' NOT NULL,
34
area varchar(40) DEFAULT '' NOT NULL,
35
type varchar(40) DEFAULT '' NOT NULL,
36
transityes enum('Y','N') DEFAULT 'Y' NOT NULL,
37
shopsyes enum('Y','N') DEFAULT 'Y' NOT NULL,
38
schoolsyes enum('Y','N') DEFAULT 'Y' NOT NULL,
39
petsyes enum('Y','N') DEFAULT 'Y' NOT NULL,
40
KEY price (price,area,type,transityes,shopsyes,schoolsyes,petsyes)
43
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','N','N','N','N');
44
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','N','N','N','N');
45
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','','','','');
46
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
47
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
48
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
49
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
50
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
52
SELECT * FROM t1 WHERE area='Vancouver' and transityes='y' and schoolsyes='y' and ( ((type='1 Bedroom' or type='Studio/Bach') and (price<=500)) or ((type='2 Bedroom') and (price<=550)) or ((type='Shared/Roomate') and (price<=300)) or ((type='Room and Board') and (price<=500)) ) and price <= 400;
57
# problem med primary key
60
CREATE TABLE t1 (program enum('signup','unique','sliding') not null, type enum('basic','sliding','signup'), sites set('mt'), PRIMARY KEY (program));
61
# The following should give an error for wrong primary key
62
!$1171 ALTER TABLE t1 modify program enum('signup','unique','sliding');
66
# Test of compressed decimal index.
70
name varchar(50) DEFAULT '' NOT NULL,
71
author varchar(50) DEFAULT '' NOT NULL,
72
category decimal(10,0) DEFAULT '0' NOT NULL,
80
timeout decimal(10,0),
82
creation decimal(10,0),
83
livinguntil decimal(10,0),
87
subtype decimal(10,0),
90
capacity decimal(10,0),
92
CCident varchar(50) DEFAULT '' NOT NULL,
93
PRIMARY KEY (name,author,category)
96
('patnom','patauteur',0,'p.favre@cryo-networks.fr',NULL,NULL,'#p2sndnq6ae5g1u6t','essai\nsalut','scol://195.242.78.119:patauteur.patnom',NULL,NULL,NULL,950036174,-882087474,NULL,3,0,3,'1','Pub/patnom/futur_divers.scs',NULL,'pat','CC1');
98
('LeNomDeMonSite','Marc',0,'m.barilley@cryo-networks.fr',NULL,NULL,NULL,NULL,'scol://195.242.78.119:Marc.LeNomDeMonSite',NULL,NULL,NULL,950560434,-881563214,NULL,3,0,3,'1','Pub/LeNomDeMonSite/domus_hibere.scs',NULL,'Marq','CC1');
99
select * from t1 where name='patnom' and author='patauteur' and category=0;
103
# Problem with search on partial index
108
name_id int not null auto_increment,
110
INDEX name_idx (name(5)),
111
primary key (name_id)
114
INSERT t1 VALUES(NULL,'/');
115
INSERT t1 VALUES(NULL,'[T,U]_axpby');
116
SELECT * FROM t1 WHERE name='[T,U]_axpy';
117
SELECT * FROM t1 WHERE name='[T,U]_axpby';
120
name_id int not null auto_increment,
121
name char(255) binary,
122
INDEX name_idx (name(5)),
123
primary key (name_id)
125
INSERT t2 select * from t1;
126
SELECT * FROM t2 WHERE name='[T,U]_axpy';
127
SELECT * FROM t2 WHERE name='[T,U]_axpby';
131
# Test bug with long primary key
136
SEQNO numeric(12 ) not null,
137
MOTYPEID numeric(12 ) not null,
138
MOINSTANCEID numeric(12 ) not null,
139
ATTRID numeric(12 ) not null,
140
VALUE varchar(120) not null,
141
primary key (SEQNO, MOTYPEID, MOINSTANCEID, ATTRID, VALUE )
143
INSERT INTO t1 VALUES (1, 1, 1, 1, 'a');
144
INSERT INTO t1 VALUES (1, 1, 1, 1, 'b');
145
!$1062 INSERT INTO t1 VALUES (1, 1, 1, 1, 'a');
149
# Test with blob + tinyint key
150
# (Failed for Greg Valure)
155
b tinyint(3) unsigned NOT NULL default '0',
156
PRIMARY KEY (a(32),b)
158
INSERT INTO t1 VALUES ('a',1),('a',2);
159
SELECT * FROM t1 WHERE a='a' AND b=2;
160
SELECT * FROM t1 WHERE a='a' AND b in (2);
161
SELECT * FROM t1 WHERE a='a' AND b in (1,2);