~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/flush.test

  • 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:
29
29
select * from t1;
30
30
connection con2;
31
31
flush tables with read lock;
32
 
--error ER_CANT_UPDATE_WITH_READLOCK
 
32
--error 1223
33
33
drop table t2;
34
34
connection con1;
35
35
send drop table t2;
62
62
#select * from t1;
63
63
#drop table t1;
64
64
 
 
65
#
 
66
# Bug#9459 - deadlock with flush with lock, and lock table write
 
67
#
 
68
create table t1 (c1 int);
 
69
lock table t1 write;
 
70
# Cannot get the global read lock with write locked tables.
 
71
--error 1192
 
72
flush tables with read lock;
 
73
lock table t1 read;
 
74
# Can get the global read lock with read locked tables.
 
75
flush tables with read lock;
 
76
--error 1223
 
77
lock table t1 write;
 
78
lock table t1 read;
 
79
--error 1223
 
80
lock table t1 write;
 
81
# Release all table locks and the global read lock.
 
82
unlock tables;
 
83
create table t2 (c1 int);
 
84
create table t3 (c1 int);
 
85
lock table t1 read, t2 read, t3 write;
 
86
# Cannot get the global read lock with write locked tables.
 
87
--error 1192
 
88
flush tables with read lock;
 
89
lock table t1 read, t2 read, t3 read;
 
90
# Can get the global read lock with read locked tables.
 
91
flush tables with read lock;
 
92
# Release all table locks and the global read lock.
 
93
unlock tables;
 
94
drop table t1, t2, t3;
 
95
 
65
96
# End of 4.1 tests
66
97
 
67
98
#
75
106
connect (con3,localhost,root,,);
76
107
 
77
108
connection con1;
 
109
lock table t1 write;
78
110
 
79
111
connection con2;
80
112
send flush tables with read lock;
 
113
--sleep 1
81
114
 
82
115
connection con3;
83
116
send insert into t2 values(1);
 
117
--sleep 1
84
118
 
85
119
connection con1;
86
120
unlock tables;