~maria-captains/maria/5.1

Viewing all changes in revision 2502.1195.20.

  • Committer: Rohit Kalhans
  • Date: 2012-08-08 16:45:46 UTC
  • mto: (2502.1198.2 mysql-5.1)
  • mto: This revision was merged to the branch mainline in revision 3164.
  • Revision ID: rohit.kalhans@oracle.com-20120808164546-0424a4c33mx4xtam
BUG#11757312: MYSQLBINLOG DOES NOT ACCEPT INPUT FROM STDIN
WHEN STDIN IS A PIPE
            
Problem: Mysqlbinlog does not accept the input from STDIN when 
STDIN is a pipe. This prevents the users from passing the input file
through a shell pipe.    

Background: The my_seek() function does not check if the file descriptor
passed to it is regular (seekable) file. The check_header() function in
mysqlbinlog calls the my_b_seek() unconditionally and it fails when
the underlying file is a PIPE.  
            
Resolution: We resolve this problem by checking if the underlying file
is a regular file by using my_fstat() before calling my_b_seek(). 
If the underlying file is not seekable we skip the call to my_b_seek()
in check_header().

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: