~drizzle-trunk/drizzle/development

1063.6.5 by Stewart Smith
reintroduce the ALTER TABLE tests from CSV.test but in a alter_table_basic.test as to be somewhere remotely sane. Also use --sorted_result for unordered queries to ensure result is correct for any engine.
1
# originally from csv.test (and who knows what it was doing there)
2
#
3
# tests different types of alter table that some should be fast, others
4
# copying.
5
# rather useless without EXPLAIN ALTER TABLE though
6
7
create table t1 (v varchar(32) not null);
8
insert into t1 values ('def'),('abc'),('hij'),('3r4f');
9
--sorted_result
10
select * from t1;
11
# Fast alter, no copy performed
12
alter table t1 change v v2 varchar(32);
13
--sorted_result
14
select * from t1;
15
# Fast alter, no copy performed
16
alter table t1 change v2 v varchar(64);
17
--sorted_result
18
select * from t1;
19
update t1 set v = 'lmn' where v = 'hij';
20
--sorted_result
21
select * from t1;
22
# Regular alter table
23
alter table t1 add i int auto_increment not null primary key first;
24
--sorted_result
25
select * from t1;
26
update t1 set i=5 where i=3;
27
--sorted_result
28
select * from t1;
29
alter table t1 change i i bigint;
30
--sorted_result
31
select * from t1;
32
alter table t1 add unique key (i, v);
33
--sorted_result
34
select * from t1 where i between 2 and 4 and v in ('def','3r4f','lmn');
35
drop table t1;