MCPcopy Create free account
hub / github.com/MariaDB/server / open_binlog

Function open_binlog

sql/log.cc:3466–3499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3464
3465
3466File open_binlog(IO_CACHE *log, const char *log_file_name, const char **errmsg)
3467{
3468 File file;
3469 DBUG_ENTER("open_binlog");
3470
3471 if ((file= mysql_file_open(key_file_binlog,
3472 log_file_name, O_RDONLY | O_BINARY | O_SHARE,
3473 MYF(MY_WME))) < 0)
3474 {
3475 sql_print_error("Failed to open log (file '%s', errno %d)",
3476 log_file_name, my_errno);
3477 *errmsg = "Could not open log file";
3478 goto err;
3479 }
3480 if (init_io_cache_ext(log, file, (size_t)binlog_file_cache_size, READ_CACHE,
3481 0, 0, MYF(MY_WME|MY_DONT_CHECK_FILESIZE), key_file_binlog_cache))
3482 {
3483 sql_print_error("Failed to create a cache on log (file '%s')",
3484 log_file_name);
3485 *errmsg = "Could not open log file";
3486 goto err;
3487 }
3488 if (check_binlog_magic(log,errmsg))
3489 goto err;
3490 DBUG_RETURN(file);
3491
3492err:
3493 if (file >= 0)
3494 {
3495 mysql_file_close(file, MYF(0));
3496 end_io_cache(log);
3497 }
3498 DBUG_RETURN(-1);
3499}
3500
3501#ifdef _WIN32
3502static int eventSource = 0;

Callers 12

do_delete_gtid_domainFunction · 0.85
recoverMethod · 0.85
do_binlog_recoveryMethod · 0.85
gtid_check_binlog_fileFunction · 0.85
gtid_state_from_posFunction · 0.85
check_start_offsetFunction · 0.85
mysql_binlog_sendFunction · 0.85
mysql_show_binlog_eventsFunction · 0.85
retry_event_groupFunction · 0.85
reopen_relay_logFunction · 0.85
next_eventFunction · 0.85
init_relay_log_posFunction · 0.85

Calls 4

init_io_cache_extFunction · 0.85
check_binlog_magicFunction · 0.85
end_io_cacheFunction · 0.85
sql_print_errorFunction · 0.70

Tested by

no test coverage detected