#At file:///home/daogangqu/mysql/bzrwork/bug34739/mysql-5.1-bugteam/ based on revid:dao-gang.qu@stripped
3165 Dao-Gang.Qu@stripped 2009-10-29
Bug #34739 unexpected binlog file name when --log-bin is set to a directory name
If --log-bin is set to a directory name with the trailing "/",
the bare name of the binlog is empty so that the created files
named '.000001' and '.index'. It is not expected.
To resolve the problem, the program should report an error and
aborte, so that the user can get a clear prompt for correcting
it in time.
@ sql/mysqld.cc
Add a check for the value of the --log-bin argument, if it's
a directory, reports an error and aborts.
modified:
sql/mysqld.cc
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2009-10-27 13:20:34 +0000
+++ b/sql/mysqld.cc 2009-10-29 07:20:59 +0000
@@ -3888,6 +3888,16 @@ server.");
if (opt_bin_log)
{
+ /* Reports an error and aborts, if the --log-bin's path
+ is a directory.*/
+ if (opt_bin_logname[strlen(opt_bin_logname) - 1] == '/')
+ {
+ sql_print_error("File '%s' is a directory not a file name, \
+please specify a file name, like '/var/tmp/master-bin', \
+for the --log-bin's path.", opt_bin_logname);
+ unireg_abort(1);
+ }
+
char buf[FN_REFLEN];
const char *ln;
ln= mysql_bin_log.generate_name(opt_bin_logname, "-bin", 1, buf);
Attachment: [text/bzr-bundle] bzr/dao-gang.qu@sun.com-20091029072059-9w9mk9e17ghhuu1v.bundle