403Webshell
Server IP : 88.99.149.37  /  Your IP : 216.73.216.141
Web Server : nginx/1.31.2
System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64
User : muralimurth ( 1015)
PHP Version : 8.4.23
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/mysql/mysql-test/suite/galera/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/mysql/mysql-test/suite/galera/t/galera_var_max_ws_rows.test
--source include/galera_cluster.inc
--source include/have_innodb.inc

CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);

CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;

--let $wsrep_max_ws_rows_orig = `SELECT @@wsrep_max_ws_rows`
SET GLOBAL wsrep_max_ws_rows = 4;

# Test that wsrep_max_ws_rows is enforced with multi statement transactions

START TRANSACTION;
INSERT INTO t1 (f2) VALUES (1);
INSERT INTO t1 (f2) VALUES (2);
INSERT INTO t1 (f2) VALUES (3);
INSERT INTO t1 (f2) VALUES (4);
--error ER_ERROR_DURING_COMMIT
INSERT INTO t1 (f2) VALUES (5);
COMMIT;
SELECT COUNT(*) = 0 FROM t1;

START TRANSACTION;
INSERT INTO t1 (f2) VALUES (1);
INSERT INTO t1 (f2) VALUES (2);
INSERT INTO t1 (f2) VALUES (3);
INSERT INTO t1 (f2) VALUES (4);
--error ER_ERROR_DURING_COMMIT
UPDATE t1 SET f2 = 10 WHERE f2 = 4;
COMMIT;
SELECT COUNT(*) = 0 FROM t1;

START TRANSACTION;
INSERT INTO t1 (f2) VALUES (1);
INSERT INTO t1 (f2) VALUES (2);
INSERT INTO t1 (f2) VALUES (3);
INSERT INTO t1 (f2) VALUES (4);
--error ER_ERROR_DURING_COMMIT
DELETE FROM t1 WHERE f2 = 1;
COMMIT;
SELECT COUNT(*) = 0 FROM t1;


# Test that wsrep_max_ws_rows is enforced on sigle statements

SET GLOBAL wsrep_max_ws_rows = 5;
INSERT INTO t1 (f2) VALUES (1),(2),(3),(4),(5);
SET GLOBAL wsrep_max_ws_rows = 4;

--error ER_ERROR_DURING_COMMIT
UPDATE t1 SET f2 = f2 + 10;
SELECT COUNT(*) = 5 FROM t1;

--error ER_ERROR_DURING_COMMIT
DELETE FROM t1 WHERE f2 < 10;
SELECT COUNT(*) = 5 FROM t1;

--error ER_ERROR_DURING_COMMIT
INSERT INTO t1 (f2) SELECT * FROM ten;
SELECT COUNT(*) = 5 FROM t1;

--error ER_ERROR_DURING_COMMIT
INSERT INTO t1 (f2) VALUES (10),(20),(30),(40),(50);
SELECT COUNT(*) = 5 FROM t1;

# Fewer than wsrep_max_ws_rows is OK

SET GLOBAL wsrep_max_ws_rows = 10;
DELETE FROM t1 WHERE f2 < 10;
SELECT COUNT(*) = 0 FROM t1;

# Test a series of transactions

--disable_query_log
SET GLOBAL wsrep_max_ws_rows = 5;
let $i= 100;
while ($i)
{
        START TRANSACTION;
        --eval INSERT INTO t1 (f2) VALUES ($i);
        COMMIT;
        dec $i;
}
--enable_query_log
SET GLOBAL wsrep_max_ws_rows = 100;
SELECT COUNT(*) = 100 FROM t1;
DELETE FROM t1 WHERE f2 < 101;
SELECT COUNT(*) = 0 FROM t1;

# Test large statements

SET GLOBAL wsrep_max_ws_rows = 9999;
--error ER_ERROR_DURING_COMMIT
INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
SET GLOBAL wsrep_max_ws_rows = 10000;
INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;

SET GLOBAL wsrep_max_ws_rows = 9999;
--error ER_ERROR_DURING_COMMIT
UPDATE t1 SET f2 = 2 WHERE f2 = 1;
SET GLOBAL wsrep_max_ws_rows = 10000;
UPDATE t1 SET f2 = 2 WHERE f2 = 1;

SET GLOBAL wsrep_max_ws_rows = 9999;
--error ER_ERROR_DURING_COMMIT
DELETE FROM t1 WHERE f2 = 2;
SET GLOBAL wsrep_max_ws_rows = 10000;
DELETE FROM t1 WHERE f2 = 2;

SELECT COUNT(*) = 0 FROM t1;


# Test that wsrep_max_ws_rows is reset when switching autocommit mode

SET AUTOCOMMIT = ON;
SET GLOBAL wsrep_max_ws_rows = 1;

START TRANSACTION;
INSERT INTO t1 (f2) VALUES (1);
--error ER_ERROR_DURING_COMMIT
INSERT INTO t1 (f2) VALUES (2);

INSERT INTO t1 (f2) VALUES (1);
INSERT INTO t1 (f2) VALUES (2);


SET AUTOCOMMIT = OFF;
START TRANSACTION;
INSERT INTO t1 (f2) VALUES (1);
--error ER_ERROR_DURING_COMMIT
INSERT INTO t1 (f2) VALUES (2);

INSERT INTO t1 (f2) VALUES (1);
--error ER_ERROR_DURING_COMMIT
INSERT INTO t1 (f2) VALUES (2);


# Test that wsrep_max_ws_rows is reset on implicit commits

START TRANSACTION;
INSERT INTO t1 (f2) VALUES (1);

START TRANSACTION;
INSERT INTO t1 (f2) VALUES (1);
--error ER_ERROR_DURING_COMMIT
INSERT INTO t1 (f2) VALUES (2);

DROP TABLE t1;
DROP TABLE ten;

--echo #
--echo # MDEV-11817: Altering a table with more rows than
--echo # wsrep_max_ws_rows causes cluster to break when running
--echo # Galera cluster in TOI mode
--echo #
--connection node_1
CREATE TABLE t1(c1 INT)ENGINE = INNODB;
SET GLOBAL wsrep_max_ws_rows= DEFAULT;
INSERT INTO t1 VALUES(1);
INSERT INTO t1 SELECT * FROM t1;
COMMIT;
SET GLOBAL wsrep_max_ws_rows= 1;
ALTER TABLE t1 CHANGE COLUMN c1 c1 BIGINT;

--connection node_2
SHOW CREATE TABLE t1;
SELECT COUNT(*) FROM t1;
DROP TABLE t1;

--connection node_1

--disable_query_log
--eval SET GLOBAL wsrep_max_ws_rows = $wsrep_max_ws_rows_orig
--enable_query_log

--source include/galera_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit