summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/rpl/include
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-01 18:15:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-01 18:15:00 +0000
commita2a2e32c02643a0cec111511220227703fda1cd5 (patch)
tree69cc2b631234c2a8e026b9cd4d72676c61c594df /mysql-test/suite/rpl/include
parentReleasing progress-linux version 1:10.11.8-1~progress7.99u1. (diff)
downloadmariadb-a2a2e32c02643a0cec111511220227703fda1cd5.tar.xz
mariadb-a2a2e32c02643a0cec111511220227703fda1cd5.zip
Merging upstream version 1:11.4.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/rpl/include')
-rw-r--r--mysql-test/suite/rpl/include/multisource.inc4
-rw-r--r--mysql-test/suite/rpl/include/rpl_change_master_demote.inc2
-rw-r--r--mysql-test/suite/rpl/include/rpl_extra_col_slave.test3
-rw-r--r--mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test4
-rw-r--r--mysql-test/suite/rpl/include/rpl_gtid_index.inc187
-rw-r--r--mysql-test/suite/rpl/include/rpl_gtid_until_before_after_gtids.test375
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_blob.test18
7 files changed, 587 insertions, 6 deletions
diff --git a/mysql-test/suite/rpl/include/multisource.inc b/mysql-test/suite/rpl/include/multisource.inc
index 96c4a9aa..8d9fa1f4 100644
--- a/mysql-test/suite/rpl/include/multisource.inc
+++ b/mysql-test/suite/rpl/include/multisource.inc
@@ -38,7 +38,8 @@ change master 'abc2' to master_host='';
eval change master 'master1' to
master_port=$SERVER_MYPORT_1,
master_host='127.0.0.1',
-master_user='root';
+master_user='root',
+master_ssl_verify_server_cert=0;
start slave 'master1';
set default_master_connection = 'master1';
@@ -160,6 +161,7 @@ eval change master to
master_port=$SERVER_MYPORT_2,
master_host='127.0.0.1',
master_user='root',
+master_ssl_verify_server_cert=0,
master_use_gtid=no;
start slave;
diff --git a/mysql-test/suite/rpl/include/rpl_change_master_demote.inc b/mysql-test/suite/rpl/include/rpl_change_master_demote.inc
index 932a2b87..d14f0a2b 100644
--- a/mysql-test/suite/rpl/include/rpl_change_master_demote.inc
+++ b/mysql-test/suite/rpl/include/rpl_change_master_demote.inc
@@ -29,7 +29,7 @@ if (`SELECT strcmp("$ignore_domain_ids","") != 0`)
--echo # gtid_current_pos calculation
--let $current_pos= `SELECT @@gtid_current_pos`
--replace_result $SLAVE_MYPORT SLAVE_PORT
---eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SLAVE_MYPORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 $extra_cm_args
+--eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SLAVE_MYPORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 $extra_cm_args
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
--let $slave_pos= `SELECT @@gtid_slave_pos`
--echo # Validating gtid_slave_pos == gtid_binlog_pos..
diff --git a/mysql-test/suite/rpl/include/rpl_extra_col_slave.test b/mysql-test/suite/rpl/include/rpl_extra_col_slave.test
index 680d5724..028c833a 100644
--- a/mysql-test/suite/rpl/include/rpl_extra_col_slave.test
+++ b/mysql-test/suite/rpl/include/rpl_extra_col_slave.test
@@ -397,8 +397,7 @@ sync_slave_with_master;
STOP SLAVE;
--source include/reset_slave.inc
eval CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
- d TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
- ON UPDATE CURRENT_TIMESTAMP,
+ d TIMESTAMP NOT NULL DEFAULT 0,
e INT NOT NULL,
f text not null,
g text,
diff --git a/mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test b/mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test
index 18175928..f87ea01f 100644
--- a/mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test
+++ b/mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test
@@ -24,7 +24,7 @@
#
# let $debug_sync_action= 'now signal signal_name';
#
-# The $dbug_sync_point becomes the value of @@global.debug generating
+# The $dbug_sync_point becomes the value of @@global.debug_dbug generating
# a newly started IO-slave thread's session value.
# Notice incremental operations to add and remove dbug_execute_if_name
# from the global variable allows propagation more dbug arguments
@@ -68,7 +68,7 @@ source include/wait_for_slave_io_error.inc;
# deactivate the sync point of get_master_version_and_clock()
# now to avoid restarting IO-thread to re-enter it.
-# There will be a new IO thread forked out with its @@session.debug
+# There will be a new IO thread forked out with its @@session.debug_dbug
# unset.
set @@global.debug_dbug= @old_dbug;
diff --git a/mysql-test/suite/rpl/include/rpl_gtid_index.inc b/mysql-test/suite/rpl/include/rpl_gtid_index.inc
new file mode 100644
index 00000000..262d43d0
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_gtid_index.inc
@@ -0,0 +1,187 @@
+# Include file for main test rpl.rpl_gtid_index.
+# Test GTID indexes with given parameters.
+#
+# Parameters:
+# $NUM_POS Number of GTIDs/binlog positions to create
+# $NUM_DOMAIN Number of different domains to use
+# $NUM_SERVER Number of different server_id to use
+# $NUM_SLAVE_CONNECTS How many GTID slave connect positions to test
+# $RND_SEED Random seed
+
+
+--echo *** Testing $NUM_POS GTIDs with $NUM_SLAVE_CONNECTS test connects
+
+--connection master
+DELETE FROM t1 WHERE a >= 1000;
+# Rotate binlogs to make new GTID index settings take effect.
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+
+# Prepare some random values, but deterministic between test runs.
+CREATE TABLE rand_data(idx INT PRIMARY KEY, domain_id INT, server_id INT)
+ ENGINE=InnoDB;
+INSERT INTO rand_data(idx, domain_id, server_id) VALUES (0, 0, 1);
+eval
+INSERT INTO rand_data(idx, domain_id, server_id)
+SELECT seq,
+ @tmp:=floor($NUM_DOMAIN*POW(rand($RND_SEED),2)),
+ 100 + $NUM_SERVER*@tmp + floor($NUM_SERVER*rand($RND_SEED))
+ FROM seq_1_to_$NUM_POS;
+# Let's check that the test data is deterministic.
+# If this changes due to some server changes, it's fine, the .result can just
+# be updated. But we want it to be identical between test runs on same code,
+# to facilitate debugging test failures.
+SELECT COUNT(*), SUM(domain_id), SUM(server_id) FROM rand_data;
+
+# Create some data for the binlog (and GTID index), recording the correct
+# binlog positions and GTIDs.
+CREATE TABLE gtid_data(
+ idx INT PRIMARY KEY,
+ gtid VARCHAR(44),
+ gtid_pos VARCHAR(255),
+ file VARCHAR(100),
+ pos INT,
+ row_count INT,
+ KEY(file, pos)) ENGINE=InnoDB;
+--let $gtid= `SELECT @@last_gtid`
+
+--source include/save_master_gtid.inc
+
+--connection slave
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+
+--connection master
+SET @orig_domain_id= @@gtid_domain_id;
+SET @orig_server_id= @@server_id;
+--let $i= 0
+--let $rotate_point= `SELECT floor($NUM_POS/2)`
+--let $base_count= `SELECT COUNT(*) FROM t1`
+--disable_query_log
+while ($i < $NUM_POS) {
+ --let $file= query_get_value(SHOW MASTER STATUS, File, 1)
+ --let $pos= query_get_value(SHOW MASTER STATUS, Position, 1)
+ --let $gtid_pos= `SELECT @@gtid_binlog_pos`
+ --let $row_count= `SELECT $base_count + $i`
+ eval SET gtid_domain_id= (SELECT domain_id FROM rand_data WHERE idx=$i+1);
+ eval SET server_id= (SELECT server_id FROM rand_data WHERE idx=$i+1);
+ BEGIN;
+ eval INSERT INTO gtid_data(idx, gtid, gtid_pos, file, pos, row_count)
+ VALUES ($i, '$gtid', '$gtid_pos', '$file', $pos, $row_count);
+ eval INSERT INTO t1 VALUES ($i + 1000, 0);
+ COMMIT;
+--let $gtid= `SELECT @@last_gtid`
+ inc $i;
+ if ($i==$rotate_point) {
+ FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+ }
+}
+--enable_query_log
+SET gtid_domain_id= @orig_domain_id;
+SET server_id= @orig_server_id;
+
+SELECT COUNT(*) FROM gtid_data;
+
+# Test that BINLOG_GTID_POS returns correct positions for every GTID position.
+--echo *** The result should be empty, otherwise some result is wrong:
+SELECT idx, gtid_pos, BINLOG_GTID_POS(file, pos)
+ FROM gtid_data
+ WHERE NOT gtid_eq(CONVERT(gtid_pos USING utf8),BINLOG_GTID_POS(file, pos))
+ ORDER BY idx;
+
+# Prepare to rewind the slave to this point to test again on same binlog.
+--connection slave
+SET @orig_pos= @@GLOBAL.gtid_slave_pos;
+SET @orig_t1_limit= (SELECT MAX(a) FROM t1);
+
+--echo *** Now connect the slave to each position in turn, and test that
+--echo *** the right amount of data is replicated at each point.
+--let $old_silent= $keep_include_silent
+--let $keep_include_silent= 1
+--let $i= 0
+--disable_query_log
+while ($i < $NUM_POS) {
+ --connection master
+ --let $gtid_pos= `SELECT gtid_pos FROM gtid_data WHERE idx=$i`
+ --let $master_count= `SELECT row_count FROM gtid_data WHERE idx=$i`
+ --connection slave
+ --disable_result_log
+ eval START SLAVE UNTIL master_gtid_pos='$gtid_pos';
+ --enable_result_log
+ --let $res= `SELECT MASTER_GTID_WAIT('$gtid_pos')`
+ if ($res != 0) {
+ --die "FAIL: MASTER_GTID_WAIT($gtid_pos) returned $res, should have been 0"
+ }
+ --source include/wait_for_slave_to_stop.inc
+ --let $slave_count = `SELECT COUNT(*) FROM t1`
+ if ($master_count != $slave_count) {
+ SELECT * FROM gtid_data ORDER BY file, pos;
+ SELECT * FROM t1 ORDER BY a;
+ --die "Not all rows replicated. $master_count on master but $slave_count on slave."
+ }
+ --let $i= `SELECT $i + ceil($NUM_POS / $NUM_SLAVE_CONNECTS)`
+}
+--enable_query_log
+
+--echo *** Test slave connecting to some GTID positions where the position in
+--echo *** the master's binlog is different between the different domains.
+--echo *** Revind the slave and test on the same binlog data from the master as before.
+--connection slave
+SET sql_log_bin= 0;
+TRUNCATE gtid_data;
+DELETE FROM t1 WHERE a > @orig_t1_limit;
+SET sql_log_bin= 1;
+SET GLOBAL gtid_slave_pos= @orig_pos;
+
+--let $i= 0
+--disable_query_log
+while ($i <= $NUM_DOMAIN) {
+ # Build a GTID position from GTIDs that are picked at different locations
+ # in the gtid_data table for each domain.
+ --connection master
+ let $until_pos=`
+ SELECT GROUP_CONCAT(gtid SEPARATOR ',')
+ FROM gtid_data
+ WHERE idx IN (
+ SELECT MAX(gtid_data.idx) AS pick
+ FROM gtid_data
+ INNER JOIN rand_data ON (rand_data.idx = gtid_data.idx)
+ WHERE gtid_data.idx*$NUM_DOMAIN <= (domain_id + $i)*$NUM_POS
+ GROUP BY domain_id
+ )`;
+ --connection slave
+ --disable_result_log
+ eval START SLAVE UNTIL master_gtid_pos='$until_pos';
+ --enable_result_log
+ --let $res= `SELECT MASTER_GTID_WAIT('$until_pos')`
+ if ($res != 0) {
+ --die "FAIL: MASTER_GTID_WAIT($until_pos) returned $res, should have been 0"
+ }
+ --source include/wait_for_slave_to_stop.inc
+
+ inc $i;
+}
+--enable_query_log
+--let $keep_include_silent= $old_silent
+
+# Check that everything was replicated (nothing skipped).
+# We have one less row on the slave since the last UNTIL is the one before
+# the master inserted the last row.
+--connection master
+--let $master_count= `SELECT COUNT(*)-1 FROM t1`
+--connection slave
+--let $slave_count= `SELECT COUNT(*) FROM t1`
+if ($master_count != $slave_count) {
+ SELECT * FROM gtid_data ORDER BY file, pos;
+ SELECT * FROM t1 ORDER BY a;
+ --die "Not all rows replicated. $master_count on master but $slave_count on slave."
+}
+
+--connection master
+DROP TABLE gtid_data, rand_data;
+--source include/save_master_gtid.inc
+
+--connection slave
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+--connection master
diff --git a/mysql-test/suite/rpl/include/rpl_gtid_until_before_after_gtids.test b/mysql-test/suite/rpl/include/rpl_gtid_until_before_after_gtids.test
new file mode 100644
index 00000000..4f907d0b
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_gtid_until_before_after_gtids.test
@@ -0,0 +1,375 @@
+#
+# Helper file to run through test cases to validate that the replica will stop
+# at the correct place when running STOP SLAVE UNTIL with options
+# SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS.
+#
+# MTR Parameters:
+# ssu_before_gtids (Boolean): Indicates whether to test SQL_BEFORE_GTIDS,
+# (when true), or SQL_AFTER_GTIDS (when false).
+#
+
+--let $include_filename= rpl_gtid_until_before_after_gtids.inc
+--source include/begin_include_file.inc
+
+if ($ssu_before_gtids)
+{
+ --let $ssu_opt=SQL_BEFORE_GTIDS
+}
+if (!$ssu_before_gtids)
+{
+ --let $ssu_opt=SQL_AFTER_GTIDS
+}
+
+--echo #
+--echo # Test Setup ($ssu_opt)
+
+--echo # Clean primary and replica states
+--connection master
+--source include/save_master_gtid.inc
+--connection slave
+--source include/stop_slave.inc
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+--source include/reset_slave.inc
+--connection master
+RESET MASTER;
+set session gtid_domain_id=0;
+
+--echo # Initialize test data
+--connection master
+create table t1 (a int);
+create table t2 (a int);
+
+# Set the value counters to use on insertions. Note they are only set once per
+# test, subsequent invocations of this .inc file continue to increment the
+# previous values.
+if (!$t1_ctr)
+{
+ --let $t1_ctr= 100
+ --let $t2_ctr= 200
+}
+
+--source include/save_master_gtid.inc
+
+--connection slave
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+
+--echo #
+--echo # Test Case 1 ($ssu_opt): For a single-dimensional binlog state and a
+--echo # STOP SLAVE UNTIL gtid position with one GTID, the replica should
+if ($ssu_before_gtids)
+{
+--echo # execute events up until the GTID is encountered, and immediately stop
+}
+if (!$ssu_before_gtids)
+{
+--echo # execute events up until the GTID is encountered, finish replicating
+--echo # that event group, and then stop
+}
+
+--connection slave
+--source include/stop_slave.inc
+--let $initial_slave_pos= query_get_value(SHOW ALL SLAVES STATUS, Exec_Master_Log_Pos, 1)
+
+--connection master
+set session gtid_domain_id=0;
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+if ($ssu_before_gtids)
+{
+ --let $expected_stop_gtid= `SELECT @@gtid_binlog_pos`
+}
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+--let $until_gtid= `SELECT @@gtid_binlog_pos`
+if (!$ssu_before_gtids)
+{
+ --let $expected_stop_gtid= `SELECT @@gtid_binlog_pos`
+}
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+
+--connection slave
+--eval START SLAVE UNTIL $ssu_opt="$until_gtid"
+
+--echo # Ensure the slave started
+--let $slave_param= Exec_Master_Log_Pos
+--let $slave_param_comparison= !=
+--let $slave_param_value= $initial_slave_pos
+--source include/wait_for_slave_param.inc
+--let $slave_param_comparison= =
+
+--source include/wait_for_slave_to_stop.inc
+--let $actual_stop_gtid= `SELECT @@gtid_slave_pos`
+
+if (`SELECT strcmp("$expected_stop_gtid","$actual_stop_gtid") != 0`)
+{
+ --echo # Expected stop gtid != actual stop gtid ($expected_stop_gtid != $actual_stop_gtid)
+ --die Expected stop gtid != actual stop gtid
+}
+
+--echo # Clean replica state
+--connection master
+--source include/save_master_gtid.inc
+--connection slave
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+
+--echo #
+--echo # Test Case 2 ($ssu_opt): If a provided until GTID doesn't exist in the
+--echo # binary log due to a gap, once an event is seen that is beyond the
+--echo # until GTID, the slave should immediately stop. Note the behavior of
+--echo # this test case should be the same between SQL_BEFORE_GTIDS and
+--echo # SQL_AFTER_GTIDS.
+
+--connection slave
+--let $initial_slave_pos= query_get_value(SHOW ALL SLAVES STATUS, Exec_Master_Log_Pos, 1)
+--source include/stop_slave.inc
+
+--connection master
+set session gtid_domain_id=0;
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+
+
+--echo # Skip a seq_no
+--let $binlog_pos= `SELECT @@gtid_binlog_pos`
+--let $domain_id= `SELECT @@gtid_domain_id`
+--let $server_id= `SELECT @@server_id`
+--let $last_seq_no= `SELECT REGEXP_SUBSTR('$binlog_pos','[0-9]+\\\$')`
+
+--let $skipped_seq_no= `SELECT ($last_seq_no + 1)`
+--let $new_seq_no= `SELECT ($skipped_seq_no + 1)`
+--eval set @@session.gtid_seq_no= $new_seq_no
+
+--let $until_gtid= $domain_id-$server_id-$skipped_seq_no
+--let $expected_stop_gtid= $binlog_pos
+
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+
+--connection slave
+--eval START SLAVE UNTIL $ssu_opt="$until_gtid"
+
+--echo # Ensure the slave started
+--let $slave_param= Exec_Master_Log_Pos
+--let $slave_param_comparison= !=
+--let $slave_param_value= $initial_slave_pos
+--source include/wait_for_slave_param.inc
+--let $slave_param_comparison= =
+
+--source include/wait_for_slave_to_stop.inc
+--let $actual_stop_gtid= `SELECT @@gtid_slave_pos`
+
+if (`SELECT strcmp("$expected_stop_gtid","$actual_stop_gtid") != 0`)
+{
+ --echo # Expected stop gtid != actual stop gtid ($expected_stop_gtid != $actual_stop_gtid)
+ --die Expected stop gtid != actual stop gtid
+}
+
+--connection slave
+--source include/start_slave.inc
+--connection master
+--sync_slave_with_master
+
+
+--echo #
+--echo # Test Case 3 ($ssu_opt): For a multi-dimensional binlog state and a
+--echo # STOP SLAVE UNTIL gtid position with one GTID, the replica should
+--echo # execute events from only the specified domain until the provided GTID
+if ($ssu_before_gtids)
+{
+--echo # is encountered, and immediately stop
+}
+if (!$ssu_before_gtids)
+{
+--echo # is encountered, finish replicating that event group, and then stop
+}
+
+--connection slave
+--source include/stop_slave.inc
+--let $initial_slave_pos= query_get_value(SHOW ALL SLAVES STATUS, Exec_Master_Log_Pos, 1)
+
+--connection master
+set session gtid_domain_id=0;
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+
+set session gtid_domain_id=1;
+--eval INSERT INTO t2 VALUES ($t2_ctr)
+--inc $t2_ctr
+--eval INSERT INTO t2 VALUES ($t2_ctr)
+--inc $t2_ctr
+
+if ($ssu_before_gtids)
+{
+ # Will have GTIDs for both domains 0 and 1
+ --let $binlog_pos= `SELECT @@gtid_binlog_pos`
+ --let $expected_stop_gtid= `SELECT REGEXP_SUBSTR('$binlog_pos','0-[0-9]+-[0-9]+')`
+}
+
+set session gtid_domain_id=0;
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+
+--let $binlog_pos= `SELECT @@gtid_binlog_pos`
+
+# Just the GTID for domain 0
+--let $until_gtid= `SELECT REGEXP_SUBSTR('$binlog_pos','0-[0-9]+-[0-9]+')`
+
+if (!$ssu_before_gtids)
+{
+ --let $expected_stop_gtid= $until_gtid
+}
+
+set session gtid_domain_id=1;
+--eval INSERT INTO t2 VALUES ($t2_ctr)
+--inc $t2_ctr
+set session gtid_domain_id=0;
+
+--connection slave
+--eval START SLAVE UNTIL $ssu_opt="$until_gtid"
+
+--echo # Ensure the slave started
+--let $slave_param= Exec_Master_Log_Pos
+--let $slave_param_comparison= !=
+--let $slave_param_value= $initial_slave_pos
+--source include/wait_for_slave_param.inc
+--let $slave_param_comparison= =
+
+--source include/wait_for_slave_to_stop.inc
+--let $actual_stop_gtid= `SELECT @@gtid_slave_pos`
+
+if (`SELECT strcmp("$expected_stop_gtid","$actual_stop_gtid") != 0`)
+{
+ --echo # Expected stop gtid != actual stop gtid ($expected_stop_gtid != $actual_stop_gtid)
+ --die Expected stop gtid != actual stop gtid
+}
+
+--connection slave
+--source include/start_slave.inc
+--connection master
+--sync_slave_with_master
+
+
+--echo #
+--echo # Test Case 4 ($ssu_opt): For a multi-dimensional binlog state and a
+--echo # STOP SLAVE UNTIL gtid position with multiple GTIDs, the replica should
+if ($ssu_before_gtids)
+{
+--echo # for each domain, execute events only up until its provided GTID, and
+--echo # once all domains have hit their end point, immediately stop.
+}
+if (!$ssu_before_gtids)
+{
+--echo # stop executing events as soon as all listed GTIDs in the UNTIL list
+--echo # have been executed.
+}
+
+--connection slave
+--source include/stop_slave.inc
+--let $initial_slave_pos= query_get_value(SHOW ALL SLAVES STATUS, Exec_Master_Log_Pos, 1)
+
+--connection master
+--eval SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+
+if ($ssu_before_gtids)
+{
+ # Save binlog pos for domain 0
+ --let $expected_stop_gtid_d0= `SELECT REGEXP_SUBSTR(@@global.gtid_binlog_pos,'0-[0-9]+-[0-9]+')`
+ --echo # Tagging domain 0 stop: $expected_stop_gtid_d0
+}
+
+--eval SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+
+--eval SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES ($t2_ctr)
+--inc $t2_ctr
+
+if ($ssu_before_gtids)
+{
+ # Save binlog pos for domain 1
+ --let $expected_stop_gtid_d1= `SELECT REGEXP_SUBSTR(@@global.gtid_binlog_pos,'1-[0-9]+-[0-9]+')`
+ --let $expected_stop_gtid= $expected_stop_gtid_d0,$expected_stop_gtid_d1
+}
+
+--eval SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES ($t2_ctr)
+--inc $t2_ctr
+
+--let $until_gtid= `SELECT @@gtid_binlog_pos`
+if (!$ssu_before_gtids)
+{
+ --let $expected_stop_gtid= $until_gtid
+}
+
+--eval SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+--eval SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES ($t2_ctr)
+--inc $t2_ctr
+
+--connection slave
+--eval START SLAVE UNTIL $ssu_opt="$until_gtid"
+
+--echo # Ensure the slave started
+--let $slave_param= Exec_Master_Log_Pos
+--let $slave_param_comparison= !=
+--let $slave_param_value= $initial_slave_pos
+--source include/wait_for_slave_param.inc
+--let $slave_param_comparison= =
+
+--source include/wait_for_slave_to_stop.inc
+--let $actual_stop_gtid= `SELECT @@gtid_slave_pos`
+
+if (`SELECT strcmp("$expected_stop_gtid","$actual_stop_gtid") != 0`)
+{
+ --echo # Expected stop gtid != actual stop gtid ($expected_stop_gtid != $actual_stop_gtid)
+ --die Expected stop gtid != actual stop gtid
+}
+
+--connection slave
+--source include/start_slave.inc
+--connection master
+--sync_slave_with_master
+
+
+--echo #
+--echo # Error Case 1: Not providing a valid GTID should result in a syntax
+--echo # error
+
+--connection slave
+--source include/stop_slave.inc
+
+--error ER_INCORRECT_GTID_STATE
+--eval START SLAVE UNTIL $ssu_opt="a"
+
+--error ER_INCORRECT_GTID_STATE
+--eval START SLAVE UNTIL $ssu_opt="0"
+
+--error ER_INCORRECT_GTID_STATE
+--eval START SLAVE UNTIL $ssu_opt="0-1"
+
+--error ER_INCORRECT_GTID_STATE
+--eval START SLAVE UNTIL $ssu_opt="0-1-"
+
+--error ER_INCORRECT_GTID_STATE
+--eval START SLAVE UNTIL $ssu_opt="a-b-c"
+
+--source include/start_slave.inc
+
+--echo #
+--echo # Cleanup test data
+--connection master
+DROP TABLE t1, t2;
+--source include/save_master_gtid.inc
+--connection slave
+--source include/sync_with_master_gtid.inc
+
+--let $include_filename= rpl_gtid_until_before_after_gtids.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/suite/rpl/include/rpl_row_blob.test b/mysql-test/suite/rpl/include/rpl_row_blob.test
index 5cd7b6b4..408a2351 100644
--- a/mysql-test/suite/rpl/include/rpl_row_blob.test
+++ b/mysql-test/suite/rpl/include/rpl_row_blob.test
@@ -173,3 +173,21 @@ DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
# ensure cleanup on slave as well:
--sync_slave_with_master
+
+--echo #
+--echo # MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types
+--echo #
+--connection master
+CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt));
+INSERT INTO t () VALUES (),(),();
+DELETE FROM t;
+
+DROP TABLE t;
+--sync_slave_with_master
+--connection master
+CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt) STORED);
+INSERT INTO t () VALUES (),(),();
+DELETE FROM t;
+
+DROP TABLE t;
+--sync_slave_with_master