WL#3072 - Maria recovery: safety assertions.

storage/maria/maria_read_log.c:
  assertions to protect against future bugs (especially, to ensure
  that replaying DROP TABLE, if implemented, wouldn't leave open tables
  behind it)
This commit is contained in:
unknown 2007-06-26 18:29:17 +02:00
parent adac9798bf
commit 79672e8c44

View file

@ -424,6 +424,7 @@ prototype_exec_hook(REDO_CREATE_TABLE)
info= maria_open(name, O_RDONLY, HA_OPEN_FOR_REPAIR); info= maria_open(name, O_RDONLY, HA_OPEN_FOR_REPAIR);
if (info) if (info)
{ {
DBUG_ASSERT(info->s->reopen == 1); /* check that we're not using it */
if (!info->s->base.transactional) if (!info->s->base.transactional)
{ {
/* /*
@ -437,8 +438,7 @@ prototype_exec_hook(REDO_CREATE_TABLE)
} }
if (cmp_translog_addr(info->s->state.create_rename_lsn, rec->lsn) >= 0) if (cmp_translog_addr(info->s->state.create_rename_lsn, rec->lsn) >= 0)
{ {
printf(", has create_rename_lsn (%lu,0x%lx) is more recent than log" printf(", has create_rename_lsn (%lu,0x%lx) is more recent than record",
" record\n",
(ulong) LSN_FILE_NO(rec->lsn), (ulong) LSN_FILE_NO(rec->lsn),
(ulong) LSN_OFFSET(rec->lsn)); (ulong) LSN_OFFSET(rec->lsn));
goto end; goto end;
@ -568,6 +568,7 @@ prototype_exec_hook(FILE_ID)
fprintf(stderr, "Table is crashed, can't apply log records to it\n"); fprintf(stderr, "Table is crashed, can't apply log records to it\n");
goto err; goto err;
} }
DBUG_ASSERT(info->s->reopen == 1); /* should always be only one instance */
if (!info->s->base.transactional) if (!info->s->base.transactional)
{ {
printf(", is not transactional\n"); printf(", is not transactional\n");