summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/log.cc b/sql/log.cc
index afd6c90e386..5019760cdbc 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -44,6 +44,8 @@
#include <my_dir.h>
#include <m_ctype.h> // For test_if_number
+#include <set_var.h> // for Sys_last_gtid_ptr
+
#ifdef _WIN32
#include "message.h"
#endif
@@ -2606,7 +2608,7 @@ bool MYSQL_LOG::open(
File file= -1;
my_off_t seek_offset;
bool is_fifo = false;
- int open_flags= O_CREAT | O_BINARY;
+ int open_flags= O_CREAT | O_BINARY | O_CLOEXEC;
DBUG_ENTER("MYSQL_LOG::open");
DBUG_PRINT("enter", ("log_type: %d", (int) log_type_arg));
@@ -3343,7 +3345,7 @@ bool MYSQL_BIN_LOG::open_index_file(const char *index_file_name_arg,
".index", opt);
if ((index_file_nr= mysql_file_open(m_key_file_log_index,
index_file_name,
- O_RDWR | O_CREAT | O_BINARY,
+ O_RDWR | O_CREAT | O_BINARY | O_CLOEXEC,
MYF(MY_WME))) < 0 ||
mysql_file_sync(index_file_nr, MYF(MY_WME)) ||
init_io_cache(&index_file, index_file_nr,
@@ -6010,7 +6012,8 @@ MYSQL_BIN_LOG::write_gtid_event(THD *thd, bool standalone,
}
if (err)
DBUG_RETURN(true);
- thd->last_commit_gtid= gtid;
+
+ thd->set_last_commit_gtid(gtid);
Gtid_log_event gtid_event(thd, seq_no, domain_id, standalone,
LOG_EVENT_SUPPRESS_USE_F, is_transactional,
@@ -9007,14 +9010,14 @@ int TC_LOG_MMAP::open(const char *opt_name)
tc_log_page_size= my_getpagesize();
fn_format(logname,opt_name,mysql_data_home,"",MY_UNPACK_FILENAME);
- if ((fd= mysql_file_open(key_file_tclog, logname, O_RDWR, MYF(0))) < 0)
+ if ((fd= mysql_file_open(key_file_tclog, logname, O_RDWR | O_CLOEXEC, MYF(0))) < 0)
{
if (my_errno != ENOENT)
goto err;
if (using_heuristic_recover())
return 1;
if ((fd= mysql_file_create(key_file_tclog, logname, CREATE_MODE,
- O_RDWR, MYF(MY_WME))) < 0)
+ O_RDWR | O_CLOEXEC, MYF(MY_WME))) < 0)
goto err;
inited=1;
file_length= opt_tc_log_size;