Commit ec547ae8 authored by unknown's avatar unknown

fixes of bad merge (probably). Less duplication in ma_test_recovery.


storage/maria/ma_range.c:
  old code, which is wrong now (key_len is now a local variable,
  not initialized). Fixes some problems in running ma_test2.
storage/maria/ma_test2.c:
  keypart_map should be used instead of length (fix of bad merge
  probably)
storage/maria/ma_test_recovery:
  less duplication in this script (one loop instead).
parent 3d0f42a9
......@@ -137,8 +137,6 @@ static ha_rows _ma_record_pos(MARIA_HA *info, const uchar *key,
DBUG_PRINT("enter",("search_flag: %d",search_flag));
DBUG_ASSERT(keypart_map);
if (key_len == 0)
key_len= USE_WHOLE_KEY;
key_buff=info->lastkey+info->s->base.max_key_length;
key_len= _ma_pack_key(info, inx, key_buff, key, keypart_map,
(HA_KEYSEG**) 0);
......
......@@ -719,10 +719,10 @@ int main(int argc, char *argv[])
sprintf(key2,"%6d",k);
min_key.key= key;
min_key.length= USE_WHOLE_KEY;
min_key.keypart_map= HA_WHOLE_KEY;
min_key.flag= HA_READ_AFTER_KEY;
max_key.key= key2;
max_key.length= USE_WHOLE_KEY;
max_key.keypart_map= HA_WHOLE_KEY;
max_key.flag= HA_READ_BEFORE_KEY;
range_records= maria_records_in_range(file, 0, &min_key, &max_key);
records=0;
......
......@@ -12,26 +12,30 @@ echo "MARIA RECOVERY TESTS - success is if exit code is 0"
# identical to the saved original.
# Does not test the index file as we don't have logging for it yet.
rm -f maria_log*
prog="$maria_path/ma_test1 $silent -M -T --skip-update"
echo "TEST WITH $prog"
$prog
mv -f test1.MAD test1.MAD.good
rm test1.MAI
echo "applying log"
$maria_path/maria_read_log -a > /dev/null
cmp test1.MAD test1.MAD.good
rm -f test1.*
rm -f maria_log*
prog="$maria_path/ma_test2 $silent -L -K -W -P -M -T -g"
echo "TEST WITH $prog"
$prog
mv -f test2.MAD test2.MAD.good
rm test2.MAI
echo "applying log"
$maria_path/maria_read_log -a > /dev/null
cmp test2.MAD test2.MAD.good
rm -f test2.*
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"
do
rm -f maria_log*
echo "TEST WITH $prog"
$prog
# derive table's name from program's name
table=`echo $prog | sed -e 's;.*ma_\(test[0-9]\).*;\1;' `
$maria_path/maria_chk -dvv $table > maria_chk_message.good.txt 2>&1
mv -f $table.MAD $table.MAD.good
rm $table.MAI
echo "applying log"
$maria_path/maria_read_log -a > maria_read_log_$table.txt
cmp $table.MAD $table.MAD.good
$maria_path/maria_chk -dvv $table > maria_chk_message.txt 2>&1
# When "recovery of the table's state" is ready, we can test it like this:
# diff maria_chk_message.good.txt maria_chk_message.txt >maria_chk_diff.txt || true
# if [ -s maria_chk_diff.txt ]
# then
# echo "Differences in maria_chk -dvv, recovery not yet perfect !"
# echo "========DIFF START======="
# cat maria_chk_diff.txt
# echo "========DIFF END======="
# fi
rm -f $table.* maria_chk_*.txt maria_read_log_$table.txt
done
echo "ALL RECOVERY TESTS OK"
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