Commit 81e84a75 authored by unknown's avatar unknown

Infinite loop in case of given address more then last LSN fixed.


storage/maria/ma_loghandler.c:
  Infinite loop in case of given address more then last LSN fixed
  (now it means just flush all log).
  Removed unneeded ASSERT.
storage/maria/unittest/ma_test_loghandler-t.c:
  The test case of flushing all log added.
parent f3e957b7
...@@ -6546,7 +6546,8 @@ my_bool translog_flush(LSN lsn) ...@@ -6546,7 +6546,8 @@ my_bool translog_flush(LSN lsn)
struct st_translog_buffer *buffer= log_descriptor.bc.buffer; struct st_translog_buffer *buffer= log_descriptor.bc.buffer;
/* we can't flush in future */ /* we can't flush in future */
DBUG_ASSERT(cmp_translog_addr(log_descriptor.horizon, lsn) >= 0); DBUG_ASSERT(cmp_translog_addr(log_descriptor.horizon, lsn) >= 0);
if (cmp_translog_addr(log_descriptor.flushed, lsn) >= 0) if (cmp_translog_addr(log_descriptor.flushed, lsn) >= 0 ||
full_circle)
{ {
DBUG_PRINT("info", ("already flushed: (%lu,0x%lx)", DBUG_PRINT("info", ("already flushed: (%lu,0x%lx)",
LSN_IN_PARTS(log_descriptor.flushed))); LSN_IN_PARTS(log_descriptor.flushed)));
......
...@@ -185,7 +185,7 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -185,7 +185,7 @@ int main(int argc __attribute__((unused)), char *argv[])
/* Suppressing of automatic record writing */ /* Suppressing of automatic record writing */
trn->first_undo_lsn|= TRANSACTION_LOGGED_LONG_ID; trn->first_undo_lsn|= TRANSACTION_LOGGED_LONG_ID;
plan(((ITERATIONS - 1) * 4 + 1)*2 + ITERATIONS - 1); plan(((ITERATIONS - 1) * 4 + 1)*2 + ITERATIONS - 1 + 1);
srandom(122334817L); srandom(122334817L);
...@@ -335,6 +335,15 @@ int main(int argc __attribute__((unused)), char *argv[]) ...@@ -335,6 +335,15 @@ int main(int argc __attribute__((unused)), char *argv[])
ok(1, "flush"); ok(1, "flush");
} }
if (translog_flush(translog_get_horizon()))
{
fprintf(stderr, "Can't flush up to horizon\n", (ulong) i);
translog_destroy();
ok(0, "flush");
exit(1);
}
ok(1, "flush");
srandom(122334817L); srandom(122334817L);
rc= 1; rc= 1;
......
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