bool binlog_cache_data::init_file_reserved_bytes()
{ // Session's cache file is not created, so created here. if (cache_log.file == -1)
{ char name[FN_REFLEN];
/* Cache file is named with PREFIX + binlog_cache_data object's address */
snprintf(name, FN_REFLEN, "%s/%s_%llu", cache_log.dir, cache_log.prefix,
(ulonglong) this);
if ((cache_log.file=
mysql_file_open(0, name, O_CREAT | O_RDWR, MYF(MY_WME))) < 0)
{
sql_print_error("Failed to open binlog cache temporary file %s", name);
cache_log.error= -1; returntrue;
}
}
#ifdef WITH_WSREP /* WSREPcodeaccessescache_logdirectly,sodon'treservespaceifWSREPis on.
*/ if (unlikely(wsrep_on(current_thd))) returnfalse; #endif
/* Ifthebinlogcachedirexists,yetbinloggingisdisabled,deletethe directoryandskiptheinitializationlogic.
*/ if (!opt_bin_log)
{ if (dir_info)
{
sql_print_information( "Found binlog cache dir '%s', yet binary logging is " "disabled. Deleting directory.",
binlog_cache_dir);
my_dirend(dir_info);
my_rmtree(binlog_cache_dir, MYF(0));
}
memset(binlog_cache_dir, 0, sizeof(binlog_cache_dir)); returnfalse;
}
ignore_db_dirs_append(BINLOG_CACHE_DIR);
if (!dir_info)
{ /* Make a dir for binlog cache temp files if not exist. */ if (my_mkdir(binlog_cache_dir, 0777, MYF(0)) < 0)
{
sql_print_error("Could not create binlog cache dir %s.",
binlog_cache_dir); returntrue;
} returnfalse;
}
/* Try to delete all cache files in the directory. */ for (uint i= 0; i < dir_info->number_of_files; i++)
{
FILEINFO *file= dir_info->dir_entry + i;
if (strncmp(file->name, LOG_PREFIX, strlen(LOG_PREFIX)))
{
sql_print_warning("%s is in %s/, but it is not a binlog cache file",
file->name, BINLOG_CACHE_DIR); continue;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.