Commit 3a1c7c91 authored by unknown's avatar unknown

Maria: correcting assertions (should be enforced only in multi-threaded

mode) so ma_test_all works again; more error detection in ma_test_all;
maria_control renamed to maria_log_control (Monty's suggestion,
so that a "rm maria_log*" removes all log-related files). Disabling
failing wrong assertion.


storage/maria/ma_blockrec.c:
  disabling assertion which fails because cur_block is a
  local variable not initialized
storage/maria/ma_check.c:
  comment
storage/maria/ma_control_file.h:
  control file renamed
storage/maria/ma_loghandler.c:
  assertions needed only in multi-threaded mode (ma_test1 and ma_test2
  are single-threaded, it's ok for them to use dummy_transaction_object
  with transactional tables: trn->rec_lsn can be set without interfering
  with other threads).
storage/maria/ma_test_all.sh:
  got caught by failures in some ma_test1 runs, which I didn't see
  because ma_test_all returned 0 and I didn't scroll up in the window;
  now using "set -e" to avoid that. Also testing that
  we get the errors and warnings we expect.
storage/maria/unittest/Makefile.am:
  maria_control renamed
parent a898a7b6
......@@ -1811,9 +1811,11 @@ static my_bool write_block_record(MARIA_HA *info,
ulong length;
ulong data_length= (tmp_data - info->rec_buff);
#ifdef MONTY_WILL_KNOW
#ifdef SANITY_CHECKS
if (cur_block->sub_blocks == 1)
goto crashed; /* no reserved full or tails */
#endif
#endif
/*
......
......@@ -1925,7 +1925,11 @@ int maria_chk_data_link(HA_CHECK *param, MARIA_HA *info,int extend)
Recover old table by reading each record and writing all keys
NOTES
Save new datafile-name in temp_filename
Save new datafile-name in temp_filename.
We overwrite the index file as we go (writekeys() for example), so if we
crash during this the table is unusable and user (or Recovery in the
future) must repeat the REPAIR/OPTIMIZE operation. We could use a
temporary index file in the future (drawback: more disk space).
IMPLEMENTATION (for hard repair with block format)
- Create new, unrelated MARIA_HA of the table
......
......@@ -18,7 +18,7 @@
First version written by Guilhem Bichot on 2006-04-27.
*/
#define CONTROL_FILE_BASE_NAME "maria_control"
#define CONTROL_FILE_BASE_NAME "maria_log_control"
/* Here is the interface of this module */
......
......@@ -5623,7 +5623,7 @@ static my_bool write_hook_for_redo(enum translog_record_type type
non-transactional log records (REPAIR, CREATE, RENAME, DROP) should not
call this hook; we trust them but verify ;)
*/
DBUG_ASSERT(trn->trid != 0);
DBUG_ASSERT(!(maria_multi_threaded && (trn->trid == 0)));
/*
If the hook stays so simple, it would be faster to pass
!trn->rec_lsn ? trn->rec_lsn : some_dummy_lsn
......@@ -5650,7 +5650,7 @@ static my_bool write_hook_for_undo(enum translog_record_type type
struct st_translog_parts *parts
__attribute__ ((unused)))
{
DBUG_ASSERT(trn->trid != 0); /* see write_hook_for_redo() */
DBUG_ASSERT(!(maria_multi_threaded && (trn->trid == 0)));
trn->undo_lsn= *lsn;
if (unlikely(LSN_WITH_FLAGS_TO_LSN(trn->first_undo_lsn) == 0))
trn->first_undo_lsn=
......
......@@ -9,6 +9,8 @@
# Remove # from following line if you need some more information
#set -x -v -e
set -e # abort at first failure
valgrind="valgrind --alignment=8 --leak-check=yes"
silent="-s"
suffix=""
......@@ -196,15 +198,19 @@ run_repair_tests "-M -T"
run_pack_tests "-M -T"
#
# Tests that gives warnings
# Tests that gives warnings or errors
#
$maria_path/ma_test2$suffix $silent -L -K -W -P -S -R1 -m500
$maria_path/maria_chk$suffix -sm test2
echo "ma_test2$suffix $silent -L -K -R1 -m2000 ; Should give error 135"
$maria_path/ma_test2$suffix $silent -L -K -R1 -m2000
$maria_path/ma_test2$suffix $silent -L -K -R1 -m2000 >ma_test2_message.txt 2>&1 && false # success is failure
cat ma_test2_message.txt
grep "Error: 135" ma_test2_message.txt > /dev/null
echo "$maria_path/maria_chk$suffix -sm test2 will warn that 'Datafile is almost full'"
$maria_path/maria_chk$suffix -sm test2
$maria_path/maria_chk$suffix -sm test2 >ma_test2_message.txt 2>&1
cat ma_test2_message.txt
grep "warning: Datafile is almost full" ma_test2_message.txt >/dev/null
$maria_path/maria_chk$suffix -ssm test2
#
......
......@@ -84,6 +84,6 @@ ma_pagecache_consist_64kWR_t_big_CPPFLAGS = $(ma_pagecache_common_cppflags) -DPA
# the generic lock manager may not be used in the end and lockman1-t crashes,
# so we don't build lockman-t and lockman1-t
CLEANFILES = maria_control page_cache_test_file_1 \
CLEANFILES = maria_log_control page_cache_test_file_1 \
maria_log.????????
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