Commit 0b2ba820 authored by unknown's avatar unknown

WL#3072 Maria recovery

* testing of execution of UNDO_ROW_UPDATE
* when executing an UNDO_ROW_UPDATE, store "UNDO_ROW_UPDATE" as
"type of undone record" into the CLR_END record.


storage/maria/ma_blockrec.c:
  When logging a CLR_END in write_block_record(), it can be for
  a DELETE or for an UPDATE (now that Monty has coded execution of
  UNDO_UPDATE)
storage/maria/ma_loghandler.c:
  UNDO_ROW_UPDATE's execution coded, so no crash
storage/maria/ma_recovery.c:
  UNDO_ROW_UPDATE's execution now coded, so no crash
storage/maria/ma_test1.c:
  upper case letter
storage/maria/ma_test_recovery.expected:
  output of testing execution of UNDO_ROW_UPDATE. Table's checksum
  not recovered (known issue not specific to UPDATE).
storage/maria/ma_test_recovery:
  Test execution of UNDO_ROW_UPDATE: first we stop ma_test1 after
  deletes and commit, then we stop ma_test1 after updates and abort;
  we verify that updates are rolled back by comparing tables
parent 0611f7bf
...@@ -2347,8 +2347,8 @@ static my_bool write_block_record(MARIA_HA *info, ...@@ -2347,8 +2347,8 @@ static my_bool write_block_record(MARIA_HA *info,
in the first/second case, Recovery, when it sees the CLR_END in the in the first/second case, Recovery, when it sees the CLR_END in the
REDO phase, may decrement/increment the records' count. REDO phase, may decrement/increment the records' count.
*/ */
/** @todo when Monty has UNDO_UPDATE coded, revisit this */ log_data[LSN_STORE_SIZE + FILEID_STORE_SIZE]= old_record ?
log_data[LSN_STORE_SIZE + FILEID_STORE_SIZE]= LOGREC_UNDO_ROW_DELETE; LOGREC_UNDO_ROW_UPDATE : LOGREC_UNDO_ROW_DELETE;
log_array[TRANSLOG_INTERNAL_PARTS + 0].str= (char*) log_data; log_array[TRANSLOG_INTERNAL_PARTS + 0].str= (char*) log_data;
log_array[TRANSLOG_INTERNAL_PARTS + 0].length= sizeof(log_data); log_array[TRANSLOG_INTERNAL_PARTS + 0].length= sizeof(log_data);
......
...@@ -6434,6 +6434,8 @@ static my_bool write_hook_for_clr_end(enum translog_record_type type ...@@ -6434,6 +6434,8 @@ static my_bool write_hook_for_clr_end(enum translog_record_type type
case LOGREC_UNDO_ROW_INSERT: case LOGREC_UNDO_ROW_INSERT:
tbl_info->s->state.state.records--; tbl_info->s->state.state.records--;
break; break;
case LOGREC_UNDO_ROW_UPDATE:
break;
default: default:
DBUG_ASSERT(0); DBUG_ASSERT(0);
} }
......
...@@ -979,6 +979,8 @@ prototype_redo_exec_hook(CLR_END) ...@@ -979,6 +979,8 @@ prototype_redo_exec_hook(CLR_END)
case LOGREC_UNDO_ROW_INSERT: case LOGREC_UNDO_ROW_INSERT:
info->s->state.state.records--; info->s->state.state.records--;
break; break;
case LOGREC_UNDO_ROW_UPDATE:
break;
default: default:
DBUG_ASSERT(0); DBUG_ASSERT(0);
} }
......
...@@ -248,7 +248,7 @@ static int run_test(const char *filename) ...@@ -248,7 +248,7 @@ static int run_test(const char *filename)
if (testflag == 2) if (testflag == 2)
{ {
printf("terminating after inserts\n"); printf("Terminating after inserts\n");
goto end; goto end;
} }
...@@ -309,7 +309,7 @@ static int run_test(const char *filename) ...@@ -309,7 +309,7 @@ static int run_test(const char *filename)
if (testflag == 3) if (testflag == 3)
{ {
printf("Terminating after update\n"); printf("Terminating after updates\n");
goto end; goto end;
} }
if (!silent) if (!silent)
...@@ -372,7 +372,7 @@ static int run_test(const char *filename) ...@@ -372,7 +372,7 @@ static int run_test(const char *filename)
if (testflag == 4) if (testflag == 4)
{ {
printf("terminating after deletes\n"); printf("Terminating after deletes\n");
goto end; goto end;
} }
......
...@@ -131,7 +131,7 @@ do ...@@ -131,7 +131,7 @@ do
for test_undo in 1 2 3 for test_undo in 1 2 3
do do
# first iteration tests rollback of insert, second tests rollback of delete # first iteration tests rollback of insert, second tests rollback of delete
set -- "ma_test1 $silent -M -T -c -N $blobs" "--testflag=1" "--testflag=2" "ma_test1 $silent -M -T -c -N --debug=d:t:i:o,/tmp/ma_test1.trace $blobs" "--testflag=3" "--testflag=4" set -- "ma_test1 $silent -M -T -c -N $blobs" "--testflag=1" "--testflag=2" "ma_test1 $silent -M -T -c -N --debug=d:t:i:o,/tmp/ma_test1.trace $blobs" "--testflag=3" "--testflag=4" "ma_test1 $silent -M -T -c -N --debug=d:t:i:o,/tmp/ma_test1.trace $blobs" "--testflag=2" "--testflag=3"
# -N (create NULL fields) is needed because --test-undo adds it anyway # -N (create NULL fields) is needed because --test-undo adds it anyway
while [ $# != 0 ] while [ $# != 0 ]
do do
......
This diff is collapsed.
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