~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/suite/regression/t/686197.test

Merge Stewart's dead code removal

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# A field which is marked NOT NULL has no DEFAULT value should create an
2
 
# error.
3
 
CREATE TABLE t1 (A SERIAL);
4
 
INSERT INTO t1 VALUES (), (), ();
5
 
SELECT A from t1 ORDER BY A;
6
 
--error ER_INVALID_ALTER_TABLE_FOR_NOT_NULL
7
 
ALTER TABLE t1 ADD COLUMN b INT NOT NULL;
8
 
SELECT A from t1 ORDER BY A;
9
 
SHOW CREATE TABLE t1;
10
 
ALTER TABLE t1 ADD COLUMN b INT DEFAULT 1 NOT NULL;
11
 
SELECT A,B from t1 ORDER BY A;
12
 
DROP TABLE t1;
13
 
 
14
 
CREATE TABLE t1 (A SERIAL, b int);
15
 
INSERT INTO t1 VALUES (), (), ();
16
 
SELECT A,B from t1 ORDER BY A;
17
 
--error ER_WARN_DATA_TRUNCATED
18
 
ALTER TABLE t1 MODIFY COLUMN b int not null;
19
 
SELECT A,B from t1 ORDER BY A;
20
 
SHOW CREATE TABLE t1;
21
 
ALTER TABLE t1 MODIFY COLUMN b int DEFAULT 42 NOT NULL;
22
 
SELECT A,B from t1 ORDER BY A;
23
 
DROP TABLE t1;
24
 
 
25
 
CREATE TABLE t1 (col6 int not null);
26
 
INSERT INTO t1 VALUES (2);
27
 
SELECT * FROM t1;
28
 
 
29
 
alter table t1 modify column col6 int not null;
30
 
 
31
 
select * from t1;
32
 
drop table t1;