~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/alter_table.test

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
15
15
col6 int not null, to_be_deleted int);
16
16
insert into t1 values (2,4,3,5,"PENDING",1,7);
 
17
SELECT * FROM t1;
 
18
 
 
19
--error ER_INVALID_ALTER_TABLE_FOR_NOT_NULL
17
20
alter table t1
18
21
add column col4_5 varchar(20) not null after col4,
19
22
add column col7 varchar(30) not null after col5,
20
23
add column col8 datetime not null default '1000-01-01 00:00:00', drop column to_be_deleted,
21
24
change column col2 fourth varchar(30) not null after col3,
22
25
modify column col6 int not null first;
 
26
 
 
27
alter table t1
 
28
add column col4_5 varchar(20) DEFAULT "added" not null after col4,
 
29
add column col7 varchar(30) DEFAULT "added" not null after col5,
 
30
add column col8 datetime not null default '1000-01-01 00:00:00',
 
31
drop column to_be_deleted,
 
32
change column col2 fourth varchar(30) not null after col3,
 
33
modify column col6 int not null first;
 
34
 
23
35
select * from t1;
24
36
drop table t1;
25
37
 
685
697
--echo "Non-copy data change - new frm, but old data and index files"
686
698
ALTER TABLE t1 CHANGE int_field unsigned_int_field INTEGER NOT NULL, RENAME t2;
687
699
 
688
 
--error ER_NO_SUCH_TABLE
 
700
--error ER_TABLE_UNKNOWN
689
701
SELECT * FROM t1 ORDER BY int_field;
690
702
SELECT * FROM t2 ORDER BY unsigned_int_field;
691
703
DESCRIBE t2;