Commit 0f551def authored by Bjorn Munch's avatar Bjorn Munch

Tests: many if/while expresissons simplified after 57276

parent 97edfaf9
......@@ -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;
}
......
......@@ -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;
......
......@@ -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
......
......@@ -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;
......
......@@ -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
......
......@@ -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;
......
......@@ -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
......
......@@ -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)
}
......
......@@ -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;
......
......@@ -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.
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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)
}
......
......@@ -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;
}
......
......@@ -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)
}
......
......@@ -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)
}
......
......@@ -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
......
......@@ -5,8 +5,9 @@
# Therefore we require that the option "--big-test" is also set.
#
if (`SELECT $VALGRIND_TEST <> 0 AND '$BIG_TEST' = ''`)
{
if ($VALGRIND_TEST) {
if (!$BIG_TEST)
{
--skip Need "--big-test" when running with Valgrind
}
}
if (`SELECT '$MTR_PARALLEL' > 1`) {
if ($MTR_PARALLEL > 1) {
--skip test requires --parallel=1
}
......@@ -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))`
......
......@@ -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
......
......@@ -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';
}
......
# 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;
......
......@@ -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;
......
......@@ -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) ****
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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
# }
......
......@@ -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
......
......@@ -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
......
# 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;
}
......
......@@ -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
}
......
......@@ -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
}
......
......@@ -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
}
......
......@@ -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';
......
......@@ -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;
}
......
......@@ -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)
......
......@@ -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;
}
......
......@@ -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';
......
......@@ -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';
......
......@@ -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
......
......@@ -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;
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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//
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
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