Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/MariaDB/mysql-test/suite/binlog_in_engine/   (MariaDB Server Version 8.1-8.4©)  Datei vom 1.9.2026 mit Größe 4 kB image not shown  

Quelle  xa_restart2.result   Sprache: Lisp

 

include/master-slave.inc
[connection master]
*** Test XA PREPARE preserved over server restart.
CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL, c LONGBLOB, PRIMARY KEY(a, b)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (0, 1, '');
INSERT INTO t1 VALUES (0, 2, '');
INSERT INTO t1 VALUES (0, 3, '');
connect con1,localhost,root,,;
XA BEGIN 'x1';
INSERT INTO t1 VALUES (1, 1, '');
connect con2,localhost,root,,;
XA BEGIN 'x2';
INSERT INTO t1 VALUES (2, 1, REPEAT('2', 100000));
connect con3,localhost,root,,;
XA BEGIN 'x3';
INSERT INTO t1 VALUES (3, 1, '');
connection con1;
INSERT INTO t1 VALUES (1, 2, '');
connection con2;
INSERT INTO t1 VALUES (2, 2, REPEAT('2', 40000));
connection con3;
INSERT INTO t1 VALUES (3, 2, REPEAT('3', 50000));
connection con2;
INSERT INTO t1 VALUES (2, 3, REPEAT('2', 40000));
connection con3;
INSERT INTO t1 VALUES (3, 3, REPEAT('3', 100000));
INSERT INTO t1 VALUES (3, 4, REPEAT('3', 100000));
INSERT INTO t1 VALUES (3, 5, REPEAT('3', 100000));
INSERT INTO t1 VALUES (3, 6, REPEAT('3', 100000));
connection con2;
INSERT INTO t1 VALUES (2, 4, REPEAT('2', 40000));
connection con1;
INSERT INTO t1 VALUES (1, 3, '');
XA END 'x1';
XA PREPARE 'x1';
connection con2;
XA END 'x2';
XA PREPARE 'x2';
connection con3;
INSERT INTO t1 VALUES (3, 7, '');
XA END 'x3';
XA PREPARE 'x3';
connection slave;
include/stop_slave.inc
connection master;
include/rpl_restart_server.inc [server_number=1]
disconnect con1;
disconnect con2;
disconnect con3;
connection slave;
include/start_slave.inc
connection master;
XA RECOVER;
formatID gtrid_length bqual_length data
1 2 0 x1
1 2 0 x2
1 2 0 x3
XA COMMIT 'x1';
XA ROLLBACK 'x2';
XA COMMIT 'x3';
SELECT a, b, LENGTH(c) FROM t1 ORDER BY a,b;
a b LENGTH(c)
0 1 0
0 2 0
0 3 0
1 1 0
1 2 0
1 3 0
3 1 0
3 2 50000
3 3 100000
3 4 100000
3 5 100000
3 6 100000
3 7 0
include/save_master_gtid.inc
connection slave;
include/sync_with_master_gtid.inc
SELECT a, b, LENGTH(c) FROM t1 ORDER BY a,b;
a b LENGTH(c)
0 1 0
0 2 0
0 3 0
1 1 0
1 2 0
1 3 0
3 1 0
3 2 50000
3 3 100000
3 4 100000
3 5 100000
3 6 100000
3 7 0
*** Test purgability of binlogs containing XA oob after restart.
connection slave;
include/stop_slave.inc
connection master;
include/reset_master.inc
connect con1,localhost,root,,;
XA START 'x4';
INSERT INTO t1 VALUES (4, 1, REPEAT('4', 40000));
connection master;
FLUSH BINARY LOGS;
connect con2,localhost,root,,;
XA START 'x5';
INSERT INTO t1 VALUES (5, 1, REPEAT('5', 40000));
XA END 'x5';
XA PREPARE 'x5';
connection master;
FLUSH BINARY LOGS;
connect con3,localhost,root,,;
XA START 'x6';
INSERT INTO t1 VALUES (6, 1, 'x6');
XA END 'x6';
XA PREPARE 'x6';
connection con1;
XA END 'x4';
XA PREPARE 'x4';
connection master;
include/rpl_restart_server.inc [server_number=1]
disconnect con1;
disconnect con2;
disconnect con3;
connection slave;
SET GLOBAL gtid_slave_pos= '';
include/start_slave.inc
connection master;
XA RECOVER;
formatID gtrid_length bqual_length data
1 2 0 x4
1 2 0 x5
1 2 0 x6
SET @old_min_slaves= @@GLOBAL.slave_connections_needed_for_purge;
SET GLOBAL slave_connections_needed_for_purge= 1;
FLUSH BINARY LOGS;
PURGE BINARY LOGS TO 'binlog-000001.ibb';
ERROR HY000: A purgeable log is in use, will not purge
XA COMMIT 'x4';
include/save_master_gtid.inc
connection slave;
include/sync_with_master_gtid.inc
connection master;
PURGE BINARY LOGS TO 'binlog-000001.ibb';
PURGE BINARY LOGS TO 'binlog-000002.ibb';
ERROR HY000: A purgeable log is in use, will not purge
XA ROLLBACK 'x5';
include/save_master_gtid.inc
connection slave;
include/sync_with_master_gtid.inc
connection master;
PURGE BINARY LOGS TO 'binlog-000002.ibb';
FLUSH BINARY LOGS;
PURGE BINARY LOGS TO 'binlog-000003.ibb';
ERROR HY000: A purgeable log is in use, will not purge
XA COMMIT 'x6';
FLUSH BINARY LOGS;
INSERT INTO t1 VALUES (7, 1, '');
include/save_master_gtid.inc
connection slave;
include/sync_with_master_gtid.inc
connection master;
PURGE BINARY LOGS TO 'binlog-000003.ibb';
include/save_master_gtid.inc
connection slave;
include/sync_with_master_gtid.inc
connection master;
SET GLOBAL slave_connections_needed_for_purge= @old_min_slaves;
DROP TABLE t1;
include/rpl_end.inc

Messung V0.5 in Prozent
C=37 H=100 G=75

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-10-08) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.