From 5068ef885454cc53c84abf9f4540c4b996ef9a03 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Mon, 26 Feb 2007 09:16:22 +0100 Subject: [PATCH 1/2] Workaround non portable use of "grep" and "cut" by loading the whole processlist into temporary table and selecting the correct row with SQL --- .../include/get_binlog_dump_thread_id.inc | 19 ++++++++++++++++--- mysql-test/r/rpl_temporary.result | 11 ++++++++++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/mysql-test/include/get_binlog_dump_thread_id.inc b/mysql-test/include/get_binlog_dump_thread_id.inc index 830a88b5db6..bfc8506b39e 100644 --- a/mysql-test/include/get_binlog_dump_thread_id.inc +++ b/mysql-test/include/get_binlog_dump_thread_id.inc @@ -1,9 +1,22 @@ ---exec $MYSQL test -e 'show processlist' | grep 'Binlog Dump' | cut -f1 > $MYSQLTEST_VARDIR/tmp/bl_dump_thread_id +--exec $MYSQL test -e "show processlist" > $MYSQLTEST_VARDIR/tmp/bl_dump_thread_id --disable_warnings drop table if exists t999; --enable_warnings -create temporary table t999 (f int); +# Create a table to hold the process list +create temporary table t999( + id int, + user char(255), + host char(255), + db char(255), + Command char(255), + time int, + State char(255), + info char(255) +); +# Load processlist into table, headers will create seom warnings +--disable_warnings --replace_result $MYSQLTEST_VARDIR "." eval LOAD DATA INFILE "$MYSQLTEST_VARDIR/tmp/bl_dump_thread_id" into table t999; -let $id = `select f from t999`; +--enable_warnings +let $id = `select Id from t999 where Command="Binlog Dump"`; drop table t999; diff --git a/mysql-test/r/rpl_temporary.result b/mysql-test/r/rpl_temporary.result index 751dc7754f7..15c069ab68d 100644 --- a/mysql-test/r/rpl_temporary.result +++ b/mysql-test/r/rpl_temporary.result @@ -92,7 +92,16 @@ create temporary table t3 (f int); create temporary table t4 (f int); create table t5 (f int); drop table if exists t999; -create temporary table t999 (f int); +create temporary table t999( +id int, +user char(255), +host char(255), +db char(255), +Command char(255), +time int, +State char(255), +info char(255) +); LOAD DATA INFILE "./tmp/bl_dump_thread_id" into table t999; drop table t999; insert into t4 values (1); From 1770993db7d3a24bf9a3f6930f75e3011ef7b8be Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Mon, 26 Feb 2007 09:24:03 +0100 Subject: [PATCH 2/2] Use binary file mode when writing the modified .TRG file to avoid CR/LF's being added on windows --- mysql-test/t/trigger-grant.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/t/trigger-grant.test b/mysql-test/t/trigger-grant.test index 53062dbc270..96bd6acd02d 100644 --- a/mysql-test/t/trigger-grant.test +++ b/mysql-test/t/trigger-grant.test @@ -241,6 +241,8 @@ open(FILE, "<", $fname) or die; my @content= grep($_ !~ /^definers=/, ); close FILE; open(FILE, ">", $fname) or die; +# Use binary file mode to avoid CR/LF's being added on windows +binmode FILE; print FILE @content; print FILE "definers='' '\@' '\@abc\@def\@\@' '\@hostname' '\@abcdef\@\@\@hostname'\n"; close FILE;