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

Quelle  galera_last_committed_id.test  Sprache: unbekannt

 
Spracherkennung für: .test vermutete Sprache: SQL {SQL[88] MT940[48] ADA[44]} [Methode: maximale Elemente, drei Dimensionen]

#
# Tests functions WSREP_LAST_WRITTEN_GTID and WSREP_LAST_SEEN_GTID
#

--source include/galera_cluster.inc
# This test asserts exact wsrep GTID values (e.g. 100-1-2). The galera wsrep
# GTID domain seqno is cluster-global state, so the cluster must start clean on
# every run (e.g. with --repeat). Force a server restart before the test.
--source include/force_restart.inc

# Returns domain-server-0 if no transactions have been run

SELECT WSREP_LAST_WRITTEN_GTID();

# WSREP_LAST_WRITTEN_GTID() should not be influenced by transactions written
# on other nodes or connections

--connection node_1
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);

--disable_query_log
--let $wsrep_last_written_id_conn_1 = `SELECT WSREP_LAST_WRITTEN_GTID()`
--enable_query_log

--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
--connection node_1a
--eval SELECT WSREP_LAST_WRITTEN_GTID() != '$wsrep_last_written_id_conn_1' AS wsrep_written_does_not_match_different_conn

--connection node_2
--eval SELECT WSREP_LAST_WRITTEN_GTID() != '$wsrep_last_written_id_conn_1' AS wsrep_written_does_not_match_different_nodes

# WSREP_LAST_SEEN_GTID() should be influenced by transactions written
# on other connections

--connection node_1
INSERT INTO t1 VALUES (1);
--disable_query_log
--let $wsrep_last_written_id_conn_1 = `SELECT WSREP_LAST_WRITTEN_GTID()`
--enable_query_log

--connection node_2
--disable_query_log
--eval SELECT WSREP_LAST_SEEN_GTID() = '$wsrep_last_written_id_conn_1' AS wsrep_last_written_seen_id_match
--enable_query_log

# Should not advance while a transaction is in progress

--connection node_1
SET AUTOCOMMIT=OFF;
START TRANSACTION;

--disable_query_log
--let $wsrep_last_written_id_before = `SELECT WSREP_LAST_WRITTEN_GTID()`
--enable_query_log
INSERT INTO t1 VALUES (1);
--disable_query_log
--eval SELECT WSREP_LAST_SEEN_GTID() = '$wsrep_last_written_id_before'
--eval SELECT WSREP_LAST_WRITTEN_GTID() = '$wsrep_last_written_id_before' AS wsrep_last_written_id_match
--enable_query_log

# Should only advance after the transaction has been commited

COMMIT;
--disable_query_log
--eval SELECT WSREP_LAST_WRITTEN_GTID() != 'wsrep_last_written_id_before' AS wsrep_last_written_id_advanced
--enable_query_log
SET AUTOCOMMIT=ON;

DROP TABLE t1;

--connection node_2
CALL mtr.add_suppression("Ignoring server id .* for non bootstrap node");

[Dauer der Verarbeitung: 0.13 Sekunden, vorverarbeitet 2026-10-10]