1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00
Files
mariadb/mysql-test/suite/sys_vars/t/replicate_do_table_basic.test
ParadoxV5 aaa02f6aa3 MDEV-35693: Improve SHOW REPLICA STATUS column sizes
Resize the types and widths of SHOW REPLICA STATUS
(technically `INFORMATION_SCHEMA.SLAVE_STATUS`)
columns to better match their possible values

In case of intentionally but absurdly long lists,
text columns that list an uncapped number of elements
have expanded to accept as many bytes as we could support.

Particularly, the first-gen `Replicate_` filters were
incorrectly typed as singlular `Name()`s during MDEV-33526.
Under `Name`s’ 64-char limit, they could overflow
(read: truncate) even before their lengths got absurd.

In response to `‘MAX_SLAVE_ERRMSG’ was not declared in this scope` in
Embedded builds, a new `#ifdef HAVE_REPLICATION` guard wraps
`slave_status_info` to skip this unused data in Replication-less builds.

For testing, this commit forward-ports a modified cherry-pick of #3795
(the latter targets our oldest maintained LTS as part of MDEV-35948).

> Assert that 1st-gen `replicate_*` filter variables display
> their input – including long but reasonable lists –
> correctly (without truncation) in
> * direct SELECT
> * [semi-new] INFORMATION_SCHEMA.GLOBAL_VARIABLES.VARIABLE_VALUE
> * [new] SHOW REPLICA STATUS

Reviewed-by: Brandon Nesterenko <brandon.nesterenko@mariadb.com>
2025-01-31 20:56:41 -07:00

68 lines
2.0 KiB
Plaintext

--source include/have_sequence.inc
# have show_slave_status
--source include/not_embedded.inc
CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
--let $status_items= Replicate_Do_Table
--echo #
--echo # Basic testing of replicate_do_table.
--echo #
SET @save_replicate_do_table = @@GLOBAL.replicate_do_table;
SELECT @save_replicate_do_table;
--echo # Scope.
--error ER_GLOBAL_VARIABLE
SET @@SESSION.replicate_do_table = "";
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@SESSION.replicate_do_table;
--echo # Incorrect type.
--error ER_WRONG_TYPE_FOR_VAR
SET @@GLOBAL.replicate_do_table=1;
--error ER_WRONG_TYPE_FOR_VAR
SET @@GLOBAL.replicate_do_table=1.1;
--error ER_WRONG_TYPE_FOR_VAR
SET @@GLOBAL.replicate_do_table=1e1;
--echo # Incorrect arguments.
--error ER_WRONG_ARGUMENTS
SET @@GLOBAL.replicate_do_table="t1";
--error ER_WRONG_ARGUMENTS
SET @@GLOBAL.replicate_do_table="test.t1, t2";
--error ER_WRONG_ARGUMENTS
SET @@GLOBAL.replicate_do_table="test.,t1";
# MDEV-35693 Replicate_* fields of Show-Slave-Status display truncated
--echo # Argument size acceptance.
SELECT GROUP_CONCAT(CONCAT("database_name.long_table_name_", seq) SEPARATOR ",")
INTO @name FROM seq_1_to_8;
SELECT LENGTH(@name);
SET @@GLOBAL.replicate_do_table= @name;
SELECT @@GLOBAL.replicate_do_table;
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='replicate_do_table';
--source include/show_slave_status.inc
--echo # Argument syntax.
SET @@GLOBAL.replicate_do_table="test.t1,,,,,test.t3";
SELECT @@GLOBAL.replicate_do_table;
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='replicate_do_table';
--source include/show_slave_status.inc
SET @@GLOBAL.replicate_do_table="test.t1,,,test2.t2,,,test.t3";
SELECT @@GLOBAL.replicate_do_table;
SET @@GLOBAL.replicate_do_table="";
SELECT @@GLOBAL.replicate_do_table;
SET @@GLOBAL.replicate_do_table=null;
SELECT @@GLOBAL.replicate_do_table;
--echo # Cleanup.
SET @@GLOBAL.replicate_do_table = @save_replicate_do_table;