Commit 8f499c39 authored by Sergei Golubchik's avatar Sergei Golubchik

bug: debug assert crash when seek on log file fails

parent 5fd00883
...@@ -2359,6 +2359,7 @@ bool MYSQL_LOG::open( ...@@ -2359,6 +2359,7 @@ bool MYSQL_LOG::open(
char buff[FN_REFLEN]; char buff[FN_REFLEN];
MY_STAT f_stat; MY_STAT f_stat;
File file= -1; File file= -1;
my_off_t seek_offset;
int open_flags= O_CREAT | O_BINARY; int open_flags= O_CREAT | O_BINARY;
DBUG_ENTER("MYSQL_LOG::open"); DBUG_ENTER("MYSQL_LOG::open");
DBUG_PRINT("enter", ("log_type: %d", (int) log_type_arg)); DBUG_PRINT("enter", ("log_type: %d", (int) log_type_arg));
...@@ -2391,11 +2392,14 @@ bool MYSQL_LOG::open( ...@@ -2391,11 +2392,14 @@ bool MYSQL_LOG::open(
m_log_file_key= log_file_key; m_log_file_key= log_file_key;
#endif #endif
if ((file= mysql_file_open(log_file_key, if ((file= mysql_file_open(log_file_key, log_file_name, open_flags,
log_file_name, open_flags, MYF(MY_WME | ME_WAITTANG))) < 0)
MYF(MY_WME | ME_WAITTANG))) < 0 || goto err;
init_io_cache(&log_file, file, IO_SIZE, io_cache_type,
mysql_file_tell(file, MYF(MY_WME)), 0, if ((seek_offset= mysql_file_tell(file, MYF(MY_WME))))
goto err;
if (init_io_cache(&log_file, file, IO_SIZE, io_cache_type, seek_offset, 0,
MYF(MY_WME | MY_NABP | MYF(MY_WME | MY_NABP |
((log_type == LOG_BIN) ? MY_WAIT_IF_FULL : 0)))) ((log_type == LOG_BIN) ? MY_WAIT_IF_FULL : 0))))
goto err; goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment