Below is the list of changes that have just been committed into a local
5.0 repository of mats. When mats does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
ChangeSet
1.1816 05/02/04 14:29:54 mats@stripped +3 -0
Bug#7853 (mysqlbinlog does not accept input from stdin)
The utility 'mysqlbinlog' now accepts input from stdin. It can
now be used to read the output from, e.g., 'zcat' or other utility.
mysql-test/t/mysqlbinlog.test
1.13 05/02/04 14:29:47 mats@stripped +10 -0
Adding tests for reading from stdin.
mysql-test/r/mysqlbinlog.result
1.10 05/02/04 14:29:47 mats@stripped +10 -0
Adding tests for reading from stdin.
client/mysqlbinlog.cc
1.103 05/02/04 14:29:47 mats@stripped +3 -5
Reading from stdin instead of stdout [sic].
Not repositioning manually since my_b_read does that correctly.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: mats
# Host: romeo.kindahl.net
# Root: /home/bk/b7853-mysql-5.0
--- 1.102/client/mysqlbinlog.cc 2005-01-26 09:54:05 +01:00
+++ 1.103/client/mysqlbinlog.cc 2005-02-04 14:29:47 +01:00
@@ -1121,15 +1121,15 @@
}
check_header(file, &description_event);
}
- else // reading from stdin; TODO: check that it works
+ else // reading from stdin;
{
- if (init_io_cache(file, fileno(result_file), 0, READ_CACHE, (my_off_t) 0,
+ if (init_io_cache(file, fileno(stdin), 0, READ_CACHE, (my_off_t) 0,
0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE)))
return 1;
check_header(file, &description_event);
if (start_position)
{
- /* skip 'start_position' characters from stdout */
+ /* skip 'start_position' characters from stdin */
byte buff[IO_SIZE];
my_off_t length,tmp;
for (length= start_position_mot ; length > 0 ; length-=tmp)
@@ -1142,8 +1142,6 @@
}
}
}
- file->pos_in_file= start_position_mot;
- file->seek_not_done=0;
}
if (!description_event || !description_event->is_valid())
--- 1.9/mysql-test/r/mysqlbinlog.result 2004-07-15 03:18:42 +02:00
+++ 1.10/mysql-test/r/mysqlbinlog.result 2005-02-04 14:29:47 +01:00
@@ -96,4 +96,14 @@
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
insert into t1 values ("Alas");
+
+--- reading stdin --
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+use test;
+SET TIMESTAMP=1065204671;
+BEGIN;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+use test;
+SET TIMESTAMP=1065204671;
+BEGIN;
drop table t1, t2;
--- 1.12/mysql-test/t/mysqlbinlog.test 2004-07-06 13:34:09 +02:00
+++ 1.13/mysql-test/t/mysqlbinlog.test 2005-02-04 14:29:47 +01:00
@@ -95,5 +95,15 @@
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --position=118 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
+# Bug#7853 (mysqlbinlog does not accept input from stdin)
+--disable_query_log
+select "--- reading stdin --" as "";
+--enable_query_log
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--exec cat $MYSQL_TEST_DIR/std_data/trunc_binlog.000001 | $MYSQL_BINLOG --short-form -
+
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--exec cat $MYSQL_TEST_DIR/std_data/trunc_binlog.000001 | $MYSQL_BINLOG --short-form --position=79 -
+
# clean up
drop table t1, t2;
| Thread |
|---|
| • bk commit into 5.0 tree (mats:1.1816) | Mats Kindahl | 4 Feb |