List:Commits« Previous MessageNext Message »
From:Dao-Gang.Qu Date:November 5 2009 6:35am
Subject:bzr commit into mysql-pe branch (Dao-Gang.Qu:3666) Bug#34739
View as plain text  
#At file:///home/daogangqu/mysql/bzrwork/bug34739/mysql-pe/ based on revid:timothy.smith@stripped

 3666 Dao-Gang.Qu@stripped	2009-11-05 [merge]
      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 'FN_LIBCHAR', 
      which will be '/' on Unix like systems, and '\\' on Windows like systems. 
      the basename of the binlog is empty so that the created files named 
      '.000001' and '.index'. It is not expected. 
      The same thing happened to --log-bin-index, --relay-log and 
      --relay-log-index options.
      
      To resolve the problem, in these cases the program should report an error 
      and abort.
     @ sql/mysqld.cc
        Added a check for the value of the --log-bin and --log-bin-index arguments, 
        if it's a directory, reports an error and aborts.
     @ sql/rpl_rli.cc
        Added a check for the value of the --relay-log and --relay-log-index arguments, 
        if it's a directory, reports an error and aborts.

    modified:
      sql/mysqld.cc
      sql/rpl_rli.cc
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2009-11-03 10:27:17 +0000
+++ b/sql/mysqld.cc	2009-11-05 06:33:12 +0000
@@ -4199,6 +4199,27 @@ will be ignored as the --log-bin option 
 
   if (opt_bin_log)
   {
+    /* Reports an error and aborts, if the --log-bin's path 
+       is a directory.*/
+    if (opt_bin_logname && 
+        opt_bin_logname[strlen(opt_bin_logname) - 1] == FN_LIBCHAR)
+    {
+      sql_print_error("Path '%s' is a directory name, please specify \
+a file name for --log-bin option", opt_bin_logname);
+      unireg_abort(1);
+    }
+
+    /* Reports an error and aborts, if the --log-bin-index's path 
+       is a directory.*/
+    if (opt_binlog_index_name && 
+        opt_binlog_index_name[strlen(opt_binlog_index_name) - 1] 
+        == FN_LIBCHAR)
+    {
+      sql_print_error("Path '%s' is a directory name, please specify \
+a file name for --log-bin-index option", opt_binlog_index_name);
+      unireg_abort(1);
+    }
+
     char buf[FN_REFLEN];
     const char *ln;
     ln= mysql_bin_log.generate_name(opt_bin_logname, "-bin", 1, buf);

=== modified file 'sql/rpl_rli.cc'
--- a/sql/rpl_rli.cc	2009-10-26 14:02:26 +0000
+++ b/sql/rpl_rli.cc	2009-11-05 06:33:12 +0000
@@ -1018,6 +1018,27 @@ int Relay_log_info::init_info(bool abort
     relay_log.max_size (and mysql_bin_log.max_size).
   */
   {
+    /* Reports an error and returns, if the --relay-log's path 
+       is a directory.*/
+    if (opt_relay_logname &&
+        opt_relay_logname[strlen(opt_relay_logname) - 1] == FN_LIBCHAR)
+    {
+      sql_print_error("Path '%s' is a directory name, please specify \
+a file name for --relay-log option", opt_relay_logname);
+      DBUG_RETURN(1);
+    }
+
+    /* Reports an error and returns, if the --relay-log-index's path 
+       is a directory.*/
+    if (opt_relaylog_index_name &&
+        opt_relaylog_index_name[strlen(opt_relaylog_index_name) - 1]
+        == FN_LIBCHAR)
+    {
+      sql_print_error("Path '%s' is a directory name, please specify \
+a file name for --relay-log-index option", opt_relaylog_index_name);
+      DBUG_RETURN(1);
+    }
+
     char buf[FN_REFLEN];
     const char *ln;
     static bool name_warning_sent= 0;


Attachment: [text/bzr-bundle] bzr/dao-gang.qu@sun.com-20091105063312-o8mt69oppzs9o9g9.bundle
Thread
bzr commit into mysql-pe branch (Dao-Gang.Qu:3666) Bug#34739Dao-Gang.Qu5 Nov