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, ...@@ -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_PRINT("enter",("search_flag: %d",search_flag));
DBUG_ASSERT(keypart_map); DBUG_ASSERT(keypart_map);
if (key_len == 0)
key_len= USE_WHOLE_KEY;
key_buff=info->lastkey+info->s->base.max_key_length; key_buff=info->lastkey+info->s->base.max_key_length;
key_len= _ma_pack_key(info, inx, key_buff, key, keypart_map, key_len= _ma_pack_key(info, inx, key_buff, key, keypart_map,
(HA_KEYSEG**) 0); (HA_KEYSEG**) 0);
......
...@@ -719,10 +719,10 @@ int main(int argc, char *argv[]) ...@@ -719,10 +719,10 @@ int main(int argc, char *argv[])
sprintf(key2,"%6d",k); sprintf(key2,"%6d",k);
min_key.key= key; min_key.key= key;
min_key.length= USE_WHOLE_KEY; min_key.keypart_map= HA_WHOLE_KEY;
min_key.flag= HA_READ_AFTER_KEY; min_key.flag= HA_READ_AFTER_KEY;
max_key.key= key2; max_key.key= key2;
max_key.length= USE_WHOLE_KEY; max_key.keypart_map= HA_WHOLE_KEY;
max_key.flag= HA_READ_BEFORE_KEY; max_key.flag= HA_READ_BEFORE_KEY;
range_records= maria_records_in_range(file, 0, &min_key, &max_key); range_records= maria_records_in_range(file, 0, &min_key, &max_key);
records=0; records=0;
......
...@@ -12,26 +12,30 @@ echo "MARIA RECOVERY TESTS - success is if exit code is 0" ...@@ -12,26 +12,30 @@ 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.
rm -f maria_log* 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"
prog="$maria_path/ma_test1 $silent -M -T --skip-update" do
echo "TEST WITH $prog" rm -f maria_log*
$prog echo "TEST WITH $prog"
mv -f test1.MAD test1.MAD.good $prog
rm test1.MAI # derive table's name from program's name
echo "applying log" table=`echo $prog | sed -e 's;.*ma_\(test[0-9]\).*;\1;' `
$maria_path/maria_read_log -a > /dev/null $maria_path/maria_chk -dvv $table > maria_chk_message.good.txt 2>&1
cmp test1.MAD test1.MAD.good mv -f $table.MAD $table.MAD.good
rm -f test1.* rm $table.MAI
echo "applying log"
rm -f maria_log* $maria_path/maria_read_log -a > maria_read_log_$table.txt
prog="$maria_path/ma_test2 $silent -L -K -W -P -M -T -g" cmp $table.MAD $table.MAD.good
echo "TEST WITH $prog" $maria_path/maria_chk -dvv $table > maria_chk_message.txt 2>&1
$prog # When "recovery of the table's state" is ready, we can test it like this:
mv -f test2.MAD test2.MAD.good # diff maria_chk_message.good.txt maria_chk_message.txt >maria_chk_diff.txt || true
rm test2.MAI # if [ -s maria_chk_diff.txt ]
echo "applying log" # then
$maria_path/maria_read_log -a > /dev/null # echo "Differences in maria_chk -dvv, recovery not yet perfect !"
cmp test2.MAD test2.MAD.good # echo "========DIFF START======="
rm -f test2.* # 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" 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