mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Tests: many if/while expresissons simplified after 57276
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user