~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/tablelock.result

  • Committer: Stewart Smith
  • Date: 2009-05-15 06:57:12 UTC
  • mto: (991.1.5 for-brian)
  • mto: This revision was merged to the branch mainline in revision 1022.
  • Revision ID: stewart@flamingspork.com-20090515065712-bmionylacjmexmmm
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle.

Also fix DEFAULT keyword handling for auto-increment so that it defaults to
NULL and not 0 so that the following is valid and generates two auto-inc
values:

create table t1 (a int auto_increment primary key)
insert into t1 (a) values (default);
insert into t1 (a) values (default);

Important to note that 0 is no longer magic. So this gives you duplicate
primary key error:

insert into t1 (a) values(0);
insert into t1 (a) values(0);

as you've inserted the explicit value of 0 twice.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
drop table if exists t1,t2;
 
2
create table t1 ( n int auto_increment primary key);
 
3
lock tables t1 write;
 
4
insert into t1 values(NULL);
 
5
unlock tables;
 
6
check table t1;
 
7
Table   Op      Msg_type        Msg_text
 
8
test.t1 check   status  OK
 
9
lock tables t1 write, t1 as t0 read;
 
10
insert into t1 values(NULL);
 
11
unlock tables;
 
12
check table t1;
 
13
Table   Op      Msg_type        Msg_text
 
14
test.t1 check   status  OK
 
15
lock tables t1 write, t1 as t0 read, t1 as t2 read;
 
16
insert into t1 values(NULL);
 
17
unlock tables;
 
18
check table t1;
 
19
Table   Op      Msg_type        Msg_text
 
20
test.t1 check   status  OK
 
21
lock tables t1 write, t1 as t0 write, t1 as t2 read;
 
22
insert into t1 values(NULL);
 
23
unlock tables;
 
24
check table t1;
 
25
Table   Op      Msg_type        Msg_text
 
26
test.t1 check   status  OK
 
27
lock tables t1 write, t1 as t0 write, t1 as t2 read, t1 as t3 read;
 
28
insert into t1 values(NULL);
 
29
unlock tables;
 
30
check table t1;
 
31
Table   Op      Msg_type        Msg_text
 
32
test.t1 check   status  OK
 
33
lock tables t1 write, t1 as t0 write, t1 as t2 write;
 
34
insert into t1 values(NULL);
 
35
unlock tables;
 
36
check table t1;
 
37
Table   Op      Msg_type        Msg_text
 
38
test.t1 check   status  OK
 
39
drop table t1;
 
40
CREATE TABLE t1 (a int);
 
41
CREATE TABLE t2 (a int);
 
42
lock tables t1 write,t1 as b write, t2 write, t2 as c read;
 
43
drop table t1,t2;
 
44
CREATE TABLE t1 (a int);
 
45
CREATE TABLE t2 (a int);
 
46
lock tables t1 write,t1 as b write, t2 write, t2 as c read;
 
47
drop table t2,t1;
 
48
unlock tables;
 
49
create temporary table t1(f1 int);
 
50
lock tables t1 write;
 
51
insert into t1 values (1);
 
52
show columns from t1;
 
53
Field   Type    Null    Key     Default Extra
 
54
f1      int     YES             NULL    
 
55
insert into t1 values(2);
 
56
drop table t1;
 
57
unlock tables;