~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/key.test

  • Committer: Mark Atwood
  • Date: 2011-12-28 02:50:31 UTC
  • Revision ID: me@mark.atwood.name-20111228025031-eh4h1zwv4ig88g0i
fix tests/r/basic.result

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
create table t2
123
123
(
124
124
  name_id int not null auto_increment,
125
 
  name char(255) binary,
 
125
  name char(255),
126
126
  INDEX name_idx (name(5)),
127
127
  primary key (name_id)
128
128
);
159
159
# (Failed for Greg Valure)
160
160
#
161
161
 
162
 
CREATE TABLE t1 (
 
162
CREATE TEMPORARY TABLE t1 (
163
163
  a tinytext NOT NULL,
164
164
  b int NOT NULL default '0',
165
165
  PRIMARY KEY (a(32),b)
183
183
#
184
184
 
185
185
CREATE TABLE t1 (c VARCHAR(10) NOT NULL,i INT PRIMARY KEY NOT NULL AUTO_INCREMENT, UNIQUE (c,i));
186
 
--error 1048
 
186
--error ER_BAD_NULL_ERROR
187
187
INSERT INTO t1 (c) VALUES (NULL),(NULL);
188
188
SELECT * FROM t1;
189
189
INSERT INTO t1 (c) VALUES ('a'),('a');
200
200
# Test of key read with primary key (Bug #3497)
201
201
#
202
202
 
203
 
CREATE TABLE t1 (id int auto_increment, name char(50), primary key (id)) engine=myisam;
 
203
CREATE TEMPORARY TABLE t1 (id int auto_increment, name char(50), primary key (id)) engine=myisam;
204
204
insert into t1 (name) values ('a'), ('b'),('c'),('d'),('e'),('f'),('g');
205
205
explain select 1 from t1 where id =2;
206
206
explain select 1 from t1 where id =2 or id=3;
225
225
# UNIQUE prefix keys and multi-byte charsets
226
226
#
227
227
 
228
 
create table t1 (c varchar(30), t text, unique (c(2)), unique (t(3))) engine=myisam;
 
228
create temporary table t1 (c varchar(30), t text, unique (c(2)), unique (t(3))) engine=myisam;
229
229
show create table t1;
230
230
insert t1 values ('cccc', 'tttt'),
231
231
  (0xD0B1212223D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1212223D0B1D0B1D0B1D0B1),
248
248
# BUG#6151 - myisam index corruption
249
249
#
250
250
DROP TABLE IF EXISTS t1;
251
 
CREATE TABLE t1 (
 
251
CREATE TEMPORARY TABLE t1 (
252
252
  c1 int,
253
253
  c2 varbinary(240),
254
254
  UNIQUE KEY (c1),
286
286
# create dedicated error code for this and
287
287
# and change my_printf_error() to my_error
288
288
 
289
 
--error 1391
 
289
--error ER_KEY_PART_0
290
290
create table t1 (c char(10), index (c(0)));
291
291
 
292
292
#
293
293
# Bug #6126: Duplicate columns in keys should fail
294
294
# Bug #6252: (dup)
295
295
#
296
 
--error 1060
 
296
--error ER_DUP_FIELDNAME
297
297
create table t1 (c char(10), index (c,c));
298
 
--error 1060
 
298
--error ER_DUP_FIELDNAME
299
299
create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1));
300
 
--error 1060
 
300
--error ER_DUP_FIELDNAME
301
301
create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2));
302
 
--error 1060
 
302
--error ER_DUP_FIELDNAME
303
303
create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1));
304
304
create table t1 (c1 char(10), c2 char(10));
305
 
--error 1060
 
305
--error ER_DUP_FIELDNAME
306
306
alter table t1 add key (c1,c1);
307
 
--error 1060
 
307
--error ER_DUP_FIELDNAME
308
308
alter table t1 add key (c2,c1,c1);
309
 
--error 1060
 
309
--error ER_DUP_FIELDNAME
310
310
alter table t1 add key (c1,c2,c1);
311
 
--error 1060
 
311
--error ER_DUP_FIELDNAME
312
312
alter table t1 add key (c1,c1,c2);
313
313
drop table t1;
314
314
 
328
328
# Bug#12565 - ERROR 1034 when running simple UPDATE or DELETE 
329
329
#             on large MyISAM table
330
330
#
331
 
create table t1 (
 
331
create temporary table t1 (
332
332
  c1 int,
333
333
  c2 varchar(20) not null,
334
334
  primary key (c1),
416
416
alter table t1 add primary key (c1, c2), drop primary key;
417
417
alter table t1 drop primary key;
418
418
# Drop is checked first. Primary key must exist.
419
 
--error 1091
 
419
--error ER_CANT_DROP_FIELD_OR_KEY
420
420
alter table t1 add primary key (c1, c2), drop primary key;
421
421
show create table t1;
422
422
# Insert non-unique values.
434
434
# Bug #20604: Test for disabled keys with aggregate functions and FORCE INDEX.
435
435
#
436
436
 
437
 
CREATE TABLE t1( a int, KEY(a) ) ENGINE=MyISAM;
 
437
CREATE TEMPORARY TABLE t1( a int, KEY(a) ) ENGINE=MyISAM;
438
438
INSERT INTO t1 VALUES( 1 );
439
439
ALTER TABLE t1 DISABLE KEYS;
440
440
EXPLAIN SELECT MAX(a) FROM t1 FORCE INDEX(a);