~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/csv_not_null.result

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# ===== csv_not_null.1 =====
2
 
DROP TABLE IF EXISTS t1, t2;
3
 
Warnings:
4
 
Note    1051    Unknown table 't1'
5
 
Note    1051    Unknown table 't2'
6
 
# === Will fail -- no NOT NULL ===
7
 
CREATE TEMPORARY TABLE t1 (a int) ENGINE = CSV;
8
 
ERROR 42000: The storage engine for the table doesn't support nullable columns
9
 
# === Good CREATE ===
10
 
CREATE TEMPORARY TABLE t1 (a int NOT NULL) ENGINE = CSV;
11
 
# === Will fail -- ALL columns need NOT NULL ==
12
 
CREATE TEMPORARY TABLE t2 (a int NOT NULL, b char(20)) ENGINE = CSV;
13
 
ERROR 42000: The storage engine for the table doesn't support nullable columns
14
 
DROP TABLE t1;
15
 
# ===== csv_not_null.2 =====
16
 
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, 
20
 
d VARCHAR(20) NOT NULL, e enum('foo','bar') NOT NULL,f DATE NOT NULL) 
21
 
ENGINE = CSV;
22
 
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
28
 
INSERT INTO t1 VALUES(0,'abc','def','ghi','bar','1999-12-31');
29
 
SELECT * FROM t1;
30
 
a       b       c       d       e       f
31
 
0       abc     def     ghi     bar     1999-12-31
32
 
# === insert failures ===
33
 
INSERT INTO t1 VALUES(NULL,'ab','a','b','foo','2007-01-01');
34
 
ERROR 23000: Column 'a' cannot be null
35
 
INSERT INTO t1 VALUES(default(a),default(b), default(c), default(d),
36
 
default(e), default(f));
37
 
ERROR HY000: Field 'a' doesn't have a default value
38
 
DROP TABLE t1;
39
 
# ===== csv_not_null.3 =====
40
 
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;
44
 
INSERT INTO t1 VALUES();
45
 
ERROR HY000: Field 'a' doesn't have a default value
46
 
insert into t1 values (0,"");
47
 
SELECT * FROM t1;
48
 
a       b
49
 
0       
50
 
UPDATE t1 set b = 'new_value' where a = 0;
51
 
SELECT * FROM t1;
52
 
a       b
53
 
0       new_value
54
 
UPDATE t1 set b = NULL where b = 'new_value';
55
 
ERROR 23000: Column 'b' cannot be null
56
 
SELECT * FROM t1;
57
 
a       b
58
 
0       new_value
59
 
DROP TABLE t1;