Commit ead61d9b authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-32874 Test innodb.innodb-table-online,crypt occasionally fails

Let us make the test compatible with ./mtr --repeat
and convert variable_value to integer, so that comparisons like
16>9 will work as intended, instead of being compared as '16'<'9'.
parent 69d294e7
SET GLOBAL innodb_monitor_reset_all=all;
SET GLOBAL innodb_monitor_reset_all=default;
call mtr.add_suppression("InnoDB: Warning: Small buffer pool size"); call mtr.add_suppression("InnoDB: Warning: Small buffer pool size");
call mtr.add_suppression("InnoDB: Error: table 'test/t1'"); call mtr.add_suppression("InnoDB: Error: table 'test/t1'");
call mtr.add_suppression("MySQL is trying to open a table handle but the .ibd file for"); call mtr.add_suppression("MySQL is trying to open a table handle but the .ibd file for");
...@@ -185,13 +187,13 @@ Table Op Msg_type Msg_text ...@@ -185,13 +187,13 @@ Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK test.t1 analyze status OK
SET @merge_encrypt_0= SET @merge_encrypt_0=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_0= SET @merge_decrypt_0=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_0= SET @rowlog_encrypt_0=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
connection con1; connection con1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
...@@ -253,13 +255,13 @@ ddl_pending_alter_table 1 ...@@ -253,13 +255,13 @@ ddl_pending_alter_table 1
ddl_sort_file_alter_table 0 ddl_sort_file_alter_table 0
ddl_log_file_alter_table 1 ddl_log_file_alter_table 1
SET @merge_encrypt_1= SET @merge_encrypt_1=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_1= SET @merge_decrypt_1=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_1= SET @rowlog_encrypt_1=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SELECT SELECT
(@merge_encrypt_1-@merge_encrypt_0)- (@merge_encrypt_1-@merge_encrypt_0)-
...@@ -280,16 +282,16 @@ ddl_pending_alter_table 0 ...@@ -280,16 +282,16 @@ ddl_pending_alter_table 0
ddl_sort_file_alter_table 0 ddl_sort_file_alter_table 0
ddl_log_file_alter_table 1 ddl_log_file_alter_table 1
SET @merge_encrypt_1= SET @merge_encrypt_1=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_1= SET @merge_decrypt_1=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_1= SET @rowlog_encrypt_1=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SET @rowlog_decrypt_1= SET @rowlog_decrypt_1=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted'); WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt3 WAIT_FOR dml3_done'; SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuilt3 WAIT_FOR dml3_done';
ALTER TABLE t1 ADD PRIMARY KEY(c22f), CHANGE c2 c22f INT; ALTER TABLE t1 ADD PRIMARY KEY(c22f), CHANGE c2 c22f INT;
...@@ -342,16 +344,16 @@ CHECK TABLE t1; ...@@ -342,16 +344,16 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
SET @merge_encrypt_2= SET @merge_encrypt_2=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_2= SET @merge_decrypt_2=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_2= SET @rowlog_encrypt_2=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SET @rowlog_decrypt_2= SET @rowlog_decrypt_2=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted'); WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
SELECT SELECT
(@merge_encrypt_2-@merge_encrypt_1)- (@merge_encrypt_2-@merge_encrypt_1)-
......
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
--source include/have_debug.inc --source include/have_debug.inc
--source include/have_debug_sync.inc --source include/have_debug_sync.inc
SET GLOBAL innodb_monitor_reset_all=all;
--disable_warnings
SET GLOBAL innodb_monitor_reset_all=default;
--enable_warnings
let $innodb_metrics_select= let $innodb_metrics_select=
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl'; SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
...@@ -171,13 +175,13 @@ EXPLAIN SELECT COUNT(*) FROM t1 WHERE c2 > 3; ...@@ -171,13 +175,13 @@ EXPLAIN SELECT COUNT(*) FROM t1 WHERE c2 > 3;
ANALYZE TABLE t1; ANALYZE TABLE t1;
SET @merge_encrypt_0= SET @merge_encrypt_0=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_0= SET @merge_decrypt_0=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_0= SET @rowlog_encrypt_0=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
connection con1; connection con1;
...@@ -222,13 +226,13 @@ while ($c) ...@@ -222,13 +226,13 @@ while ($c)
eval $innodb_metrics_select; eval $innodb_metrics_select;
SET @merge_encrypt_1= SET @merge_encrypt_1=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_1= SET @merge_decrypt_1=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_1= SET @rowlog_encrypt_1=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SELECT SELECT
...@@ -250,16 +254,16 @@ reap; ...@@ -250,16 +254,16 @@ reap;
eval $innodb_metrics_select; eval $innodb_metrics_select;
SET @merge_encrypt_1= SET @merge_encrypt_1=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_1= SET @merge_decrypt_1=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_1= SET @rowlog_encrypt_1=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SET @rowlog_decrypt_1= SET @rowlog_decrypt_1=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted'); WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
# Accumulate and apply some modification log. # Accumulate and apply some modification log.
...@@ -296,16 +300,16 @@ SELECT COUNT(c22f) FROM t1; ...@@ -296,16 +300,16 @@ SELECT COUNT(c22f) FROM t1;
CHECK TABLE t1; CHECK TABLE t1;
SET @merge_encrypt_2= SET @merge_encrypt_2=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_encrypted');
SET @merge_decrypt_2= SET @merge_decrypt_2=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted'); WHERE variable_name = 'innodb_encryption_n_merge_blocks_decrypted');
SET @rowlog_encrypt_2= SET @rowlog_encrypt_2=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted'); WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_encrypted');
SET @rowlog_decrypt_2= SET @rowlog_decrypt_2=
(SELECT variable_value FROM information_schema.global_status (SELECT CAST(variable_value AS INTEGER) FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted'); WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
SELECT SELECT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment