From a2a18beae925fc1a80ada24911fef839c2acbab2 Mon Sep 17 00:00:00 2001 From: Elshad Aghazade Date: Sat, 5 Nov 2016 02:28:38 +0400 Subject: [PATCH 1/2] Update fil0fil.cc --- storage/innobase/fil/fil0fil.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 9755ef2..1131bf0 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -3394,6 +3394,14 @@ fil_create_new_single_table_tablespace( remote directory, let's create the subdirectories in the path, if they are not there already. */ success = os_file_create_subdirs_if_needed(path); + + // bug fix for http://bugs.mysql.com/bug.php?id=79151 + if(!success && errno) { + my_error(ER_GET_ERRNO, MYF(0), errno); + mem_free(path); + return(DB_ERROR); + } + if (!success) { err = DB_ERROR; goto error_exit_3; From 7259be71ed2613e4af60243b1dc58b23e4fe08a9 Mon Sep 17 00:00:00 2001 From: Elshad Aghazade Date: Fri, 11 Nov 2016 22:53:57 +0400 Subject: [PATCH 2/2] Bug #71879 - Wrong binlog size reported after moving binlogs Problem was that after moving the bin log files to a new folder, real path of these files was wrong, for this reason program couldn't open and calculate its' size. I corrected files with wrong path, prepended full path of new binlog directory to these files. --- sql/rpl_master.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sql/rpl_master.cc b/sql/rpl_master.cc index f27e39a..6475e16 100644 --- a/sql/rpl_master.cc +++ b/sql/rpl_master.cc @@ -2247,6 +2247,19 @@ bool show_binlogs(THD* thd) file_length= cur.pos; /* The active log, use the active position */ else { + + // bug fix for http://bugs.mysql.com/bug.php?id=71879 + // if bin file path starts with ./ then we will prepend to it full path of binlog directory + if(fname[0] == '.' && fname[1] == '/') + { + std::string ofname(fname); + std::string bin_log_value(mysql_bin_log.get_name()); + std::size_t lpos = bin_log_value.find_last_of("/"); + std::string dir_path = bin_log_value.substr(0, lpos); + std::string full_path = dir_path + ofname.substr(1, ofname.length()); + strcpy(fname, full_path.c_str()); + } + /* this is an old log, open it and find the size */ if ((file= mysql_file_open(key_file_binlog, fname, O_RDONLY | O_SHARE | O_BINARY,