Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions mysql-test/suite/galera_sr/t/mysql-wsrep-features#8.test
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ CREATE TABLE t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f

--connection node_2
--let $wait_condition = SELECT COUNT(*) = 13 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name LIKE 'test/%'
--let $wait_condition_on_error_output =
--source include/wait_condition.inc
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To maintain consistency with the other improvements in this PR and provide better diagnostic information upon failure, consider using wait_condition_with_debug.inc here as well.

--let $wait_condition_on_error_output = SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name LIKE 'test/%'
--source include/wait_condition_with_debug.inc


SELECT COUNT(*) AS EXPECT_13 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name LIKE 'test/%';
Expand All @@ -33,15 +32,17 @@ INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3, ten

--connection node_2
--let $wait_condition = SELECT COUNT(*) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz')
--source include/wait_condition.inc
--let $wait_condition_on_error_output = SELECT COUNT(*) FROM t1
--source include/wait_condition_with_debug.inc

SELECT COUNT(f2) AS EXPECT_10000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz');

UPDATE t1 SET f2 = 'abcdefjhk';

--connection node_1
--let $wait_condition = SELECT COUNT(*) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk')
--source include/wait_condition.inc
--let $wait_condition_on_error_output = SELECT COUNT(*) FROM t1
--source include/wait_condition_with_debug.inc

SELECT COUNT(f2) AS EXPECT_10000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk');

Expand All @@ -68,16 +69,19 @@ INSERT INTO t1 (f1) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3;

--connection node_1
--let $wait_condition = SELECT COUNT(*) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('foobarbaz')
--source include/wait_condition.inc
--let $wait_condition_on_error_output = SELECT * FROM t1
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using SELECT * FROM t1 as debug output for a table with 1000 rows can lead to excessive log output in case of test failure. It is generally better to use SELECT COUNT(*) to diagnose the failure, which is also consistent with the approach used in other parts of this test file (e.g., line 35 and 44).

--let $wait_condition_on_error_output = SELECT COUNT(*) FROM t1

--source include/wait_condition_with_debug.inc

SELECT COUNT(f1) AS EXPECT_1000 FROM t1 WHERE MATCH(f1) AGAINST ('foobarbaz');

UPDATE t1 SET f1 = 'abcdefjhk';

SELECT COUNT(f1) AS EXPECT_1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk');

--connection node_2
--let $wait_condition = SELECT COUNT(*) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk')
--source include/wait_condition.inc
--let $wait_condition_on_error_output = SELECT * FROM t1
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using SELECT * FROM t1 as debug output for a table with 1000 rows can lead to excessive log output. For debugging a failed count condition, SELECT COUNT(*) is usually sufficient and much cleaner in the logs.

--let $wait_condition_on_error_output = SELECT COUNT(*) FROM t1

--source include/wait_condition_with_debug.inc

SELECT COUNT(f1) AS EXPECT_1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk');

Expand Down
Loading