Commit 2cc2f3e7 authored by unknown's avatar unknown

Generalized the way update and redo extends the size of a directory record.


storage/maria/ma_blockrec.c:
  Generalized the way update and redo extends the size of a directory record.
  This will (for now) ensure that data files are idenitical after normal run and after a apply-log run.
storage/maria/ma_open.c:
  Disabled reservation of transid on rows (for now) as these are not yet used.
  (I had to disable this as otherwise update thougth rows had grown in size when they hadn't and we had thus different row sizes on update and redo, which caused different block information)
storage/maria/ma_test1.c:
  Added comment
storage/maria/ma_test2.c:
  Do commit on error/abort
storage/maria/ma_test_all.sh:
  Some more testing (to cover a bug that was not found in previous runs)
storage/maria/ma_test_recovery:
  More tests
parent f7b766c0
This diff is collapsed.
...@@ -600,7 +600,9 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) ...@@ -600,7 +600,9 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
if (share->base.born_transactional) if (share->base.born_transactional)
{ {
share->page_type= PAGECACHE_LSN_PAGE; share->page_type= PAGECACHE_LSN_PAGE;
#ifdef ENABLE_WHEN_WE_HAVE_TRANS_ROW_ID /* QQ */
share->base_length+= TRANS_ROW_EXTRA_HEADER_SIZE; share->base_length+= TRANS_ROW_EXTRA_HEADER_SIZE;
#endif
if (unlikely((share->state.create_rename_lsn == (LSN)ULONGLONG_MAX) && if (unlikely((share->state.create_rename_lsn == (LSN)ULONGLONG_MAX) &&
(open_flags & HA_OPEN_FROM_SQL_LAYER))) (open_flags & HA_OPEN_FROM_SQL_LAYER)))
{ {
......
...@@ -633,7 +633,7 @@ static struct my_option my_long_options[] = ...@@ -633,7 +633,7 @@ static struct my_option my_long_options[] =
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"unique", 'C', "Undocumented", (uchar**) &opt_unique, {"unique", 'C', "Undocumented", (uchar**) &opt_unique,
(uchar**) &opt_unique, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, (uchar**) &opt_unique, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"update-rows", 'u', "Undocumented", (uchar**) &update_count, {"update-rows", 'u', "Max number of rows to update", (uchar**) &update_count,
(uchar**) &update_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0}, (uchar**) &update_count, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0},
{"verbose", 'v', "Be more verbose", (uchar**) &verbose, {"verbose", 'v', "Be more verbose", (uchar**) &verbose,
(uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
......
...@@ -895,7 +895,11 @@ end: ...@@ -895,7 +895,11 @@ end:
if (maria_commit(file)) if (maria_commit(file))
goto err; goto err;
if (maria_close(file)) if (maria_close(file))
{
file= 0;
goto err; goto err;
}
file= 0;
maria_panic(HA_PANIC_CLOSE); /* Should close log */ maria_panic(HA_PANIC_CLOSE); /* Should close log */
if (!silent) if (!silent)
{ {
...@@ -937,7 +941,11 @@ reads: %10lu\n", ...@@ -937,7 +941,11 @@ reads: %10lu\n",
err: err:
printf("got error: %d when using MARIA-database\n",my_errno); printf("got error: %d when using MARIA-database\n",my_errno);
if (file) if (file)
{
if (maria_commit(file))
goto err;
VOID(maria_close(file)); VOID(maria_close(file));
}
maria_end(); maria_end();
return(1); return(1);
} /* main */ } /* main */
......
...@@ -143,6 +143,10 @@ run_repair_tests() ...@@ -143,6 +143,10 @@ run_repair_tests()
$maria_path/maria_chk$suffix -se test2 $maria_path/maria_chk$suffix -se test2
$maria_path/maria_chk$suffix -s --parallel-recover --quick test2 $maria_path/maria_chk$suffix -s --parallel-recover --quick test2
$maria_path/maria_chk$suffix -se test2 $maria_path/maria_chk$suffix -se test2
$maria_path/ma_test2$suffix $silent -c $row_type
$maria_path/maria_chk$suffix -se test2
$maria_path/maria_chk$suffix -sr test2
$maria_path/maria_chk$suffix -se test2
} }
run_pack_tests() run_pack_tests()
......
...@@ -21,7 +21,7 @@ echo "MARIA RECOVERY TESTS - success is if exit code is 0" ...@@ -21,7 +21,7 @@ echo "MARIA RECOVERY TESTS - success is if exit code is 0"
# identical to the saved original. # identical to the saved original.
# Does not test the index file as we don't have logging for it yet. # Does not test the index file as we don't have logging for it yet.
for prog in "$maria_path/ma_test1 $silent -M -T --skip-update -c" "$maria_path/ma_test2 $silent -L -K -W -P -M -T -g -c" for prog in "$maria_path/ma_test1 $silent -M -T -c" "$maria_path/ma_test2 $silent -L -K -W -P -M -T -c" "$maria_path/ma_test2 $silent -M -T -c -b"
do do
rm -f maria_log.* maria_log_control rm -f maria_log.* maria_log_control
echo "TEST WITH $prog" echo "TEST WITH $prog"
...@@ -36,6 +36,8 @@ do ...@@ -36,6 +36,8 @@ do
$maria_path/maria_read_log -a > $tmp/maria_read_log_$table.txt $maria_path/maria_read_log -a > $tmp/maria_read_log_$table.txt
$maria_path/maria_chk -dvv $table > $tmp/maria_chk_message.txt 2>&1 $maria_path/maria_chk -dvv $table > $tmp/maria_chk_message.txt 2>&1
cmp $table.MAD $tmp/$table.MAD.good
# QQ: Remove the following line when we also can recovert the index file # QQ: Remove the following line when we also can recovert the index file
$maria_path/maria_chk -s -r $table $maria_path/maria_chk -s -r $table
...@@ -46,7 +48,7 @@ do ...@@ -46,7 +48,7 @@ do
echo "checksum differs for $table before and after recovery" echo "checksum differs for $table before and after recovery"
exit 1; exit 1;
fi fi
# cmp $table.MAD $tmp/$table.MAD.good
# When "recovery of the table's state" is ready, we can test it like this: # When "recovery of the table's state" is ready, we can test it like this:
# diff $tmp/maria_chk_message.good.txt $tmp/maria_chk_message.txt > $tmp/maria_chk_diff.txt || true # diff $tmp/maria_chk_message.good.txt $tmp/maria_chk_message.txt > $tmp/maria_chk_diff.txt || true
# if [ -s $tmp/maria_chk_diff.txt ] # if [ -s $tmp/maria_chk_diff.txt ]
......
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