mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
add group_commit_reason_immediate to binlog_commit_wait test
This commit is contained in:
@ -12,6 +12,8 @@ SELECT variable_value INTO @group_commit_reason_usec FROM information_schema.glo
|
|||||||
WHERE variable_name = 'binlog_group_commit_reason_usec';
|
WHERE variable_name = 'binlog_group_commit_reason_usec';
|
||||||
SELECT variable_value INTO @group_commit_reason_transaction FROM information_schema.global_status
|
SELECT variable_value INTO @group_commit_reason_transaction FROM information_schema.global_status
|
||||||
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
||||||
|
SELECT variable_value INTO @group_commit_reason_immediate FROM information_schema.global_status
|
||||||
|
WHERE variable_name = 'binlog_group_commit_reason_immediate';
|
||||||
SET @a= current_timestamp();
|
SET @a= current_timestamp();
|
||||||
BEGIN;
|
BEGIN;
|
||||||
INSERT INTO t1 VALUES (1,0);
|
INSERT INTO t1 VALUES (1,0);
|
||||||
@ -37,6 +39,10 @@ SELECT variable_value - @group_commit_reason_transaction FROM information_schema
|
|||||||
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
||||||
variable_value - @group_commit_reason_transaction
|
variable_value - @group_commit_reason_transaction
|
||||||
1
|
1
|
||||||
|
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
|
||||||
|
WHERE variable_name = 'binlog_group_commit_reason_immediate';
|
||||||
|
variable_value - @group_commit_reason_immediate
|
||||||
|
0
|
||||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||||
SET @a= current_timestamp();
|
SET @a= current_timestamp();
|
||||||
INSERT INTO t1 VALUES (2,0);
|
INSERT INTO t1 VALUES (2,0);
|
||||||
@ -62,6 +68,10 @@ SELECT variable_value - @group_commit_reason_transaction FROM information_schema
|
|||||||
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
||||||
variable_value - @group_commit_reason_transaction
|
variable_value - @group_commit_reason_transaction
|
||||||
1
|
1
|
||||||
|
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
|
||||||
|
WHERE variable_name = 'binlog_group_commit_reason_immediate';
|
||||||
|
variable_value - @group_commit_reason_immediate
|
||||||
|
0
|
||||||
SET @a= current_timestamp();
|
SET @a= current_timestamp();
|
||||||
INSERT INTO t1 VALUES (6,0);
|
INSERT INTO t1 VALUES (6,0);
|
||||||
BEGIN;
|
BEGIN;
|
||||||
@ -92,6 +102,10 @@ SELECT variable_value - @group_commit_reason_transaction FROM information_schema
|
|||||||
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
||||||
variable_value - @group_commit_reason_transaction
|
variable_value - @group_commit_reason_transaction
|
||||||
2
|
2
|
||||||
|
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
|
||||||
|
WHERE variable_name = 'binlog_group_commit_reason_immediate';
|
||||||
|
variable_value - @group_commit_reason_immediate
|
||||||
|
0
|
||||||
SET @a= current_timestamp();
|
SET @a= current_timestamp();
|
||||||
INSERT INTO t1 VALUES (7,0);
|
INSERT INTO t1 VALUES (7,0);
|
||||||
INSERT INTO t1 VALUES (8,0);
|
INSERT INTO t1 VALUES (8,0);
|
||||||
@ -115,6 +129,10 @@ SELECT variable_value - @group_commit_reason_transaction FROM information_schema
|
|||||||
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
||||||
variable_value - @group_commit_reason_transaction
|
variable_value - @group_commit_reason_transaction
|
||||||
2
|
2
|
||||||
|
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
|
||||||
|
WHERE variable_name = 'binlog_group_commit_reason_immediate';
|
||||||
|
variable_value - @group_commit_reason_immediate
|
||||||
|
0
|
||||||
SET @a= current_timestamp();
|
SET @a= current_timestamp();
|
||||||
SET GLOBAL binlog_commit_wait_usec= 5*1000*1000;
|
SET GLOBAL binlog_commit_wait_usec= 5*1000*1000;
|
||||||
INSERT INTO t1 VALUES (9,0);
|
INSERT INTO t1 VALUES (9,0);
|
||||||
@ -140,6 +158,10 @@ SELECT variable_value - @group_commit_reason_transaction FROM information_schema
|
|||||||
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
||||||
variable_value - @group_commit_reason_transaction
|
variable_value - @group_commit_reason_transaction
|
||||||
2
|
2
|
||||||
|
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
|
||||||
|
WHERE variable_name = 'binlog_group_commit_reason_immediate';
|
||||||
|
variable_value - @group_commit_reason_immediate
|
||||||
|
0
|
||||||
SELECT * FROM t1 ORDER BY a;
|
SELECT * FROM t1 ORDER BY a;
|
||||||
a b
|
a b
|
||||||
1 11
|
1 11
|
||||||
|
@ -23,6 +23,8 @@ SELECT variable_value INTO @group_commit_reason_usec FROM information_schema.glo
|
|||||||
WHERE variable_name = 'binlog_group_commit_reason_usec';
|
WHERE variable_name = 'binlog_group_commit_reason_usec';
|
||||||
SELECT variable_value INTO @group_commit_reason_transaction FROM information_schema.global_status
|
SELECT variable_value INTO @group_commit_reason_transaction FROM information_schema.global_status
|
||||||
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
||||||
|
SELECT variable_value INTO @group_commit_reason_immediate FROM information_schema.global_status
|
||||||
|
WHERE variable_name = 'binlog_group_commit_reason_immediate';
|
||||||
|
|
||||||
# Note: binlog_group_commits is counted at the start of the group and group_commit_reason_* is
|
# Note: binlog_group_commits is counted at the start of the group and group_commit_reason_* is
|
||||||
# counted near when the groups its finalised.
|
# counted near when the groups its finalised.
|
||||||
@ -62,6 +64,8 @@ SELECT variable_value - @group_commit_reason_usec FROM information_schema.global
|
|||||||
WHERE variable_name = 'binlog_group_commit_reason_usec';
|
WHERE variable_name = 'binlog_group_commit_reason_usec';
|
||||||
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status
|
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status
|
||||||
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
||||||
|
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
|
||||||
|
WHERE variable_name = 'binlog_group_commit_reason_immediate';
|
||||||
|
|
||||||
--connection con2
|
--connection con2
|
||||||
--error ER_DUP_ENTRY
|
--error ER_DUP_ENTRY
|
||||||
@ -101,6 +105,8 @@ SELECT variable_value - @group_commit_reason_usec FROM information_schema.global
|
|||||||
WHERE variable_name = 'binlog_group_commit_reason_usec';
|
WHERE variable_name = 'binlog_group_commit_reason_usec';
|
||||||
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status
|
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status
|
||||||
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
||||||
|
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
|
||||||
|
WHERE variable_name = 'binlog_group_commit_reason_immediate';
|
||||||
|
|
||||||
# Test that commit triggers immediately if there is already a transaction
|
# Test that commit triggers immediately if there is already a transaction
|
||||||
# waiting on another transaction that reaches its commit.
|
# waiting on another transaction that reaches its commit.
|
||||||
@ -147,6 +153,8 @@ SELECT variable_value - @group_commit_reason_usec FROM information_schema.global
|
|||||||
WHERE variable_name = 'binlog_group_commit_reason_usec';
|
WHERE variable_name = 'binlog_group_commit_reason_usec';
|
||||||
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status
|
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status
|
||||||
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
||||||
|
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
|
||||||
|
WHERE variable_name = 'binlog_group_commit_reason_immediate';
|
||||||
|
|
||||||
--connection default
|
--connection default
|
||||||
SET @a= current_timestamp();
|
SET @a= current_timestamp();
|
||||||
@ -174,6 +182,8 @@ SELECT variable_value - @group_commit_reason_usec FROM information_schema.global
|
|||||||
WHERE variable_name = 'binlog_group_commit_reason_usec';
|
WHERE variable_name = 'binlog_group_commit_reason_usec';
|
||||||
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status
|
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status
|
||||||
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
||||||
|
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
|
||||||
|
WHERE variable_name = 'binlog_group_commit_reason_immediate';
|
||||||
|
|
||||||
# Test that when the binlog_commit_wait_usec is reached the tranction gets a group commit
|
# Test that when the binlog_commit_wait_usec is reached the tranction gets a group commit
|
||||||
|
|
||||||
@ -201,6 +211,8 @@ SELECT variable_value - @group_commit_reason_usec FROM information_schema.global
|
|||||||
WHERE variable_name = 'binlog_group_commit_reason_usec';
|
WHERE variable_name = 'binlog_group_commit_reason_usec';
|
||||||
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status
|
SELECT variable_value - @group_commit_reason_transaction FROM information_schema.global_status
|
||||||
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
WHERE variable_name = 'binlog_group_commit_reason_transaction';
|
||||||
|
SELECT variable_value - @group_commit_reason_immediate FROM information_schema.global_status
|
||||||
|
WHERE variable_name = 'binlog_group_commit_reason_immediate';
|
||||||
|
|
||||||
--connection default
|
--connection default
|
||||||
SELECT * FROM t1 ORDER BY a;
|
SELECT * FROM t1 ORDER BY a;
|
||||||
|
Reference in New Issue
Block a user