~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/r/csv_not_null.result

Merged in changes. 
Edited a the comment test case so deal with our version bump.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# ===== csv_not_null.1 =====
2
2
DROP TABLE IF EXISTS t1, t2;
3
 
Warnings:
4
 
Note    1051    Unknown table 't1'
5
 
Note    1051    Unknown table 't2'
6
3
# === Will fail -- no NOT NULL ===
7
 
CREATE TEMPORARY TABLE t1 (a int) ENGINE = CSV;
 
4
CREATE TABLE t1 (a int) ENGINE = CSV;
8
5
ERROR 42000: The storage engine for the table doesn't support nullable columns
9
6
# === Good CREATE ===
10
 
CREATE TEMPORARY TABLE t1 (a int NOT NULL) ENGINE = CSV;
 
7
CREATE TABLE t1 (a int NOT NULL) ENGINE = CSV;
11
8
# === Will fail -- ALL columns need NOT NULL ==
12
 
CREATE TEMPORARY TABLE t2 (a int NOT NULL, b char(20)) ENGINE = CSV;
 
9
CREATE TABLE t2 (a int NOT NULL, b char(20)) ENGINE = CSV;
13
10
ERROR 42000: The storage engine for the table doesn't support nullable columns
14
11
DROP TABLE t1;
15
12
# ===== csv_not_null.2 =====
16
13
DROP TABLE IF EXISTS t1;
17
 
Warnings:
18
 
Note    1051    Unknown table 't1'
19
 
CREATE TEMPORARY TABLE t1 (a int NOT NULL, b blob NOT NULL, c CHAR(20) NOT NULL, 
 
14
CREATE TABLE t1 (a int NOT NULL, b blob NOT NULL, c CHAR(20) NOT NULL, 
20
15
d VARCHAR(20) NOT NULL, e enum('foo','bar') NOT NULL,f DATE NOT NULL) 
21
16
ENGINE = CSV;
 
17
# === should result in default for each datatype ===
22
18
INSERT INTO t1 VALUES();
23
 
ERROR HY000: Field 'a' doesn't have a default value
24
 
SELECT * FROM t1;
25
 
a       b       c       d       e       f
26
 
SELECT * FROM t1;
27
 
a       b       c       d       e       f
 
19
SELECT * FROM t1;
 
20
a       b       c       d       e       f
 
21
0                               foo     0000-00-00
 
22
SELECT * FROM t1;
 
23
a       b       c       d       e       f
 
24
0                               foo     0000-00-00
28
25
INSERT INTO t1 VALUES(0,'abc','def','ghi','bar','1999-12-31');
29
26
SELECT * FROM t1;
30
27
a       b       c       d       e       f
 
28
0                               foo     0000-00-00
31
29
0       abc     def     ghi     bar     1999-12-31
32
30
# === insert failures ===
33
31
INSERT INTO t1 VALUES(NULL,'ab','a','b','foo','2007-01-01');
38
36
DROP TABLE t1;
39
37
# ===== csv_not_null.3 =====
40
38
DROP TABLE IF EXISTS t1;
41
 
Warnings:
42
 
Note    1051    Unknown table 't1'
43
 
CREATE TEMPORARY TABLE t1 (a int NOT NULL, b char(10) NOT NULL) ENGINE = CSV;
 
39
CREATE TABLE t1 (a int NOT NULL, b char(10) NOT NULL) ENGINE = CSV;
44
40
INSERT INTO t1 VALUES();
45
 
ERROR HY000: Field 'a' doesn't have a default value
46
 
insert into t1 values (0,"");
47
41
SELECT * FROM t1;
48
42
a       b
49
43
0