diff options
author | unknown <bell@desktop.sanja.is.com.ua> | 2008-04-04 00:46:33 +0300 |
---|---|---|
committer | unknown <bell@desktop.sanja.is.com.ua> | 2008-04-04 00:46:33 +0300 |
commit | de4834090a6b1184bd5227b260f0425d6644b324 (patch) | |
tree | 61741fd45075077ce61ef4f3d82faeb437fafae6 /storage/maria/ma_loghandler.c | |
parent | 42f970de3c4234cc5dfd0b78c8c499c538079e9d (diff) | |
download | mariadb-git-de4834090a6b1184bd5227b260f0425d6644b324.tar.gz |
Fixed problem switching to the new file is file appeared
to be bigger then limit.
Diffstat (limited to 'storage/maria/ma_loghandler.c')
-rw-r--r-- | storage/maria/ma_loghandler.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c index b09bc45e7a7..ff2b2631064 100644 --- a/storage/maria/ma_loghandler.c +++ b/storage/maria/ma_loghandler.c @@ -4451,8 +4451,19 @@ static my_bool translog_advance_pointer(int pages, uint16 last_page_data) struct st_translog_buffer *new_buffer; struct st_translog_buffer *old_buffer; buffer_end_offset= TRANSLOG_WRITE_BUFFER - log_descriptor.bc.buffer->size; - file_end_offset= (log_descriptor.log_file_max_size - - LSN_OFFSET(log_descriptor.horizon)); + if (likely(log_descriptor.log_file_max_size >= + LSN_OFFSET(log_descriptor.horizon))) + file_end_offset= (log_descriptor.log_file_max_size - + LSN_OFFSET(log_descriptor.horizon)); + else + { + /* + We already have written more then current file limit allow, + So we will finish this page and start new file + */ + file_end_offset= (TRANSLOG_PAGE_SIZE - + log_descriptor.bc.current_page_fill); + } DBUG_PRINT("info", ("offset: %lu buffer_end_offs: %lu, " "file_end_offs: %lu", (ulong) offset, (ulong) buffer_end_offset, |