From 0f551def8f674669477271fca0d52eb473c91c9f Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 17 Nov 2010 11:16:13 +0100 Subject: [PATCH] Tests: many if/while expresissons simplified after 57276 --- .../extra/binlog_tests/binlog_truncate.test | 6 +- mysql-test/extra/binlog_tests/blackhole.test | 2 +- .../mix_innodb_myisam_binlog.test | 2 +- .../rpl_tests/create_recursive_construct.inc | 33 +++-- .../rpl_tests/rpl_drop_create_temp_table.inc | 24 ++-- .../extra/rpl_tests/rpl_extraSlave_Col.test | 2 +- .../rpl_tests/rpl_implicit_commit_binlog.test | 114 +++++++++--------- .../extra/rpl_tests/rpl_insert_delayed.test | 2 +- mysql-test/extra/rpl_tests/rpl_not_null.test | 14 +-- mysql-test/include/check_slave_is_running.inc | 10 +- mysql-test/include/check_slave_param.inc | 2 +- mysql-test/include/diff_tables.inc | 2 +- mysql-test/include/have_example_plugin.inc | 2 +- mysql-test/include/have_semisync_plugin.inc | 2 +- mysql-test/include/have_simple_parser.inc | 2 +- mysql-test/include/have_udf.inc | 2 +- .../include/mysql_upgrade_preparation.inc | 2 +- .../include/no_valgrind_without_big.inc | 9 +- mysql-test/include/not_parallel.inc | 2 +- mysql-test/include/rpl_diff_tables.inc | 6 +- mysql-test/include/setup_fake_relay_log.inc | 9 +- mysql-test/include/show_rpl_debug_info.inc | 4 +- mysql-test/include/truncate_file.inc | 2 +- .../include/wait_for_slave_io_to_stop.inc | 2 +- .../include/wait_for_slave_sql_error.inc | 2 +- .../include/wait_for_slave_sql_to_stop.inc | 2 +- mysql-test/include/wait_for_slave_to_stop.inc | 2 +- mysql-test/include/wait_show_condition.inc | 18 ++- .../t/binlog_row_mysqlbinlog_db_filter.test | 6 +- .../binlog/t/binlog_stm_unsafe_warning.test | 2 +- mysql-test/suite/binlog/t/binlog_unsafe.test | 26 ++-- .../suite/federated/federated_bug_25714.test | 2 +- .../suite/perfschema_stress/t/modify.test | 2 +- .../suite/perfschema_stress/t/setup.test | 4 +- .../suite/perfschema_stress/t/work.test | 2 +- mysql-test/suite/rpl/t/rpl_change_master.test | 4 +- .../suite/rpl/t/rpl_concurrency_error.test | 16 +-- mysql-test/suite/rpl/t/rpl_heartbeat.test | 2 +- mysql-test/suite/rpl/t/rpl_mysql_upgrade.test | 4 +- mysql-test/suite/rpl/t/rpl_semi_sync.test | 4 +- .../suite/rpl/t/rpl_semi_sync_event.test | 4 +- .../suite/rpl/t/rpl_slow_query_log.test | 8 +- mysql-test/suite/rpl/t/rpl_ssl.test | 2 +- .../sys_vars/t/slow_launch_time_func.test | 2 +- mysql-test/t/change_user.test | 2 +- mysql-test/t/execution_constants.test | 2 +- mysql-test/t/fix_priv_tables.test | 2 +- mysql-test/t/mysqltest.test | 6 +- mysql-test/t/named_pipe.test | 2 +- mysql-test/t/shm.test | 2 +- mysql-test/t/system_mysql_db_fix40123.test | 2 +- mysql-test/t/system_mysql_db_fix50030.test | 2 +- mysql-test/t/system_mysql_db_fix50117.test | 2 +- 53 files changed, 211 insertions(+), 182 deletions(-) diff --git a/mysql-test/extra/binlog_tests/binlog_truncate.test b/mysql-test/extra/binlog_tests/binlog_truncate.test index 24cf363f780..d434f792db0 100644 --- a/mysql-test/extra/binlog_tests/binlog_truncate.test +++ b/mysql-test/extra/binlog_tests/binlog_truncate.test @@ -12,13 +12,13 @@ eval CREATE TABLE t1 (a INT) ENGINE=$engine; eval CREATE TABLE t2 (a INT) ENGINE=$engine; INSERT INTO t2 VALUES (1),(2),(3); let $binlog_start = query_get_value("SHOW MASTER STATUS", Position, 1); -if (`select length('$before_truncate') > 0`) { +if ($before_truncate) { eval $before_truncate; } --echo **** Truncate of empty table shall be logged TRUNCATE TABLE t1; -if (`select length('$before_truncate') > 0`) { +if ($before_truncate) { eval $before_truncate; } TRUNCATE TABLE t2; @@ -35,7 +35,7 @@ eval CREATE TABLE t2 (a INT) ENGINE=$engine; INSERT INTO t1 VALUES (1),(2); let $binlog_start = query_get_value("SHOW MASTER STATUS", Position, 1); -if (`select length('$before_truncate') > 0`) { +if ($before_truncate) { eval $before_truncate; } diff --git a/mysql-test/extra/binlog_tests/blackhole.test b/mysql-test/extra/binlog_tests/blackhole.test index c694c34622f..90146d41471 100644 --- a/mysql-test/extra/binlog_tests/blackhole.test +++ b/mysql-test/extra/binlog_tests/blackhole.test @@ -173,7 +173,7 @@ insert into t1 values(2); rollback; let $master_log_pos_2= query_get_value(SHOW MASTER STATUS, Position, 1); -if (`SELECT $master_log_pos_2 <> $master_log_pos_1`) +if ($master_log_pos_2 != $master_log_pos_1) { echo $master_log_pos_1 $master_log_pos_2; die Rollbacked transaction has been binlogged; diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test index 6bf9a27afaf..040da1959dc 100644 --- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test +++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test @@ -319,7 +319,7 @@ if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`) { --let $binlog_rollback= query_get_value(SHOW BINLOG EVENTS, Pos, 7) --let $binlog_query= query_get_value(SHOW BINLOG EVENTS, Info, 7) - if (`SELECT 'ROLLBACK' != '$binlog_query'`) { + if ($binlog_query != ROLLBACK) { --echo Wrong query from SHOW BINLOG EVENTS. Expected ROLLBACK, got '$binlog_query' --source include/show_rpl_debug_info.inc --die Wrong value for slave parameter diff --git a/mysql-test/extra/rpl_tests/create_recursive_construct.inc b/mysql-test/extra/rpl_tests/create_recursive_construct.inc index 12693e752fe..6e130a8154f 100644 --- a/mysql-test/extra/rpl_tests/create_recursive_construct.inc +++ b/mysql-test/extra/rpl_tests/create_recursive_construct.inc @@ -167,7 +167,9 @@ --let $CRC_create= ######## func_retval ######## -if (`SELECT $CRC_ARG_type = 0 AND '$CRC_ARG_value' != ''`) { +# if inside if in lieu of AND operand +if ($CRC_ARG_type == 0) { + if ($CRC_ARG_value) { # It will be safe to call this function and discard the return # value, but it will be unsafe to use return value (e.g., in # INSERT...SELECT). @@ -180,10 +182,11 @@ if (`SELECT $CRC_ARG_type = 0 AND '$CRC_ARG_value' != ''`) { --let $CRC_RET_drop= DROP FUNCTION $CRC_name --let $CRC_RET_is_toplevel= 0 --let $CRC_RET_desc= function $CRC_name returning value from $CRC_ARG_desc + } } ######## func_sidef ######## -if (`SELECT $CRC_ARG_type = 1`) { +if ($CRC_ARG_type == 1) { # It will be unsafe to call func even if you discard return value. --let $CRC_name= func_sidef_$CRC_ARG_level --let $CRC_create= CREATE FUNCTION $CRC_name() RETURNS VARCHAR(100) BEGIN INSERT INTO ta$CRC_ARG_level VALUES (47); $CRC_ARG_stmt_sidef; RETURN 0; END @@ -197,7 +200,7 @@ if (`SELECT $CRC_ARG_type = 1`) { } ######## proc ######## -if (`SELECT $CRC_ARG_type = 2`) { +if ($CRC_ARG_type == 2) { # It will be unsafe to call this procedure. --let $CRC_name= proc_$CRC_ARG_level --let $CRC_create= CREATE PROCEDURE $CRC_name() BEGIN $CRC_ARG_stmt_sidef; INSERT INTO ta$CRC_ARG_level VALUES (47); END @@ -211,7 +214,7 @@ if (`SELECT $CRC_ARG_type = 2`) { } ######## trig ######## -if (`SELECT $CRC_ARG_type = 3`) { +if ($CRC_ARG_type == 3) { # It will be unsafe to invoke this trigger. --let $CRC_name= trig_$CRC_ARG_level --let $CRC_create= CREATE TRIGGER $CRC_name BEFORE INSERT ON trigger_table_$CRC_ARG_level FOR EACH ROW BEGIN INSERT INTO ta$CRC_ARG_level VALUES (47); $CRC_ARG_stmt_sidef; END @@ -225,7 +228,8 @@ if (`SELECT $CRC_ARG_type = 3`) { } ######## view_retval ######## -if (`SELECT $CRC_ARG_type = 4 AND '$CRC_ARG_sel_retval' != ''`) { +if ($CRC_ARG_type == 4) { + if ($CRC_ARG_sel_retval) { # It will be safe to select from this view if you discard the result # set, but unsafe to use result set (e.g., in INSERT..SELECT). --let $CRC_name= view_retval_$CRC_ARG_level @@ -237,10 +241,12 @@ if (`SELECT $CRC_ARG_type = 4 AND '$CRC_ARG_sel_retval' != ''`) { --let $CRC_RET_drop= DROP VIEW $CRC_name --let $CRC_RET_is_toplevel= 0 --let $CRC_RET_desc= view $CRC_name returning value from $CRC_ARG_desc + } } ######## view_sidef ######## -if (`SELECT $CRC_ARG_type = 5 AND '$CRC_ARG_sel_sidef' != ''`) { +if ($CRC_ARG_type == 5) { + if ($CRC_ARG_sel_sidef) { # It will be unsafe to select from this view, even if you discard # the return value. --let $CRC_name= view_sidef_$CRC_ARG_level @@ -252,10 +258,11 @@ if (`SELECT $CRC_ARG_type = 5 AND '$CRC_ARG_sel_sidef' != ''`) { --let $CRC_RET_drop= DROP VIEW $CRC_name --let $CRC_RET_is_toplevel= 0 --let $CRC_RET_desc= view $CRC_name invoking $CRC_ARG_desc + } } ######## prep ######## -if (`SELECT $CRC_ARG_type = 6`) { +if ($CRC_ARG_type == 6) { # It will be unsafe to execute this prepared statement --let $CRC_name= prep_$CRC_ARG_level --let $CRC_create= PREPARE $CRC_name FROM "$CRC_ARG_stmt_sidef" @@ -269,7 +276,7 @@ if (`SELECT $CRC_ARG_type = 6`) { } ######## no recursive construct: just return the given statement ######## -if (`SELECT $CRC_ARG_type = 7`) { +if ($CRC_ARG_type == 7) { # CRC_ARG_type=7 is a special case. We just set $CRC_RET_x = # $CRC_ARG_x. This way, the $CRC_ARG_stmt gets executed directly # (below). In binlog_unsafe.test, it is used to invoke the unsafe @@ -295,7 +302,7 @@ if ($CRC_RET_stmt_sidef) { --echo * binlog_format = STATEMENT: expect $CRC_ARG_expected_number_of_warnings warnings. --eval $CRC_RET_stmt_sidef --let $n_warnings= `SHOW COUNT(*) WARNINGS` - if (`SELECT '$n_warnings' != '$CRC_ARG_expected_number_of_warnings'`) { + if ($n_warnings != $CRC_ARG_expected_number_of_warnings) { --echo ******** Failure! Expected $CRC_ARG_expected_number_of_warnings warnings, got $n_warnings warnings. ******** SHOW WARNINGS; SHOW BINLOG EVENTS; @@ -312,14 +319,14 @@ if ($CRC_RET_stmt_sidef) { RESET MASTER; --eval $CRC_RET_stmt_sidef --let $n_warnings= `SHOW COUNT(*) WARNINGS` - if (`SELECT '$n_warnings' != '0'`) { + if ($n_warnings) { --echo ******** Failure! Expected 0 warnings, got $n_warnings warnings. ******** SHOW WARNINGS; SHOW BINLOG EVENTS; --die Wrong number of warnings. } --let $binlog_event= query_get_value(SHOW BINLOG EVENTS, Event_type, 2) - if (`SELECT '$binlog_event' != 'No such row'`) { + if ($binlog_event != No such row) { --enable_query_log --echo ******** Failure! Something was written to the binlog despite SQL_LOG_BIN=0 ******** SHOW BINLOG EVENTS; @@ -332,7 +339,7 @@ if ($CRC_RET_stmt_sidef) { RESET MASTER; --eval $CRC_RET_stmt_sidef --let $n_warnings= `SHOW COUNT(*) WARNINGS` - if (`SELECT '$n_warnings' != '0'`) { + if ($n_warnings) { --echo ******** Failure! Expected 0 warnings, got $n_warnings warnings. ******** SHOW WARNINGS; SHOW BINLOG EVENTS; @@ -375,7 +382,7 @@ if ($CRC_RET_sel_retval) { # fail. When the bug is fixed, we should execute the following. #--let $n_warnings= `SHOW COUNT(*) WARNINGS` - #if (`SELECT '$n_warnings' != '0'`) { + #if ($n_warnings) { # --enable_query_log # --echo Failure! Expected 0 warnings, got $n_warnings warnings. # SHOW WARNINGS; diff --git a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc index 8e89cde004d..094e84537db 100644 --- a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc +++ b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc @@ -35,7 +35,7 @@ if (`SELECT HEX(@commands) = HEX('configure')`) # when a command ends. # --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TEMPORARY TABLE IF EXISTS nt_tmp_$n --eval CREATE TEMPORARY TABLE nt_tmp_$n ( id INT ) ENGINE = MyIsam @@ -62,7 +62,7 @@ if (`SELECT HEX(@commands) = HEX('configure')`) # when a command ends. # --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TEMPORARY TABLE IF EXISTS tt_tmp_$n --eval CREATE TEMPORARY TABLE tt_tmp_$n ( id INT ) ENGINE = Innodb @@ -89,7 +89,7 @@ if (`SELECT HEX(@commands) = HEX('configure')`) # when a command ends. # --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TABLE IF EXISTS nt_$n --eval CREATE TABLE nt_$n ( id INT ) ENGINE = MyIsam @@ -116,7 +116,7 @@ if (`SELECT HEX(@commands) = HEX('configure')`) # when a command ends. # --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TABLE IF EXISTS tt_$n --eval CREATE TABLE tt_$n ( id INT ) ENGINE = Innodb @@ -163,14 +163,14 @@ if (`SELECT HEX(@commands) = HEX('clean')`) DROP TABLE IF EXISTS nt_xx_1; --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TABLE IF EXISTS nt_$n --dec $n } --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TABLE IF EXISTS tt_$n --dec $n @@ -634,11 +634,11 @@ while (`SELECT HEX(@commands) != HEX('')`) { --let $dropped_temp= $table } - if (`SELECT $n = 1`) + if ($n == 1) { --let $table_1= $table } - if (`SELECT $n = 2`) + if ($n == 2) { --let $table_2= $table } @@ -886,7 +886,7 @@ while (`SELECT HEX(@commands) != HEX('')`) --let $available_n_temp= --let $dropped_n_temp= --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TEMPORARY TABLE IF EXISTS nt_tmp_$n --eval CREATE TEMPORARY TABLE nt_tmp_$n ( id INT ) ENGINE = MyIsam @@ -905,7 +905,7 @@ while (`SELECT HEX(@commands) != HEX('')`) --let $available_t_temp= --let $dropped_t_temp= --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TEMPORARY TABLE IF EXISTS tt_tmp_$n --eval CREATE TEMPORARY TABLE tt_tmp_$n ( id INT ) ENGINE = Innodb @@ -924,7 +924,7 @@ while (`SELECT HEX(@commands) != HEX('')`) --let $available_t= --let $dropped_t= --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TABLE IF EXISTS tt_$n --eval CREATE TABLE tt_$n ( id INT ) ENGINE = Innodb @@ -943,7 +943,7 @@ while (`SELECT HEX(@commands) != HEX('')`) --let $available_n= --let $dropped_n= --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TABLE IF EXISTS nt_$n --eval CREATE TABLE nt_$n ( id INT ) ENGINE = MyIsam diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test index 568cf802763..77b7e9a57ea 100644 --- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test +++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test @@ -406,7 +406,7 @@ sync_slave_with_master; # Error reaction is up to sql_mode of the slave sql (bug#38173) #--echo *** Create t9 on slave *** # Please, check BUG#47741 to see why you are not testing NDB. -if (`SELECT $engine_type != 'NDB'`) +if ($engine_type != NDB) { STOP SLAVE; RESET SLAVE; diff --git a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test index 14368ba4321..bbd4969ef40 100644 --- a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test +++ b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test @@ -33,7 +33,7 @@ INSERT INTO tt_2(ddl_case) VALUES(0); --echo ######################################################################### SET AUTOCOMMIT= 0; let $ddl_cases= 41; -while (`SELECT $ddl_cases >= 1`) +while ($ddl_cases >= 1) { --echo -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- let $in_temporary= "no"; @@ -76,7 +76,7 @@ while (`SELECT $ddl_cases >= 1`) # 6: ROW EVENT # 7: COMMIT # - if (`select '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 7; } @@ -84,10 +84,10 @@ while (`SELECT $ddl_cases >= 1`) let $first_binlog_position= query_get_value("SHOW MASTER STATUS", Position, 1); --enable_query_log eval INSERT INTO tt_1(ddl_case) VALUES ($ddl_cases); - if (`SELECT $ddl_cases = 41`) + if ($ddl_cases == 41) { let $cmd= LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES; - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { # This seems to be related to epochs. # We need to check this against an updated version or avoid it. @@ -95,7 +95,7 @@ while (`SELECT $ddl_cases >= 1`) let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 40`) + if ($ddl_cases == 40) { let $cmd= LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES; # @@ -109,16 +109,16 @@ while (`SELECT $ddl_cases >= 1`) # 5: ROW EVENT # 6: COMMIT # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 39`) + if ($ddl_cases == 39) { let $cmd= ANALYZE TABLE nt_1; } - if (`SELECT $ddl_cases = 38`) + if ($ddl_cases == 38) { let $cmd= CHECK TABLE nt_1; # @@ -132,20 +132,20 @@ while (`SELECT $ddl_cases >= 1`) # 5: ROW EVENT # 6: COMMIT # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 37`) + if ($ddl_cases == 37) { let $cmd= OPTIMIZE TABLE nt_1; } - if (`SELECT $ddl_cases = 36`) + if ($ddl_cases == 36) { let $cmd= REPAIR TABLE nt_1; } - if (`SELECT $ddl_cases = 35`) + if ($ddl_cases == 35) { let $cmd= LOCK TABLES tt_1 WRITE; # @@ -159,12 +159,12 @@ while (`SELECT $ddl_cases >= 1`) # 5: ROW EVENT # 6: COMMIT # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 34`) + if ($ddl_cases == 34) { let $cmd= UNLOCK TABLES; # @@ -178,20 +178,20 @@ while (`SELECT $ddl_cases >= 1`) # 5: ROW EVENT # 6: COMMIT # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 33`) + if ($ddl_cases == 33) { let $cmd= CREATE USER 'user'@'localhost'; } - if (`SELECT $ddl_cases = 32`) + if ($ddl_cases == 32) { let $cmd= GRANT ALL ON *.* TO 'user'@'localhost'; } - if (`SELECT $ddl_cases = 31`) + if ($ddl_cases == 31) { let $cmd= SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass'); # @@ -231,35 +231,35 @@ while (`SELECT $ddl_cases >= 1`) let $commit_event_row_number= 7; } } - if (`SELECT $ddl_cases = 30`) + if ($ddl_cases == 30) { let $cmd= REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost'; } - if (`SELECT $ddl_cases = 29`) + if ($ddl_cases == 29) { let $cmd= RENAME USER 'user'@'localhost' TO 'user_new'@'localhost'; } - if (`SELECT $ddl_cases = 28`) + if ($ddl_cases == 28) { let $cmd= DROP USER 'user_new'@'localhost'; } - if (`SELECT $ddl_cases = 27`) + if ($ddl_cases == 27) { let $cmd= CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1; } - if (`SELECT $ddl_cases = 26`) + if ($ddl_cases == 26) { let $cmd= ALTER EVENT evt COMMENT 'evt'; } - if (`SELECT $ddl_cases = 25`) + if ($ddl_cases == 25) { let $cmd= DROP EVENT evt; } - if (`SELECT $ddl_cases = 24`) + if ($ddl_cases == 24) { let $cmd= CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; } - if (`SELECT $ddl_cases = 23`) + if ($ddl_cases == 23) { let $cmd= DROP TRIGGER tr; # @@ -277,43 +277,43 @@ while (`SELECT $ddl_cases >= 1`) let $commit_event_row_number= 5; } } - if (`SELECT $ddl_cases = 22`) + if ($ddl_cases == 22) { let $cmd= CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc"; } - if (`SELECT $ddl_cases = 21`) + if ($ddl_cases == 21) { let $cmd= ALTER FUNCTION fc COMMENT 'fc'; } - if (`SELECT $ddl_cases = 20`) + if ($ddl_cases == 20) { let $cmd= DROP FUNCTION fc; } - if (`SELECT $ddl_cases = 19`) + if ($ddl_cases == 19) { let $cmd= CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; } - if (`SELECT $ddl_cases = 18`) + if ($ddl_cases == 18) { let $cmd= ALTER PROCEDURE pc COMMENT 'pc'; } - if (`SELECT $ddl_cases = 17`) + if ($ddl_cases == 17) { let $cmd= DROP PROCEDURE pc; } - if (`SELECT $ddl_cases = 16`) + if ($ddl_cases == 16) { let $cmd= CREATE VIEW v AS SELECT * FROM tt_1; } - if (`SELECT $ddl_cases = 15`) + if ($ddl_cases == 15) { let $cmd= ALTER VIEW v AS SELECT * FROM tt_1; } - if (`SELECT $ddl_cases = 14`) + if ($ddl_cases == 14) { let $cmd= DROP VIEW v; } - if (`SELECT $ddl_cases = 13`) + if ($ddl_cases == 13) { let $cmd= CREATE INDEX ix ON tt_1(ddl_case); # @@ -328,12 +328,12 @@ while (`SELECT $ddl_cases >= 1`) # 6: COMMIT # 7: DDL EVENT which triggered the previous commmit. # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 12`) + if ($ddl_cases == 12) { let $cmd= DROP INDEX ix ON tt_1; # @@ -348,12 +348,12 @@ while (`SELECT $ddl_cases >= 1`) # 6: COMMIT # 7: DDL EVENT which triggered the previous commmit. # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 11`) + if ($ddl_cases == 11) { let $cmd= CREATE TEMPORARY TABLE tt_xx (a int); let $in_temporary= "yes"; @@ -411,7 +411,7 @@ while (`SELECT $ddl_cases >= 1`) let $commit_event_row_number= 9; } } - if (`SELECT $ddl_cases = 10`) + if ($ddl_cases == 10) { let $cmd= ALTER TABLE tt_xx ADD COLUMN (b int); # @@ -438,12 +438,12 @@ while (`SELECT $ddl_cases >= 1`) # 5: ROW EVENT # 6: COMMIT # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 9`) + if ($ddl_cases == 9) { let $cmd= ALTER TABLE tt_xx RENAME new_tt_xx; # @@ -470,12 +470,12 @@ while (`SELECT $ddl_cases >= 1`) # 5: ROW EVENT # 6: COMMIT # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 8`) + if ($ddl_cases == 8) { let $cmd= DROP TEMPORARY TABLE IF EXISTS new_tt_xx; let $in_temporary= "yes"; @@ -528,7 +528,7 @@ while (`SELECT $ddl_cases >= 1`) # 8: ROW EVENT # 9: COMMIT # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 9; } @@ -551,27 +551,27 @@ while (`SELECT $ddl_cases >= 1`) let $commit_event_row_number= 9; } } - if (`SELECT $ddl_cases = 7`) + if ($ddl_cases == 7) { let $cmd= CREATE TABLE tt_xx (a int); } - if (`SELECT $ddl_cases = 6`) + if ($ddl_cases == 6) { let $cmd= ALTER TABLE tt_xx ADD COLUMN (b int); } - if (`SELECT $ddl_cases = 5`) + if ($ddl_cases == 5) { let $cmd= RENAME TABLE tt_xx TO new_tt_xx; } - if (`SELECT $ddl_cases = 4`) + if ($ddl_cases == 4) { let $cmd= TRUNCATE TABLE new_tt_xx; } - if (`SELECT $ddl_cases = 3`) + if ($ddl_cases == 3) { let $cmd= DROP TABLE IF EXISTS tt_xx, new_tt_xx; } - if (`SELECT $ddl_cases = 2`) + if ($ddl_cases == 2) { let $cmd= CREATE DATABASE db; # @@ -586,12 +586,12 @@ while (`SELECT $ddl_cases >= 1`) # 6: COMMIT # 7: DDL EVENT which triggered the previous commmit. # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 1`) + if ($ddl_cases == 1) { let $cmd= DROP DATABASE IF EXISTS db; # @@ -606,7 +606,7 @@ while (`SELECT $ddl_cases >= 1`) # 6: COMMIT # 7: DDL EVENT which triggered the previous commmit. # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } @@ -618,14 +618,14 @@ while (`SELECT $ddl_cases >= 1`) # commit. The flag in_temporary is used to avoid aborting the test in such # cases. Thus we force the commit. # - if (`SELECT $in_temporary = "yes"`) + if ($in_temporary == "yes") { --eval COMMIT } let $event_commit= query_get_value("SHOW BINLOG EVENTS FROM $first_binlog_position", Info, $commit_event_row_number); if (`SELECT SUBSTRING("$event_commit",1,6) != "COMMIT"`) { - if (`SELECT $ok = "yes"`) + if ($ok == "yes") { --echo it *does not* commit the current transaction. --echo $cmd diff --git a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test index 7fd3451184a..d158b6595ba 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test @@ -121,7 +121,7 @@ if (`SELECT @@global.binlog_format = 'STATEMENT'`) # The second INSERT DELAYED statement is the 5 item if two INSERT DELAYED are # handled separately - if (`SELECT '$stmt' = 'COMMIT'`) + if ($stmt == COMMIT) { --let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 5) } diff --git a/mysql-test/extra/rpl_tests/rpl_not_null.test b/mysql-test/extra/rpl_tests/rpl_not_null.test index 58dbd9ce29f..290a0a0173f 100644 --- a/mysql-test/extra/rpl_tests/rpl_not_null.test +++ b/mysql-test/extra/rpl_tests/rpl_not_null.test @@ -177,7 +177,7 @@ sync_slave_with_master; #--source include/wait_for_slave_to_start.inc # #let $y=0; -#while (`select $y < 6`) +#while ($y < 6) #{ # connection master; # @@ -202,21 +202,21 @@ sync_slave_with_master; # `c` INT DEFAULT 500, # PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1; # -# if (`select $y=0`) +# if ($y==0) # { # --echo ************* EXECUTION WITH INSERTS ************* # connection master; # INSERT INTO t1(a) VALUES (1); # } # -# if (`select $y=1`) +# if ($y==1) # { # --echo ************* EXECUTION WITH INSERTS ************* # connection master; # INSERT INTO t1(a, b) VALUES (1, NULL); # } # -# if (`select $y=2`) +# if ($y==2) # { # --echo ************* EXECUTION WITH UPDATES ************* # connection master; @@ -225,14 +225,14 @@ sync_slave_with_master; # UPDATE t3 SET b = NULL where a= 1; # } # -# if (`select $y=3`) +# if ($y==3) # { # --echo ************* EXECUTION WITH INSERTS/REPLACES ************* # connection master; # REPLACE INTO t3(a, b) VALUES (1, null); # } # -# if (`select $y=4`) +# if ($y==4) # { # --echo ************* EXECUTION WITH UPDATES/REPLACES ************* # connection master; @@ -240,7 +240,7 @@ sync_slave_with_master; # REPLACE INTO t3(a, b) VALUES (1, null); # } # -# if (`select $y=5`) +# if ($y==5) # { # --echo ************* EXECUTION WITH MULTI-ROW INSERTS ************* # connection master; diff --git a/mysql-test/include/check_slave_is_running.inc b/mysql-test/include/check_slave_is_running.inc index 5fbbe0d684c..51c418e6c64 100644 --- a/mysql-test/include/check_slave_is_running.inc +++ b/mysql-test/include/check_slave_is_running.inc @@ -8,10 +8,18 @@ --echo Checking that both slave threads are running. +--let $running= 1 --let $slave_sql_running = query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1) --let $slave_io_running = query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1) -if (`SELECT '$slave_sql_running' != 'Yes' OR '$slave_io_running' != 'Yes'`) { +if ($slave_sql_running != Yes) { + --let $running= 0 +} +if ($slave_io_running != Yes) { + --let $running= 0 +} + +if (!$running) { --echo Slave not running: Slave_SQL_Running = $slave_sql_running Slave_IO_Running = $slave_io_running --source include/show_rpl_debug_info.inc --die Expected slave to be running, but it was not running. diff --git a/mysql-test/include/check_slave_param.inc b/mysql-test/include/check_slave_param.inc index d82c26851ea..b27825eee6c 100644 --- a/mysql-test/include/check_slave_param.inc +++ b/mysql-test/include/check_slave_param.inc @@ -9,7 +9,7 @@ # --source include/check_slave_param.inc --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) { --echo Wrong value for $slave_param. Expected '$slave_param_value', got '$_param_value' --source include/show_rpl_debug_info.inc --die Wrong value for slave parameter diff --git a/mysql-test/include/diff_tables.inc b/mysql-test/include/diff_tables.inc index d6216f3fe1e..bdd929f39a4 100644 --- a/mysql-test/include/diff_tables.inc +++ b/mysql-test/include/diff_tables.inc @@ -69,7 +69,7 @@ while ($_diff_i) { # and connect the appropriate server. let $_pos= `SELECT LOCATE(':', '$_diff_table')`; let $_diff_conn=`SELECT SUBSTR('$_diff_table', 1, $_pos-1)`; - if (`SELECT 'XX$_diff_conn' <> 'XX'`) { + if ($_diff_conn) { let $_diff_table=`SELECT SUBSTR('$_diff_table', $_pos+1)`; connection $_diff_conn; } diff --git a/mysql-test/include/have_example_plugin.inc b/mysql-test/include/have_example_plugin.inc index 3a667d2e21a..8920399555d 100644 --- a/mysql-test/include/have_example_plugin.inc +++ b/mysql-test/include/have_example_plugin.inc @@ -8,7 +8,7 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) { # # Check if the variable EXAMPLE_PLUGIN is set # -if (`SELECT LENGTH('$EXAMPLE_PLUGIN') = 0`) { +if (!$EXAMPLE_PLUGIN) { --skip Example plugin requires the environment variable \$EXAMPLE_PLUGIN to be set (normally done by mtr) } diff --git a/mysql-test/include/have_semisync_plugin.inc b/mysql-test/include/have_semisync_plugin.inc index d3b42dbf5fb..95899f559aa 100644 --- a/mysql-test/include/have_semisync_plugin.inc +++ b/mysql-test/include/have_semisync_plugin.inc @@ -8,7 +8,7 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) { # # Check if the variable SEMISYNC_MASTER_PLUGIN is set # -if (`select LENGTH('$SEMISYNC_MASTER_PLUGIN') = 0`) +if (!$SEMISYNC_MASTER_PLUGIN) { skip Need semisync plugins; } diff --git a/mysql-test/include/have_simple_parser.inc b/mysql-test/include/have_simple_parser.inc index 745f68603fe..d077916c5e7 100644 --- a/mysql-test/include/have_simple_parser.inc +++ b/mysql-test/include/have_simple_parser.inc @@ -8,7 +8,7 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) { # # Check if the variable SIMPLE_PARSER is set # -if (`SELECT LENGTH('$SIMPLE_PARSER') = 0`) { +if (!$SIMPLE_PARSER) { --skip simple parser requires the environment variable \$SIMPLE_PARSER to be set (normally done by mtr) } diff --git a/mysql-test/include/have_udf.inc b/mysql-test/include/have_udf.inc index d9ca1450043..5c404b03729 100644 --- a/mysql-test/include/have_udf.inc +++ b/mysql-test/include/have_udf.inc @@ -8,7 +8,7 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) { # # Check if the variable UDF_EXAMPLE_LIB is set # -if (`SELECT LENGTH('$UDF_EXAMPLE_LIB') = 0`) { +if (!$UDF_EXAMPLE_LIB) { --skip UDF requires the environment variable \$UDF_EXAMPLE_LIB to be set (normally done by mtr) } diff --git a/mysql-test/include/mysql_upgrade_preparation.inc b/mysql-test/include/mysql_upgrade_preparation.inc index 5de8a79d6e0..a3c81c4c1e7 100644 --- a/mysql-test/include/mysql_upgrade_preparation.inc +++ b/mysql-test/include/mysql_upgrade_preparation.inc @@ -17,7 +17,7 @@ select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade; # Therefore, truncate the log table in advance and issue a statement # that should be logged. # -if (`SELECT $VALGRIND_TEST`) +if ($VALGRIND_TEST) { --disable_query_log --disable_result_log diff --git a/mysql-test/include/no_valgrind_without_big.inc b/mysql-test/include/no_valgrind_without_big.inc index 743e974daec..ea1f2ac91ab 100644 --- a/mysql-test/include/no_valgrind_without_big.inc +++ b/mysql-test/include/no_valgrind_without_big.inc @@ -5,8 +5,9 @@ # Therefore we require that the option "--big-test" is also set. # -if (`SELECT $VALGRIND_TEST <> 0 AND '$BIG_TEST' = ''`) -{ - --skip Need "--big-test" when running with Valgrind +if ($VALGRIND_TEST) { + if (!$BIG_TEST) + { + --skip Need "--big-test" when running with Valgrind + } } - diff --git a/mysql-test/include/not_parallel.inc b/mysql-test/include/not_parallel.inc index 39432c59813..615bdf68453 100644 --- a/mysql-test/include/not_parallel.inc +++ b/mysql-test/include/not_parallel.inc @@ -1,3 +1,3 @@ -if (`SELECT '$MTR_PARALLEL' > 1`) { +if ($MTR_PARALLEL > 1) { --skip test requires --parallel=1 } diff --git a/mysql-test/include/rpl_diff_tables.inc b/mysql-test/include/rpl_diff_tables.inc index c3a45578a79..a82e094a209 100644 --- a/mysql-test/include/rpl_diff_tables.inc +++ b/mysql-test/include/rpl_diff_tables.inc @@ -8,13 +8,13 @@ # --source include/rpl_diff_tables.inc # ############################################################################# -if (`SELECT "XX$diff_table" = "XX"`) +if (!$diff_table) { --die diff_table is null. } --let $_servers= master, slave -if (`SELECT "XX$diff_server_list" <> "XX"`) +if ($diff_server_list) { --let $_servers= $diff_server_list } @@ -22,7 +22,7 @@ if (`SELECT "XX$diff_server_list" <> "XX"`) --let $_master= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)` --let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_master') + 2))` connection $_master; -while (`SELECT "XX$_servers" <> "XX"`) +while ($_servers) { --let $_slave= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)` --let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_slave') + 2))` diff --git a/mysql-test/include/setup_fake_relay_log.inc b/mysql-test/include/setup_fake_relay_log.inc index c5d709601cf..1b517862235 100644 --- a/mysql-test/include/setup_fake_relay_log.inc +++ b/mysql-test/include/setup_fake_relay_log.inc @@ -40,9 +40,16 @@ let $_fake_relay_log_printable= `SELECT REPLACE('$fake_relay_log', '$MYSQL_TEST_ --echo Setting up fake replication from $_fake_relay_log_printable # Sanity check. +let $running= 0; let $_sql_running= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1); let $_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1); -if (`SELECT "$_sql_running" = "Yes" OR "$_io_running" = "Yes"`) { +if ($_sql_running == Yes) { + let $running= 1; +} +if ($_io_running == Yes) { + let $running= 1; +} +if ($running) { --echo Error: Slave was running when test case sourced --echo include/setup_fake_replication.inc --echo Slave_IO_Running = $_io_running; Slave_SQL_Running = $_sql_running diff --git a/mysql-test/include/show_rpl_debug_info.inc b/mysql-test/include/show_rpl_debug_info.inc index 9944e6cd25f..dedf689cd19 100644 --- a/mysql-test/include/show_rpl_debug_info.inc +++ b/mysql-test/include/show_rpl_debug_info.inc @@ -50,7 +50,7 @@ eval SHOW BINLOG EVENTS IN '$binlog_name'; let $_master_con= $master_connection; if (!$_master_con) { - if (`SELECT '$_con' = 'slave'`) + if ($_con == slave) { let $_master_con= master; } @@ -80,7 +80,7 @@ if ($_master_con) --echo --echo **** SHOW BINLOG EVENTS on $_master_con **** eval SHOW BINLOG EVENTS IN '$master_binlog_name_sql'; - if (`SELECT '$master_binlog_name_io' != '$master_binlog_name_sql'`) + if ($master_binlog_name_io != $master_binlog_name_sql) { eval SHOW BINLOG EVENTS IN '$master_binlog_name_io'; } diff --git a/mysql-test/include/truncate_file.inc b/mysql-test/include/truncate_file.inc index c82108681bd..2326d6c0b94 100644 --- a/mysql-test/include/truncate_file.inc +++ b/mysql-test/include/truncate_file.inc @@ -1,6 +1,6 @@ # truncate a giving file, all contents of the file are be cleared -if (`SELECT 'x$file' = 'x'`) +if (!$file) { --echo Please assign a file name to $file!! exit; diff --git a/mysql-test/include/wait_for_slave_io_to_stop.inc b/mysql-test/include/wait_for_slave_io_to_stop.inc index f61b0db1ed7..512bb6b7243 100644 --- a/mysql-test/include/wait_for_slave_io_to_stop.inc +++ b/mysql-test/include/wait_for_slave_io_to_stop.inc @@ -14,7 +14,7 @@ # if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE # STATUS will return an empty set. let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1); -if (`SELECT '$_slave_io_running' != 'No such row'`) +if ($_slave_io_running != No such row) { let $slave_param= Slave_IO_Running; let $slave_param_value= No; diff --git a/mysql-test/include/wait_for_slave_sql_error.inc b/mysql-test/include/wait_for_slave_sql_error.inc index 80836f908c6..3ae34b1fb9e 100644 --- a/mysql-test/include/wait_for_slave_sql_error.inc +++ b/mysql-test/include/wait_for_slave_sql_error.inc @@ -34,7 +34,7 @@ let $slave_error_message= Failed while waiting for slave to stop the SQL thread source include/wait_for_slave_param.inc; let $_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1); -if (`SELECT '$_error' != '$slave_sql_errno'`) { +if ($_error != $slave_sql_errno) { --echo **** Slave stopped with wrong error code: $_error (expected $slave_sql_errno) **** source include/show_rpl_debug_info.inc; --echo **** Slave stopped with wrong error code: $_error (expected $slave_sql_errno) **** diff --git a/mysql-test/include/wait_for_slave_sql_to_stop.inc b/mysql-test/include/wait_for_slave_sql_to_stop.inc index 6992613b646..50bf53e421d 100644 --- a/mysql-test/include/wait_for_slave_sql_to_stop.inc +++ b/mysql-test/include/wait_for_slave_sql_to_stop.inc @@ -14,7 +14,7 @@ # if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE # STATUS will return an empty set. let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1); -if (`SELECT '$_slave_io_running' != 'No such row'`) +if ($_slave_io_running != No such row) { let $slave_param= Slave_SQL_Running; let $slave_param_value= No; diff --git a/mysql-test/include/wait_for_slave_to_stop.inc b/mysql-test/include/wait_for_slave_to_stop.inc index 56d0e7b0c91..618c5397cb7 100644 --- a/mysql-test/include/wait_for_slave_to_stop.inc +++ b/mysql-test/include/wait_for_slave_to_stop.inc @@ -14,7 +14,7 @@ # if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE # STATUS will return an empty set. let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1); -if (`SELECT '$_slave_io_running' != 'No such row'`) +if ($_slave_io_running != No such row) { let $slave_error_message= Failed while waiting for slave to stop; diff --git a/mysql-test/include/wait_show_condition.inc b/mysql-test/include/wait_show_condition.inc index f683ca7b47b..6bb89ff70b6 100644 --- a/mysql-test/include/wait_show_condition.inc +++ b/mysql-test/include/wait_show_condition.inc @@ -50,7 +50,7 @@ inc $max_run_time; let $found= 0; let $max_end_time= `SELECT UNIX_TIMESTAMP() + $max_run_time`; -if (`SELECT '$wait_for_all' != '1'`) +if ($wait_for_all != 1) { while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`) { @@ -58,24 +58,27 @@ if (`SELECT '$wait_for_all' != '1'`) real_sleep 0.2; let $rowno= 1; let $process_result= 1; - while (`SELECT $process_result = 1 AND $found = 0`) + let $do_loop= 1; + while ($do_loop) { let $field_value= query_get_value($show_statement, $field, $rowno); if (`SELECT '$field_value' $condition`) { let $found= 1; + let $do_loop= 0; } - if (`SELECT '$field_value' = 'No such row'`) + if ($field_value == No such row) { # We are behind the last row of the result set. let $process_result= 0; + let $do_loop= 0; } inc $rowno; } } } -if (`SELECT '$wait_for_all' = '1'`) +if ($wait_for_all == 1) { while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`) { @@ -83,16 +86,19 @@ if (`SELECT '$wait_for_all' = '1'`) real_sleep 0.2; let $rowno= 1; let $process_result= 1; - while (`SELECT $process_result = 1 AND $found = 0`) + let $do_loop= 1; + while ($do_loop) { let $field_value= query_get_value($show_statement, $field, $rowno); - if (`SELECT '$field_value' = 'No such row'`) + if ($field_value == No such row) { let $found= 1; + let $do_loop= 0; } if (`SELECT $found = 0 AND NOT '$field_value' $condition`) { let process_result= 0; + let $do_loop= 0; } inc $rowno; } diff --git a/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test b/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test index 6682d84d9c9..2e3e53b86f1 100644 --- a/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test +++ b/mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test @@ -83,17 +83,17 @@ while($i) -- let $flags=--database=b42941 # construct CLI for mysqlbinlog - if(`SELECT $i=3`) + if($i==3) { -- let $flags= $flags --verbose --hexdump } - if(`SELECT $i=2`) + if($i==2) { -- let $flags= $flags --verbose } -# if(`SELECT $i=1`) +# if($i==1) # { # do nothing $flags is already set as it should be # } diff --git a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test index a2f6afc1004..85571a6c582 100644 --- a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test +++ b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test @@ -116,7 +116,7 @@ DROP TABLE t1; SET GLOBAL log_warnings = @old_log_warnings; let $log_error_= `SELECT @@GLOBAL.log_error`; -if(!`select LENGTH('$log_error_')`) +if(!$log_error_) { # MySQL Server on windows is started with --console and thus # does not know the location of its .err log, use default location diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test index 5c649477dd8..7d10bb73824 100644 --- a/mysql-test/suite/binlog/t/binlog_unsafe.test +++ b/mysql-test/suite/binlog/t/binlog_unsafe.test @@ -141,11 +141,11 @@ END| # In each iteration of this loop, we select one method to make the # statement unsafe. --let $unsafe_type= 0 -while (`SELECT $unsafe_type < 9`) { +while ($unsafe_type < 9) { --echo - if (`SELECT $unsafe_type = 0`) { + if ($unsafe_type == 0) { --echo ==== Testing UUID() unsafeness ==== --let $desc_0= unsafe UUID() function --let $stmt_sidef_0= INSERT INTO t0 VALUES (UUID()) @@ -155,7 +155,7 @@ while (`SELECT $unsafe_type < 9`) { --let $CRC_ARG_expected_number_of_warnings= 1 } - if (`SELECT $unsafe_type = 1`) { + if ($unsafe_type == 1) { --echo ==== Testing @@hostname unsafeness ==== --let $desc_0= unsafe @@hostname variable --let $stmt_sidef_0= INSERT INTO t0 VALUES (@@hostname) @@ -168,7 +168,7 @@ while (`SELECT $unsafe_type < 9`) { --let $CRC_ARG_expected_number_of_warnings= 1 } - if (`SELECT $unsafe_type = 2`) { + if ($unsafe_type == 2) { --echo ==== Testing SELECT...LIMIT unsafeness ==== --let $desc_0= unsafe SELECT...LIMIT statement --let $stmt_sidef_0= INSERT INTO t0 SELECT * FROM data_table LIMIT 1 @@ -178,7 +178,7 @@ while (`SELECT $unsafe_type < 9`) { --let $CRC_ARG_expected_number_of_warnings= 1 } - if (`SELECT $unsafe_type = 3`) { + if ($unsafe_type == 3) { --echo ==== Testing INSERT DELAYED safeness after BUG#54579 is fixed ==== --let $desc_0= unsafe INSERT DELAYED statement --let $stmt_sidef_0= INSERT DELAYED INTO t0 VALUES (1), (2) @@ -188,7 +188,7 @@ while (`SELECT $unsafe_type < 9`) { --let $CRC_ARG_expected_number_of_warnings= 0 } - if (`SELECT $unsafe_type = 4`) { + if ($unsafe_type == 4) { --echo ==== Testing unsafeness of insert of two autoinc values ==== --let $desc_0= unsafe update of two autoinc columns --let $stmt_sidef_0= INSERT INTO double_autoinc_table VALUES (NULL) @@ -198,7 +198,7 @@ while (`SELECT $unsafe_type < 9`) { --let $CRC_ARG_expected_number_of_warnings= 1 } - if (`SELECT $unsafe_type = 5`) { + if ($unsafe_type == 5) { --echo ==== Testing unsafeness of UDF's ==== --let $desc_0= unsafe UDF --let $stmt_sidef_0= INSERT INTO t0 VALUES (myfunc_int(10)) @@ -208,7 +208,7 @@ while (`SELECT $unsafe_type < 9`) { --let $CRC_ARG_expected_number_of_warnings= 1 } - if (`SELECT $unsafe_type = 6`) { + if ($unsafe_type == 6) { --echo ==== Testing unsafeness of access to mysql.general_log ==== --let $desc_0= unsafe use of mysql.general_log --let $stmt_sidef_0= INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log @@ -218,7 +218,7 @@ while (`SELECT $unsafe_type < 9`) { --let $CRC_ARG_expected_number_of_warnings= 1 } - if (`SELECT $unsafe_type = 7`) { + if ($unsafe_type == 7) { --echo ==== Testing a statement that is unsafe in many ways ==== --let $desc_0= statement that is unsafe in many ways # Concatenate three unsafe values, and then concatenate NULL to @@ -230,7 +230,7 @@ while (`SELECT $unsafe_type < 9`) { --let $CRC_ARG_expected_number_of_warnings= 6 } - if (`SELECT $unsafe_type = 8`) { + if ($unsafe_type == 8) { --echo ==== Testing a statement that is unsafe several times ==== --let $desc_0= statement that is unsafe several times --let $stmt_sidef_0= INSERT INTO ta0 VALUES (multi_unsafe_func()) @@ -249,7 +249,7 @@ while (`SELECT $unsafe_type < 9`) { # construct. Instead, we just invoke the unsafe statement directly. --let $call_type_1= 0 - while (`SELECT $call_type_1 < 8`) { + while ($call_type_1 < 8) { #--echo debug: level 1, types $call_type_1 -> $unsafe_type --let $CRC_ARG_level= 1 --let $CRC_ARG_type= $call_type_1 @@ -280,7 +280,7 @@ while (`SELECT $unsafe_type < 9`) { # construct. --let $call_type_2= 0 - while (`SELECT $call_type_2 < 7`) { + while ($call_type_2 < 7) { #--echo debug: level 2, types $call_type_2 -> $call_type_1 -> $unsafe_type --let $CRC_ARG_level= 2 --let $CRC_ARG_type= $call_type_2 @@ -309,7 +309,7 @@ while (`SELECT $unsafe_type < 9`) { # construct. --let $call_type_3= 0 - while (`SELECT $call_type_3 < 7`) { + while ($call_type_3 < 7) { #--echo debug: level 3, types $call_type_2 -> $call_type_2 -> $call_type_1 -> $unsafe_type --let $CRC_ARG_level= 3 --let $CRC_ARG_type= $call_type_3 diff --git a/mysql-test/suite/federated/federated_bug_25714.test b/mysql-test/suite/federated/federated_bug_25714.test index 82745b2a094..633e469f595 100644 --- a/mysql-test/suite/federated/federated_bug_25714.test +++ b/mysql-test/suite/federated/federated_bug_25714.test @@ -1,5 +1,5 @@ # Check that path to the specific test program has been setup -if (`select LENGTH("$MYSQL_BUG25714") = 0`) +if (!$MYSQL_BUG25714) { skip Need bug25714 test program; } diff --git a/mysql-test/suite/perfschema_stress/t/modify.test b/mysql-test/suite/perfschema_stress/t/modify.test index 08b0699ace6..f37255c6b09 100644 --- a/mysql-test/suite/perfschema_stress/t/modify.test +++ b/mysql-test/suite/perfschema_stress/t/modify.test @@ -19,7 +19,7 @@ let $have_table= `SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'`; -if (`SELECT ($have_table = 0)`) { +if (!$have_table) { --source suite/perfschema_stress/t/setup.test } diff --git a/mysql-test/suite/perfschema_stress/t/setup.test b/mysql-test/suite/perfschema_stress/t/setup.test index 9f643edfebe..e55ed5e8630 100644 --- a/mysql-test/suite/perfschema_stress/t/setup.test +++ b/mysql-test/suite/perfschema_stress/t/setup.test @@ -23,10 +23,10 @@ if (`SELECT VERSION() LIKE '%embedded%'`) --disable_query_log --disable_result_log -if (`SELECT LENGTH('$engine_type') = 0`) { +if (!$engine_type) { let $engine_type= $default_engine_type; } -if (`SELECT '$engine_type' = 'Falcon'`) { +if ($engine_type == Falcon) { --source include/have_falcon.inc } diff --git a/mysql-test/suite/perfschema_stress/t/work.test b/mysql-test/suite/perfschema_stress/t/work.test index 8f1bc42c5bc..4408a00b0c9 100644 --- a/mysql-test/suite/perfschema_stress/t/work.test +++ b/mysql-test/suite/perfschema_stress/t/work.test @@ -19,7 +19,7 @@ let $have_table= `SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'`; -if (`SELECT ($have_table = 0)`) { +if (!$have_table) { --source suite/perfschema_stress/t/setup.test } diff --git a/mysql-test/suite/rpl/t/rpl_change_master.test b/mysql-test/suite/rpl/t/rpl_change_master.test index 514d6cf8c0f..5a8362e3df0 100644 --- a/mysql-test/suite/rpl/t/rpl_change_master.test +++ b/mysql-test/suite/rpl/t/rpl_change_master.test @@ -23,7 +23,7 @@ source include/stop_slave.inc; let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); -if (`SELECT $read_pos = $exec_pos`) +if ($read_pos == $exec_pos) { source include/show_rpl_debug_info.inc; echo 'Read_Master_Log_Pos: $read_pos' == 'Exec_Master_Log_Pos: $exec_pos'; @@ -32,7 +32,7 @@ if (`SELECT $read_pos = $exec_pos`) change master to master_user='root'; let $read_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); let $exec_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1); -if (`SELECT $read_pos <> $exec_pos`) +if ($read_pos != $exec_pos) { source include/show_rpl_debug_info.inc; echo 'Read_Master_Log_Pos: $read_pos' <> 'Exec_Master_Log_Pos: $exec_pos'; diff --git a/mysql-test/suite/rpl/t/rpl_concurrency_error.test b/mysql-test/suite/rpl/t/rpl_concurrency_error.test index 2e216d25211..8f5277b3f72 100644 --- a/mysql-test/suite/rpl/t/rpl_concurrency_error.test +++ b/mysql-test/suite/rpl/t/rpl_concurrency_error.test @@ -53,24 +53,24 @@ while ($type) { let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); connection conn1; - if (`select $type = 2`) + if ($type == 2) { SET AUTOCOMMIT = 1; BEGIN; } - if (`select $type = 1`) + if ($type == 1) { SET AUTOCOMMIT = 0; } eval UPDATE t SET f = 'yellow $type' WHERE i = 3; connection conn2; - if (`select $type = 2`) + if ($type == 2) { SET AUTOCOMMIT = 1; BEGIN; } - if (`select $type = 1`) + if ($type == 1) { SET AUTOCOMMIT = 0; } @@ -88,24 +88,24 @@ while ($type) let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); connection conn1; - if (`select $type = 2`) + if ($type == 2) { SET AUTOCOMMIT = 1; BEGIN; } - if (`select $type = 1`) + if ($type == 1) { SET AUTOCOMMIT = 0; } eval UPDATE t SET f = 'gray $type' WHERE i = 3; connection conn2; - if (`select $type = 2`) + if ($type == 2) { SET AUTOCOMMIT = 1; BEGIN; } - if (`select $type = 1`) + if ($type == 1) { SET AUTOCOMMIT = 0; } diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat.test b/mysql-test/suite/rpl/t/rpl_heartbeat.test index 59c3e10915e..5862abf5c6b 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat.test @@ -142,7 +142,7 @@ source include/check_slave_param.inc; let $slave_wait_param_counter= 300; let $slave_value= query_get_value("SHOW STATUS like 'Slave_received_heartbeats'", Value, 1); # Checking the fact that at least one heartbeat is received -while (`select $slave_value = 0`) +while (!$slave_value) { dec $slave_wait_param_counter; if (!$slave_wait_param_counter) diff --git a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test index 8797da4eccc..3790bed029d 100644 --- a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test +++ b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test @@ -30,7 +30,7 @@ sync_slave_with_master; connection master; let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1); -if (`SELECT '$before_position'='$after_position'`) +if ($before_position == $after_position) { echo Master position is not changed; } @@ -48,7 +48,7 @@ connection master; let $after_file= query_get_value(SHOW MASTER STATUS, File, 1); let $after_position= query_get_value(SHOW MASTER STATUS, Position, 1); -if (!`SELECT '$before_position'='$after_position'`) +if ($before_position != $after_position) { echo Master position has been changed; } diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test index 1bf4f1a3396..47a54fc72e6 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test @@ -58,7 +58,7 @@ echo [ on master ]; disable_query_log; let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1); -if (`select '$value' = 'No such row'`) +if ($value == No such row) { set sql_log_bin=0; eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; @@ -123,7 +123,7 @@ echo [ on slave ]; disable_query_log; let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1); -if (`select '$value' = 'No such row'`) +if ($value == No such row) { set sql_log_bin=0; eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN'; diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test index feb885ce07b..3499b846c31 100644 --- a/mysql-test/suite/rpl/t/rpl_semi_sync_event.test +++ b/mysql-test/suite/rpl/t/rpl_semi_sync_event.test @@ -20,7 +20,7 @@ enable_query_log; connection master; disable_query_log; let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1); -if (`select '$value' = 'No such row'`) +if ($value == No such row) { set sql_log_bin=0; eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN'; @@ -34,7 +34,7 @@ source include/stop_slave.inc; disable_query_log; let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1); -if (`select '$value' = 'No such row'`) +if ($value == No such row) { set sql_log_bin=0; eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN'; diff --git a/mysql-test/suite/rpl/t/rpl_slow_query_log.test b/mysql-test/suite/rpl/t/rpl_slow_query_log.test index 334c4393b83..b1ea55ee8ee 100644 --- a/mysql-test/suite/rpl/t/rpl_slow_query_log.test +++ b/mysql-test/suite/rpl/t/rpl_slow_query_log.test @@ -233,7 +233,7 @@ let $master_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text -- sync_slave_with_master let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`; -if (`SELECT $master_slow_query != $slave_slow_query`) +if ($master_slow_query != $slave_slow_query) { -- connection master -- echo *********************************************** @@ -250,7 +250,7 @@ if (`SELECT $master_slow_query != $slave_slow_query`) -- die "Assertion failed! Master and slave slow log contents differ. Bailing out!" } -if (`SELECT $master_slow_query = $slave_slow_query`) +if ($master_slow_query == $slave_slow_query) { -- echo ### Assertion is good. Both Master and Slave exhibit the -- echo ### same number of queries in slow log: $master_slow_query @@ -276,7 +276,7 @@ let $master_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text -- sync_slave_with_master let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`; -if (`SELECT $master_slow_query != $slave_slow_query`) +if ($master_slow_query != $slave_slow_query) { -- connection master -- echo *********************************************** @@ -293,7 +293,7 @@ if (`SELECT $master_slow_query != $slave_slow_query`) -- die "Assertion failed! Master and slave slow log contents differ. Bailing out!" } -if (`SELECT $master_slow_query = $slave_slow_query`) +if ($master_slow_query == $slave_slow_query) { -- echo ### Assertion is good. Both Master and Slave exhibit the -- echo ### same number of queries in slow log: $master_slow_query diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test index 0f216983a32..38a61e07358 100644 --- a/mysql-test/suite/rpl/t/rpl_ssl.test +++ b/mysql-test/suite/rpl/t/rpl_ssl.test @@ -75,7 +75,7 @@ source include/check_slave_is_running.inc; let $slave_count= `select count(*) from t1`; -if (`select $slave_count != $master_count`) +if ($slave_count != $master_count) { echo master and slave differed in number of rows; echo master: $master_count; diff --git a/mysql-test/suite/sys_vars/t/slow_launch_time_func.test b/mysql-test/suite/sys_vars/t/slow_launch_time_func.test index c9a7d28bb8a..1f384888f81 100644 --- a/mysql-test/suite/sys_vars/t/slow_launch_time_func.test +++ b/mysql-test/suite/sys_vars/t/slow_launch_time_func.test @@ -84,7 +84,7 @@ let $value_before= CONNECT (conn2,localhost,root,,); let $value_after= query_get_value(show status like 'slow_launch_threads', Value, 1); -if (!`SELECT $value_after = $value_before`) +if ($value_after != $value_before) { --echo ERROR: Subtest FN_DYNVARS_124_02 failed --echo A new connect must not be counted as 'slow_launch_thread' if diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test index ed2e1d05f86..1879dbc53cf 100644 --- a/mysql-test/t/change_user.test +++ b/mysql-test/t/change_user.test @@ -117,7 +117,7 @@ let $before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_select',Value,1); let $after= query_get_value(SHOW GLOBAL STATUS LIKE 'com_select',Value,1); -if (`select $after != $before`){ +if ($after != $before){ SHOW GLOBAL STATUS LIKE 'com_select'; die The value of com_select changed during change_user; } diff --git a/mysql-test/t/execution_constants.test b/mysql-test/t/execution_constants.test index e61d79f5249..92b1deb9921 100644 --- a/mysql-test/t/execution_constants.test +++ b/mysql-test/t/execution_constants.test @@ -49,7 +49,7 @@ while ($i) let $i = 1// # Check that mysql_errno is 1436 - if (`select $mysql_errno != 1436`) + if ($mysql_errno != 1436) { die Wrong error triggered, expected 1436 but got $mysql_errno// } diff --git a/mysql-test/t/fix_priv_tables.test b/mysql-test/t/fix_priv_tables.test index eeda9bc8d15..f68c8b518c8 100644 --- a/mysql-test/t/fix_priv_tables.test +++ b/mysql-test/t/fix_priv_tables.test @@ -3,7 +3,7 @@ # Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set # to the location of mysql_fix_privilege_tables.sql -if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`) +if (!$MYSQL_FIX_PRIVILEGE_TABLES) { skip Test need MYSQL_FIX_PRIVILEGE_TABLES; } diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 9b8a45d6a87..d6fb695274d 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -2612,15 +2612,15 @@ let $count= 0; while ($run) { let $Field= query_get_value($show_statement, Field, $rowno); - if (`SELECT '$Field' = 'No such row'`) + if ($Field == No such row) { let $run= 0; } - if (`SELECT '$Field' <> 'No such row'`) + if ($Field != No such row) { let $Type= query_get_value($show_statement, Type, $rowno); let $Null= query_get_value($show_statement, Null, $rowno); - if (`SELECT '$Null' = 'YES'`) + if ($Null == YES) { inc $count; } diff --git a/mysql-test/t/named_pipe.test b/mysql-test/t/named_pipe.test index e88fd8e1ef8..0e6c963024f 100644 --- a/mysql-test/t/named_pipe.test +++ b/mysql-test/t/named_pipe.test @@ -5,7 +5,7 @@ # Only run this test if named pipe is avaliable let $nmp= query_get_value("SHOW VARIABLES LIKE 'named_pipe'", Value, 1); -if (`SELECT '$nmp' != 'ON'`){ +if ($nmp != ON){ skip No named pipe support; } diff --git a/mysql-test/t/shm.test b/mysql-test/t/shm.test index 567caa4989a..0f880e58741 100644 --- a/mysql-test/t/shm.test +++ b/mysql-test/t/shm.test @@ -4,7 +4,7 @@ # Only run this test if shared memory is avaliable let $shm= query_get_value("SHOW VARIABLES LIKE 'shared_memory'", Value, 1); -if (`SELECT '$shm' != 'ON'`){ +if ($shm != ON){ skip No shm support; } let $shm_name= query_get_value("SHOW GLOBAL VARIABLES LIKE 'shared_memory_base_name'", Value, 1); diff --git a/mysql-test/t/system_mysql_db_fix40123.test b/mysql-test/t/system_mysql_db_fix40123.test index d069271a02e..e7a90f23784 100644 --- a/mysql-test/t/system_mysql_db_fix40123.test +++ b/mysql-test/t/system_mysql_db_fix40123.test @@ -3,7 +3,7 @@ # Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set # to the location of mysql_fix_privilege_tables.sql -if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`) +if (!$MYSQL_FIX_PRIVILEGE_TABLES) { skip Test need MYSQL_FIX_PRIVILEGE_TABLES; } diff --git a/mysql-test/t/system_mysql_db_fix50030.test b/mysql-test/t/system_mysql_db_fix50030.test index 53166919f1c..fbbc211649a 100644 --- a/mysql-test/t/system_mysql_db_fix50030.test +++ b/mysql-test/t/system_mysql_db_fix50030.test @@ -3,7 +3,7 @@ # Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set # to the location of mysql_fix_privilege_tables.sql -if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`) +if (!$MYSQL_FIX_PRIVILEGE_TABLES) { skip Test needs MYSQL_FIX_PRIVILEGE_TABLES; } diff --git a/mysql-test/t/system_mysql_db_fix50117.test b/mysql-test/t/system_mysql_db_fix50117.test index 872829ae79d..b4bac6a65da 100644 --- a/mysql-test/t/system_mysql_db_fix50117.test +++ b/mysql-test/t/system_mysql_db_fix50117.test @@ -3,7 +3,7 @@ # Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set # to the location of mysql_fix_privilege_tables.sql -if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`) +if (!$MYSQL_FIX_PRIVILEGE_TABLES) { skip Test needs MYSQL_FIX_PRIVILEGE_TABLES; }