@@ -4,6 +4,14 @@ SET @old_count= @@GLOBAL.binlog_commit_wait_count;
4
4
SET GLOBAL binlog_commit_wait_count= 3;
5
5
SET @old_usec= @@GLOBAL.binlog_commit_wait_usec;
6
6
SET GLOBAL binlog_commit_wait_usec= 20000000;
7
+ SELECT variable_value INTO @group_commits FROM information_schema.global_status
8
+ WHERE variable_name = 'binlog_group_commits';
9
+ SELECT variable_value INTO @group_commit_reason_count FROM information_schema.global_status
10
+ WHERE variable_name = 'binlog_group_commit_reason_count';
11
+ SELECT variable_value INTO @group_commit_reason_usec FROM information_schema.global_status
12
+ WHERE variable_name = 'binlog_group_commit_reason_usec';
13
+ SELECT variable_value INTO @group_commit_reason_transaction FROM information_schema.global_status
14
+ WHERE variable_name = 'binlog_group_commit_reason_transaction';
7
15
SET @a= current_timestamp();
8
16
BEGIN;
9
17
INSERT INTO t1 VALUES (1,0);
@@ -13,6 +21,22 @@ SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
13
21
SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
14
22
IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"))
15
23
Ok
24
+ SELECT variable_value - @group_commits FROM information_schema.global_status
25
+ WHERE variable_name = 'binlog_group_commits';
26
+ variable_value - @group_commits
27
+ 1
28
+ SELECT variable_value - @group_commit_reason_count FROM information_schema.global_status
29
+ WHERE variable_name = 'binlog_group_commit_reason_count';
30
+ variable_value - @group_commit_reason_count
31
+ 0
32
+ SELECT variable_value - @group_commit_reason_usec FROM information_schema.global_status
33
+ WHERE variable_name = 'binlog_group_commit_reason_usec';
34
+ variable_value - @group_commit_reason_usec
35
+ 0
36
+ SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status
37
+ WHERE variable_name = 'binlog_group_commit_reason_transaction';
38
+ variable_value - @group_commit_reason_transaction
39
+ 1
16
40
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
17
41
SET @a= current_timestamp();
18
42
INSERT INTO t1 VALUES (2,0);
@@ -22,6 +46,22 @@ SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
22
46
SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
23
47
IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"))
24
48
Ok
49
+ SELECT variable_value - @group_commits FROM information_schema.global_status
50
+ WHERE variable_name = 'binlog_group_commits';
51
+ variable_value - @group_commits
52
+ 2
53
+ SELECT variable_value - @group_commit_reason_count FROM information_schema.global_status
54
+ WHERE variable_name = 'binlog_group_commit_reason_count';
55
+ variable_value - @group_commit_reason_count
56
+ 1
57
+ SELECT variable_value - @group_commit_reason_usec FROM information_schema.global_status
58
+ WHERE variable_name = 'binlog_group_commit_reason_usec';
59
+ variable_value - @group_commit_reason_usec
60
+ 0
61
+ SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status
62
+ WHERE variable_name = 'binlog_group_commit_reason_transaction';
63
+ variable_value - @group_commit_reason_transaction
64
+ 1
25
65
SET @a= current_timestamp();
26
66
INSERT INTO t1 VALUES (6,0);
27
67
BEGIN;
@@ -36,13 +76,70 @@ SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
36
76
SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
37
77
IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"))
38
78
Ok
79
+ SELECT variable_value - @group_commits FROM information_schema.global_status
80
+ WHERE variable_name = 'binlog_group_commits';
81
+ variable_value - @group_commits
82
+ 3
83
+ SELECT variable_value - @group_commit_reason_count FROM information_schema.global_status
84
+ WHERE variable_name = 'binlog_group_commit_reason_count';
85
+ variable_value - @group_commit_reason_count
86
+ 1
87
+ SELECT variable_value - @group_commit_reason_usec FROM information_schema.global_status
88
+ WHERE variable_name = 'binlog_group_commit_reason_usec';
89
+ variable_value - @group_commit_reason_usec
90
+ 0
91
+ SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status
92
+ WHERE variable_name = 'binlog_group_commit_reason_transaction';
93
+ variable_value - @group_commit_reason_transaction
94
+ 2
39
95
SET @a= current_timestamp();
40
96
INSERT INTO t1 VALUES (7,0);
41
97
INSERT INTO t1 VALUES (8,0);
42
98
SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
43
99
SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
44
100
IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"))
45
101
Ok
102
+ SELECT variable_value - @group_commits FROM information_schema.global_status
103
+ WHERE variable_name = 'binlog_group_commits';
104
+ variable_value - @group_commits
105
+ 4
106
+ SELECT variable_value - @group_commit_reason_count FROM information_schema.global_status
107
+ WHERE variable_name = 'binlog_group_commit_reason_count';
108
+ variable_value - @group_commit_reason_count
109
+ 2
110
+ SELECT variable_value - @group_commit_reason_usec FROM information_schema.global_status
111
+ WHERE variable_name = 'binlog_group_commit_reason_usec';
112
+ variable_value - @group_commit_reason_usec
113
+ 0
114
+ SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status
115
+ WHERE variable_name = 'binlog_group_commit_reason_transaction';
116
+ variable_value - @group_commit_reason_transaction
117
+ 2
118
+ SET @a= current_timestamp();
119
+ SET GLOBAL binlog_commit_wait_usec= 5*1000*1000;
120
+ INSERT INTO t1 VALUES (9,0);
121
+ SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
122
+ SELECT IF(@b < 4, CONCAT("Error: too little time elapsed: ", @b, " seconds < 4"),
123
+ IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")));
124
+ IF(@b < 4, CONCAT("Error: too little time elapsed: ", @b, " seconds < 4"),
125
+ IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")))
126
+ Ok
127
+ SELECT variable_value - @group_commits FROM information_schema.global_status
128
+ WHERE variable_name = 'binlog_group_commits';
129
+ variable_value - @group_commits
130
+ 5
131
+ SELECT variable_value - @group_commit_reason_count FROM information_schema.global_status
132
+ WHERE variable_name = 'binlog_group_commit_reason_count';
133
+ variable_value - @group_commit_reason_count
134
+ 2
135
+ SELECT variable_value - @group_commit_reason_usec FROM information_schema.global_status
136
+ WHERE variable_name = 'binlog_group_commit_reason_usec';
137
+ variable_value - @group_commit_reason_usec
138
+ 1
139
+ SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status
140
+ WHERE variable_name = 'binlog_group_commit_reason_transaction';
141
+ variable_value - @group_commit_reason_transaction
142
+ 2
46
143
SELECT * FROM t1 ORDER BY a;
47
144
a b
48
145
1 11
52
149
6 0
53
150
7 0
54
151
8 0
152
+ 9 0
55
153
DROP TABLE t1;
56
154
SET GLOBAL binlog_commit_wait_count= @old_count;
57
155
SET GLOBAL binlog_commit_wait_usec= @old_usec;
0 commit comments