Bug #69565 use c exec call mysqlbinlog occurs errors
Submitted: 25 Jun 2013 8:31 Modified: 25 Jun 2013 8:45
Reporter: youfei patcher Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:5.6.10 OS:Linux
Assigned to: CPU Architecture:Any
Tags: mysqlbinlog

[25 Jun 2013 8:31] youfei patcher
Description:
code:

char * name[] = { "--raw","mysql-bin.000778", "--stop-never","--host=xxxx", "--user=xxx", "--port=xx", "--passw
ord='xxxx'", "--result-file=file", (char *)0 };

execv("/usr/local/mysql5.6.10/bin/mysqlbinlog", name);

print:

Warning: Using a password on the command line interface can be insecure.
--raw: File 'mysql-bin.000778' not found (Errcode: 2 - No such file or directory)

but, the binary log  file   exists in  mysql datadir:

-rw-rw---- 1 mysql mysql 1073741999 06-23 18:51 mysql-bin.000778

How to repeat:
char * name[] = { "--raw","mysql-bin.000778", "--stop-never","--host=xxxx", "--user=xxx", "--port=xx", "--passw
ord='xxxx'", "--result-file=file", (char *)0 };

execv("/usr/local/mysql5.6.10/bin/mysqlbinlog", name);
[25 Jun 2013 8:45] MySQL Verification Team
This is not a server bug.  I suggest you either give full absolute path to the binlog or make sure the binlog is in the current working directory `pwd`