diff options
author | unknown <msvensson@pilot.blaudden> | 2007-02-26 09:16:22 +0100 |
---|---|---|
committer | unknown <msvensson@pilot.blaudden> | 2007-02-26 09:16:22 +0100 |
commit | 9d616d572cb118333fafc64ee4da910f61698e37 (patch) | |
tree | 77cf93fe40e43ef1208c1618911d8bb19f9f94b1 /mysql-test/include | |
parent | f80babd61720298f8e3862f21b1851203cbcf871 (diff) | |
download | mariadb-git-9d616d572cb118333fafc64ee4da910f61698e37.tar.gz |
Workaround non portable use of "grep" and "cut" by loading the whole processlist
into temporary table and selecting the correct row with SQL
Diffstat (limited to 'mysql-test/include')
-rw-r--r-- | mysql-test/include/get_binlog_dump_thread_id.inc | 19 |
1 files changed, 16 insertions, 3 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; |