diff options
author | Bjorn Munch <bjorn.munch@oracle.com> | 2010-12-20 15:15:01 +0100 |
---|---|---|
committer | Bjorn Munch <bjorn.munch@oracle.com> | 2010-12-20 15:15:01 +0100 |
commit | 004ae40bc051d4345e3267456af09cce3dd5d6f8 (patch) | |
tree | 115fdfba52045ba9a47ec7b397fb5ee4a7b5db4b | |
parent | dd4c094652ef907af66704a4b02ed26ae1a79986 (diff) | |
parent | f38e7844a28dcf8a2cc4995b45c68c2fd8544f72 (diff) | |
download | mariadb-git-004ae40bc051d4345e3267456af09cce3dd5d6f8.tar.gz |
Some if simplifications in tests
-rw-r--r-- | mysql-test/extra/rpl_tests/rpl_stop_slave.test | 2 | ||||
-rw-r--r-- | mysql-test/include/check_ftwrl_compatible.inc | 8 | ||||
-rw-r--r-- | mysql-test/include/check_ftwrl_incompatible.inc | 14 | ||||
-rw-r--r-- | mysql-test/include/check_slave_param.inc | 2 | ||||
-rw-r--r-- | mysql-test/include/diff_tables.inc | 2 | ||||
-rw-r--r-- | mysql-test/include/rpl_change_topology.inc | 9 | ||||
-rw-r--r-- | mysql-test/include/rpl_connect.inc | 2 | ||||
-rw-r--r-- | mysql-test/include/rpl_diff.inc | 2 | ||||
-rw-r--r-- | mysql-test/include/rpl_end.inc | 2 | ||||
-rw-r--r-- | mysql-test/include/rpl_init.inc | 8 | ||||
-rw-r--r-- | mysql-test/include/show_slave_status.inc | 4 | ||||
-rw-r--r-- | mysql-test/include/sync_slave_io_with_master.inc | 2 | ||||
-rw-r--r-- | mysql-test/include/wait_for_binlog_event.inc | 2 | ||||
-rw-r--r-- | mysql-test/include/wait_for_slave_param.inc | 4 | ||||
-rw-r--r-- | mysql-test/include/write_var_to_file.inc | 4 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb_bug42419.test | 2 |
16 files changed, 33 insertions, 36 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_stop_slave.test b/mysql-test/extra/rpl_tests/rpl_stop_slave.test index 31b180f7131..64e69cebc32 100644 --- a/mysql-test/extra/rpl_tests/rpl_stop_slave.test +++ b/mysql-test/extra/rpl_tests/rpl_stop_slave.test @@ -9,7 +9,7 @@ # --source extra/rpl_tests/rpl_stop_slave.test # -if (`SELECT "$tmp_table_stm" = ''`) +if (!$tmp_table_stm) { --echo \$tmp_table_stm is NULL --die $tmp_table_stm is NULL diff --git a/mysql-test/include/check_ftwrl_compatible.inc b/mysql-test/include/check_ftwrl_compatible.inc index 76c1915957c..200f8cd3d8a 100644 --- a/mysql-test/include/check_ftwrl_compatible.inc +++ b/mysql-test/include/check_ftwrl_compatible.inc @@ -34,7 +34,7 @@ if (!$err) { --echo Success: Was able to run '$statement' under FTWRL. unlock tables; -if (`SELECT "$cleanup_stmt" <> ""`) +if ($cleanup_stmt) { --eval $cleanup_stmt; } @@ -91,12 +91,12 @@ connection default; --reap } -if (`SELECT "$cleanup_stmt" <> ""`) +if ($cleanup_stmt) { --eval $cleanup_stmt; } -if (`SELECT "$skip_3rd_check" = ""`) +if (!$skip_3rd_check) { # # Finally, let us check that FTWRL will succeed if this statement @@ -147,7 +147,7 @@ connection default; } set debug_sync= "RESET"; -if (`SELECT "$cleanup_stmt" <> ""`) +if ($cleanup_stmt) { --eval $cleanup_stmt; } diff --git a/mysql-test/include/check_ftwrl_incompatible.inc b/mysql-test/include/check_ftwrl_incompatible.inc index 56deef8e92f..4787a69ea9c 100644 --- a/mysql-test/include/check_ftwrl_incompatible.inc +++ b/mysql-test/include/check_ftwrl_incompatible.inc @@ -41,11 +41,11 @@ if (!$err) { --echo Error: Was able to run '$statement' under FTWRL! unlock tables; -if (`SELECT "$cleanup_stmt1" <> ""`) +if ($cleanup_stmt1) { --eval $cleanup_stmt1; } -if (`SELECT "$cleanup_stmt2" <> ""`) +if ($cleanup_stmt2) { --eval $cleanup_stmt2; } @@ -88,16 +88,16 @@ unlock tables; connection default; --reap -if (`SELECT "$cleanup_stmt1" <> ""`) +if ($cleanup_stmt1) { --eval $cleanup_stmt1; } -if (`SELECT "$cleanup_stmt2" <> ""`) +if ($cleanup_stmt2) { --eval $cleanup_stmt2; } -if (`SELECT "$skip_3rd_check" = ""`) +if (!$skip_3rd_check) { # # Finally, let us check that FTWRL will not succeed if this @@ -141,11 +141,11 @@ connection default; set debug_sync= "RESET"; -if (`SELECT "$cleanup_stmt1" <> ""`) +if ($cleanup_stmt1) { --eval $cleanup_stmt1; } -if (`SELECT "$cleanup_stmt2" <> ""`) +if ($cleanup_stmt2) { --eval $cleanup_stmt2; } diff --git a/mysql-test/include/check_slave_param.inc b/mysql-test/include/check_slave_param.inc index 1e0e81308f2..243e87a9b65 100644 --- a/mysql-test/include/check_slave_param.inc +++ b/mysql-test/include/check_slave_param.inc @@ -25,7 +25,7 @@ --let $_param_value= query_get_value(SHOW SLAVE STATUS, $slave_param, 1) -if (`SELECT '$_param_value' != '$slave_param_value'`) { +if ($_param_value != $slave_param_value) { --source include/show_rpl_debug_info.inc --echo Wrong value for $slave_param. Expected '$slave_param_value', got '$_param_value' --die Wrong value for slave parameter diff --git a/mysql-test/include/diff_tables.inc b/mysql-test/include/diff_tables.inc index 94921b02f13..5f88d8d3073 100644 --- a/mysql-test/include/diff_tables.inc +++ b/mysql-test/include/diff_tables.inc @@ -81,7 +81,7 @@ if (`SELECT LOCATE(',', '$diff_tables') = 0`) # Iterate over all tables --let $_dt_outfile= --let $_dt_prev_outfile= -while (`SELECT '$_dt_tables' != ''`) +while ($_dt_tables) { --let $_dt_table= `SELECT SUBSTRING_INDEX('$_dt_tables', ',', 1)` --let $_dt_tables= `SELECT SUBSTRING('$_dt_tables', LENGTH('$_dt_table') + 2)` diff --git a/mysql-test/include/rpl_change_topology.inc b/mysql-test/include/rpl_change_topology.inc index d261f023acb..799262986e6 100644 --- a/mysql-test/include/rpl_change_topology.inc +++ b/mysql-test/include/rpl_change_topology.inc @@ -111,11 +111,11 @@ if (`SELECT '$rpl_topology' = '' OR '$rpl_server_count' = ''`) --die You must set $rpl_topology and $rpl_server_count before you source rpl_change_topology.inc. If you really want to change to the empty topology, set $rpl_topology= none } --let $_rpl_topology= $rpl_topology -if (`SELECT '$_rpl_topology' = 'none'`) +if ($_rpl_topology == 'none') { --let $_rpl_topology= } -if (`SELECT '!$rpl_master_list!' = '!!'`) +if ($rpl_master_list == '') { --die You must source include/rpl_init.inc before you source include/rpl_change_topology.inc } @@ -227,16 +227,13 @@ if (!$rpl_skip_change_master) } eval CHANGE MASTER TO MASTER_HOST = '127.0.0.1', MASTER_PORT = $_rpl_port, MASTER_USER = 'root', MASTER_LOG_FILE = '$_rpl_master_log_file'$_rpl_master_log_pos, MASTER_CONNECT_RETRY = 1; } - if (!$_rpl_master) + if ($_rpl_master == '') { - if (`SELECT '$_rpl_master' = ''`) - { # This un-configures the server so that it's not a slave. # After BUG#28796, such configuration is not possible any more. #--let $rpl_connection_name= server_$_rpl_server #--source include/rpl_connection.inc #CHANGE MASTER TO MASTER_HOST = ''; - } } --dec $_rpl_server } diff --git a/mysql-test/include/rpl_connect.inc b/mysql-test/include/rpl_connect.inc index a4d18dd5f9c..95912d57469 100644 --- a/mysql-test/include/rpl_connect.inc +++ b/mysql-test/include/rpl_connect.inc @@ -33,7 +33,7 @@ if (!$rpl_server_number) { --die ERROR IN TEST: You must set $rpl_server_number before sourcing include/rpl_connect.inc } -if (`SELECT '$rpl_connection_name' = ''`) +if (!$rpl_connection_name) { --die ERROR IN TEST: You must set $rpl_connection_name before sourcing include/rpl_connect.inc } diff --git a/mysql-test/include/rpl_diff.inc b/mysql-test/include/rpl_diff.inc index bf24b4f2a13..72da06cc533 100644 --- a/mysql-test/include/rpl_diff.inc +++ b/mysql-test/include/rpl_diff.inc @@ -46,7 +46,7 @@ if (!$rpl_diff_statement) # Get database name. --let $_rpl_diff_database= $rpl_diff_database -if (`SELECT '$_rpl_diff_database' = ''`) +if (!$_rpl_diff_database) { --let $_rpl_diff_database= test } diff --git a/mysql-test/include/rpl_end.inc b/mysql-test/include/rpl_end.inc index 0dd73ad51ab..f671c442153 100644 --- a/mysql-test/include/rpl_end.inc +++ b/mysql-test/include/rpl_end.inc @@ -68,7 +68,7 @@ while ($_rpl_server) # Only check slave threads for error on hosts that were at some # point configured as slave. --let $_tmp= query_get_value(SHOW SLAVE STATUS, Master_Host, 1) - if (`SELECT '$_tmp' != 'No such row'`) + if ($_tmp != 'No such row') { --source include/check_slave_no_error.inc } diff --git a/mysql-test/include/rpl_init.inc b/mysql-test/include/rpl_init.inc index 3cf78dc2979..6419682e650 100644 --- a/mysql-test/include/rpl_init.inc +++ b/mysql-test/include/rpl_init.inc @@ -116,24 +116,24 @@ if ($rpl_debug) } # Allow $MASTER_MYPORT as alias for $SERVER_MYPORT_1 -if (`SELECT '$SERVER_MYPORT_1' = ''`) +if (!$SERVER_MYPORT_1) { --let SERVER_MYPORT_1= $MASTER_MYPORT } # Allow $SLAVE_MYPORT as alias for $SERVER_MYPORT_2 -if (`SELECT '$SERVER_MYPORT_2' = ''`) +if (!$SERVER_MYPORT_2) { --let SERVER_MYPORT_2= $SLAVE_MYPORT } # Allow $MASTER_MYPORT1 as alias for $SERVER_MYPORT_3 # (this alias is used by rpl_ndb tests) -if (`SELECT '$SERVER_MYPORT_3' = ''`) +if (!$SERVER_MYPORT_3) { --let SERVER_MYPORT_3= $MASTER_MYPORT1 } # Allow $SLAVE_MYPORT1 as alias for $SERVER_MYPORT_4 # (this alias is used by rpl_ndb tests) -if (`SELECT '$SERVER_MYPORT_4' = ''`) +if (!$SERVER_MYPORT_4) { --let SERVER_MYPORT_4= $SLAVE_MYPORT1 } diff --git a/mysql-test/include/show_slave_status.inc b/mysql-test/include/show_slave_status.inc index 779de5a37f5..67b1c987954 100644 --- a/mysql-test/include/show_slave_status.inc +++ b/mysql-test/include/show_slave_status.inc @@ -58,13 +58,13 @@ --let $_show_slave_status_items=$status_items -if (`SELECT "XX$status_items" = "XX"`) +if (!$status_items) { --die Bug in test case: The mysqltest variable $status_items is not set. } -while (`SELECT "XX$_show_slave_status_items" <> "XX"`) +while ($_show_slave_status_items) { --let $_show_slave_status_name= `SELECT SUBSTRING_INDEX('$_show_slave_status_items', ',', 1)` --let $_show_slave_status_items= `SELECT LTRIM(SUBSTRING('$_show_slave_status_items', LENGTH('$_show_slave_status_name') + 2))` diff --git a/mysql-test/include/sync_slave_io_with_master.inc b/mysql-test/include/sync_slave_io_with_master.inc index b1b81371c97..d0fcef90cae 100644 --- a/mysql-test/include/sync_slave_io_with_master.inc +++ b/mysql-test/include/sync_slave_io_with_master.inc @@ -36,7 +36,7 @@ --source include/save_master_pos.inc --let $rpl_connection_name= slave -if (`SELECT '$sync_slave_connection' != ''`) +if ($sync_slave_connection) { --let $rpl_connection_name= $sync_slave_connection } diff --git a/mysql-test/include/wait_for_binlog_event.inc b/mysql-test/include/wait_for_binlog_event.inc index 7a55c8c2182..b251ae226d3 100644 --- a/mysql-test/include/wait_for_binlog_event.inc +++ b/mysql-test/include/wait_for_binlog_event.inc @@ -24,7 +24,7 @@ while (`SELECT INSTR("$_last_event","$wait_binlog_event") = 0`) real_sleep 0.1; let $_event= query_get_value(SHOW BINLOG EVENTS, Info, $_event_pos); let $_last_event= $_event; - while (`SELECT "$_event" != "No such row"`) + while ($_event != "No such row") { inc $_event_pos; let $_last_event= $_event; diff --git a/mysql-test/include/wait_for_slave_param.inc b/mysql-test/include/wait_for_slave_param.inc index c9660b0679d..131d91a8440 100644 --- a/mysql-test/include/wait_for_slave_param.inc +++ b/mysql-test/include/wait_for_slave_param.inc @@ -52,7 +52,7 @@ if (!$_slave_timeout) let $_slave_timeout= 300; } -if (`SELECT '$slave_error_param' = ''`) +if ($slave_error_param == '') { --let $slave_error_param= 1 } @@ -70,7 +70,7 @@ if ($rpl_debug) --let $_slave_check_configured= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1) -if (`SELECT '$_slave_check_configured' = 'No such row'`) +if ($_slave_check_configured == 'No such row') { --echo **** ERROR: SHOW SLAVE STATUS returned empty result set. Slave not configured. **** --source include/show_rpl_debug_info.inc diff --git a/mysql-test/include/write_var_to_file.inc b/mysql-test/include/write_var_to_file.inc index e70667634a3..08de195ccbb 100644 --- a/mysql-test/include/write_var_to_file.inc +++ b/mysql-test/include/write_var_to_file.inc @@ -27,12 +27,12 @@ # @@secure_file_priv. That makes this more complex than you might # expect. -if (`SELECT '$write_to_file' = ''`) +if (!$write_to_file) { --die You must set the mysqltest variable \$write_to_file before you source include/write_var_to_file.inc } -if (`SELECT '$write_to_file' = 'GENERATE'`) +if ($write_to_file == 'GENERATE') { --let $_wvtf_suffix= `SELECT UUID()` --let $write_to_file= $MYSQLTEST_VARDIR/tmp/_var_file_$_wvtf_suffix.inc diff --git a/mysql-test/suite/innodb/t/innodb_bug42419.test b/mysql-test/suite/innodb/t/innodb_bug42419.test index 93c4764252a..46f357c1777 100644 --- a/mysql-test/suite/innodb/t/innodb_bug42419.test +++ b/mysql-test/suite/innodb/t/innodb_bug42419.test @@ -7,7 +7,7 @@ --source include/have_innodb.inc let $innodb_lock_wait_timeout= query_get_value(SHOW VARIABLES LIKE 'innodb_lock_wait_timeout%', Value, 1); -if (`SELECT $innodb_lock_wait_timeout < 10`) +if ($innodb_lock_wait_timeout < 10) { --echo # innodb_lock_wait_timeout must be >= 10 seconds --echo # so that this test can work all time fine on an overloaded testing box |