1SET TIME_ZONE = "+00:00";
2
3--echo #
4--echo # Test of INSERT DELAYED ... SET ...
5--echo #
6
7--echo # 2011-04-19 08:02:40 UTC
8SET TIMESTAMP = 1303200160.123456;
9
10eval CREATE TABLE t1 ( a INT, b $timestamp NOT NULL DEFAULT CURRENT_$timestamp ON UPDATE CURRENT_$timestamp);
11
12INSERT DELAYED INTO t1 SET a = 1;
13FLUSH TABLE t1;
14
15SELECT * FROM t1;
16SELECT * FROM t1 WHERE b = 0;
17
18INSERT DELAYED INTO t1 SET a = 2, b = '1980-01-02 10:20:30.405060';
19FLUSH TABLE t1;
20
21SELECT * FROM t1;
22
23DROP TABLE t1;
24
25--echo #
26--echo # Test of INSERT DELAYED ... VALUES ...
27--echo #
28
29--echo # 2011-04-19 08:04:01 UTC
30SET TIMESTAMP = 1303200241.234567;
31
32eval CREATE TABLE t1 ( a INT, b $timestamp NOT NULL DEFAULT CURRENT_$timestamp ON UPDATE CURRENT_$timestamp);
33
34INSERT DELAYED INTO t1 ( a ) VALUES (1);
35FLUSH TABLE t1;
36SELECT * FROM t1;
37
38INSERT DELAYED INTO t1 VALUES (2, '1977-12-19 12:34:56.789123');
39FLUSH TABLE t1;
40SELECT * FROM t1;
41
42DROP TABLE t1;
43
44--echo #
45--echo # Test of a delayed insert handler servicing two insert operations
46--echo # with different sets of active defaults.
47--echo #
48eval CREATE TABLE t1 ( a INT, b $timestamp NOT NULL DEFAULT CURRENT_$timestamp ON UPDATE CURRENT_$timestamp);
49
50--connect(con1, localhost, root,,)
51--echo # 2011-04-19 08:04:01 UTC
52SET TIMESTAMP = 1303200241.345678;
53SET debug_sync = 'before_write_delayed SIGNAL parked WAIT_FOR go';
54--send INSERT DELAYED INTO t1 ( a ) VALUES (1), (2), (3)
55
56--connection default
57SET debug_sync = 'now WAIT_FOR parked';
58
59--connect(con2, localhost, root,,)
60--echo # 2011-04-19 08:04:01 UTC
61SET TIME_ZONE="+03:00";
62SET TIMESTAMP = 1303200241.456789;
63--send INSERT DELAYED INTO t1 ( a, b ) VALUES (4, '1977-12-19 12:34:56.789123'), (5, '1977-12-19 12:34:57.891234'), (6, '1977-12-19 12:34:58.912345')
64
65--connection default
66SET debug_sync = 'now SIGNAL go';
67
68--let $wait_condition= SELECT COUNT(*) = 6 FROM t1
69--source include/wait_condition.inc
70
71--sorted_result
72SELECT * FROM t1;
73
74--disconnect con1
75--disconnect con2
76
77DROP TABLE t1;
78
79--echo #
80--echo # Test of early activation of function defaults.
81--echo #
82
83eval CREATE TABLE t1 ( a INT, b $timestamp NOT NULL DEFAULT CURRENT_$timestamp ON UPDATE CURRENT_$timestamp);
84
85SET TIMESTAMP = 1317235172.987654; # 2011-09-28 18:39:32 UTC
86INSERT DELAYED INTO t1 ( a ) VALUES (1), (2), (3);
87
88SET TIMESTAMP = 385503754.876543; # 1982-03-20 20:22:34 UTC
89INSERT DELAYED INTO t1 ( a ) VALUES (4), (5), (6);
90
91FLUSH TABLE t1;
92SELECT * FROM t1;
93
94DROP TABLE t1;
95SET debug_sync = 'RESET';
96