From 55dc3dcb82dc13b182c1b44006ec3bde6b83af18 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 29 Sep 2003 23:10:30 +0400 Subject: [PATCH] Added resetting of replace_result patterns after --exec command in mysqltest (in order to be consistent with ordinary query execution). client/mysqltest.c: Now resetting replace_result patterns after --exec command (in order to be consistent with ordinary query execution). mysql-test/t/mysqlbinlog.test: Added additional replaces potentially needed after adding reset of replace conditions for exec --- client/mysqltest.c | 4 ++++ mysql-test/t/mysqlbinlog.test | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/client/mysqltest.c b/client/mysqltest.c index fcb9bb7102e..fd1c928b4fd 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -866,6 +866,10 @@ int do_exec(struct st_query* q) while (fgets(buf, sizeof(buf), res_file)) replace_dynstr_append_mem(ds, buf, strlen(buf)); pclose(res_file); + + if (glob_replace) + free_replace(); + if (record) { if (!q->record_file[0] && !result_file) diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 736c5e32622..22b63146652 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -40,10 +40,12 @@ select "--- Local --" as ""; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.001 + # this should not fail but shouldn't produce any working statements --disable_query_log select "--- Broken LOAD DATA --" as ""; --enable_query_log +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.002 # this should show almost nothing @@ -73,24 +75,28 @@ select "--- Remote --" as ""; # This is broken now # By the way it seems that remote version fetches all events with name >= master-bin.001 +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --exec $MYSQL_BINLOG --short-form --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.001 # This is broken too --disable_query_log select "--- Broken LOAD DATA --" as ""; --enable_query_log +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --exec $MYSQL_BINLOG --short-form --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.002 # And this too ! (altough it is documented) --disable_query_log select "--- --database --" as ""; --enable_query_log +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --exec $MYSQL_BINLOG --short-form --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.001 # Strangely but this works --disable_query_log select "--- --position --" as ""; --enable_query_log +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --exec $MYSQL_BINLOG --short-form --position=27 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.002 # clean up