summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <mats@mysql.com>2005-02-04 14:29:54 +0100
committerunknown <mats@mysql.com>2005-02-04 14:29:54 +0100
commit00a71ae83ae3ddc6448852c31ad486025b5e197c (patch)
tree9fa50ef781df0de702f7c7d3f1ec64220ff94b08 /client
parent98f97f22603bed9d134a6312471a183d70fba5ba (diff)
downloadmariadb-git-00a71ae83ae3ddc6448852c31ad486025b5e197c.tar.gz
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. client/mysqlbinlog.cc: Reading from stdin instead of stdout [sic]. Not repositioning manually since my_b_read does that correctly. mysql-test/r/mysqlbinlog.result: Adding tests for reading from stdin. mysql-test/t/mysqlbinlog.test: Adding tests for reading from stdin.
Diffstat (limited to 'client')
-rw-r--r--client/mysqlbinlog.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index caf126f2830..3b107c80cfc 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -1121,15 +1121,15 @@ static int dump_local_log_entries(const char* logname)
}
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 @@ static int dump_local_log_entries(const char* logname)
}
}
}
- file->pos_in_file= start_position_mot;
- file->seek_not_done=0;
}
if (!description_event || !description_event->is_valid())