~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2010-12-07 09:12:12 UTC
  • mto: This revision was merged to the branch mainline in revision 1985.
  • Revision ID: brian@tangent.org-20101207091212-1m0w20tck6z7632m
This is a fix for bug lp:686197

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 1714
 
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 1265
 
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;