~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/heap.test

  • Committer: Monty Taylor
  • Date: 2009-12-14 22:00:27 UTC
  • mto: (1241.9.10 out-of-tree)
  • mto: This revision was merged to the branch mainline in revision 1250.
  • Revision ID: mordred@inaugust.com-20091214220027-kpmfbl452nctzc0g
pandora-build v0.85 - Fixed C++ standard setting.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
create temporary table t1 (a int not null,b int not null, primary key (a)) engine=MEMORY comment="testing heaps";
10
10
insert into t1 values(1,1),(2,2),(3,3),(4,4);
11
11
delete from t1 where a=1 or a=0;
12
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
13
 
show table status like "t1";
 
12
#show table status like "t1";
14
13
show keys from t1;
15
14
select * from t1;
16
15
select * from t1 where a=4;
18
17
update t1 set b=b+1 where a>=3;
19
18
replace t1 values (3,3);
20
19
select * from t1;
21
 
alter table t1 add c int DEFAULT 42 not null, add key (c,a);
 
20
alter table t1 add c int not null, add key (c,a);
22
21
drop table t1;
23
22
 
24
23
create temporary table t1 (a int not null,b int not null, primary key (a)) engine=memory comment="testing heaps";
30
29
create temporary table t1 (a int not null,b int not null, primary key (a)) engine=MEMORY comment="testing heaps";
31
30
insert into t1 values(1,1),(2,2),(3,3),(4,4);
32
31
alter table t1 modify a int not null auto_increment, engine=innodb, comment="new innodb table";
33
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
34
 
show table status like "t1";
 
32
#show table status like "t1";
35
33
select * from t1;
36
34
drop table t1;
37
35
 
108
106
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
109
107
explain select * from t1 where btn like "q%";
110
108
select * from t1 where btn like "q%";
111
 
alter table t1 add column new_col char(1) DEFAULT "Y" not null, add key (btn,new_col), drop key btn;
 
109
alter table t1 add column new_col char(1) not null, add key (btn,new_col), drop key btn;
112
110
update t1 set new_col=left(btn,1);
113
111
explain select * from t1 where btn="a";
114
112
explain select * from t1 where btn="a" and new_col="a";
215
213
create temporary table t1 (v varchar(10), c char(10), t varchar(50));
216
214
insert into t1 values('+ ', '+ ', '+ ');
217
215
set @a=repeat(' ',20);
218
 
--error ER_DATA_TOO_LONG
219
 
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
220
 
set @a=repeat(' ',10);
221
 
--error ER_DATA_TOO_LONG
222
 
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
223
 
set @a=repeat(' ',9);
224
216
insert into t1 values (concat('+',@a),concat('+',@a),concat('+',@a));
225
217
select concat('*',v,'*',c,'*',t,'*') from t1;
226
218
 
315
307
insert into t1 values ('a '),('a  '),('a   '),('a         ');
316
308
--error ER_DUP_ENTRY
317
309
insert into t1 values ('a     ');
318
 
--error ER_DATA_TOO_LONG
 
310
--error ER_DUP_ENTRY
319
311
insert into t1 values ('a          ');
320
312
--error ER_DUP_ENTRY
321
313
insert into t1 values ('a ');
393
385
insert into t1 values ('a '),('a  '),('a   '),('a         ');
394
386
--error ER_DUP_ENTRY
395
387
insert into t1 values ('a     ');
396
 
--error ER_DATA_TOO_LONG
 
388
--error ER_DUP_ENTRY
397
389
insert into t1 values ('a          ');
398
390
--error ER_DUP_ENTRY
399
391
insert into t1 values ('a ');
436
428
select * from t1;
437
429
drop table t1;
438
430
 
439
 
--error ER_WRONG_AUTO_KEY
 
431
--error 1075
440
432
create temporary table t1 (a int not null, b int not null auto_increment,
441
433
  primary key(a, b)) engine=MEMORY;
442
434
 
467
459
#
468
460
create temporary table t1 (c char(10)) engine=memory;
469
461
create temporary table t2 (c varchar(10)) engine=memory;
470
 
--replace_column 1 #  6 # 7 # 8 # 9 # 10 #
 
462
--replace_column 3 # 8 #
471
463
show table status like 't_';
472
464
drop table t1, t2;
473
465