Commit f84ce57c authored by unknown's avatar unknown

Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-maria

into  gbichot4.local:/home/mysql_src/mysql-maria-monty

parents edfa1629 5051a8e0
...@@ -5872,6 +5872,11 @@ static int write_log_record_for_repair(const HA_CHECK *param, MARIA_HA *info) ...@@ -5872,6 +5872,11 @@ static int write_log_record_for_repair(const HA_CHECK *param, MARIA_HA *info)
log_array[TRANSLOG_INTERNAL_PARTS + 0].length= sizeof(log_data); log_array[TRANSLOG_INTERNAL_PARTS + 0].length= sizeof(log_data);
share->now_transactional= 1; share->now_transactional= 1;
/**
@todo RECOVERY maria_chk --transaction-log may come here; to be sure
that ha_maria is not using the log too, we should do a my_lock() on the
control file when Maria starts.
*/
if (unlikely(translog_write_record(&lsn, LOGREC_REDO_REPAIR_TABLE, if (unlikely(translog_write_record(&lsn, LOGREC_REDO_REPAIR_TABLE,
&dummy_transaction_object, info, &dummy_transaction_object, info,
sizeof(log_data), sizeof(log_data),
......
...@@ -22,8 +22,10 @@ check_table_is_same() ...@@ -22,8 +22,10 @@ check_table_is_same()
{ {
# Computes checksum of new table and compares to checksum of old table # Computes checksum of new table and compares to checksum of old table
# Shows any difference in table's state (info from the index's header) # Shows any difference in table's state (info from the index's header)
# Data/key file length is random in ma_test2 (as it uses srand() which
# may differ between machines).
$maria_path/maria_chk -dvv $table | grep -v "Creation time:" > $tmp/maria_chk_message.txt 2>&1 $maria_path/maria_chk -dvv $table | grep -v "Creation time:" | grep -v "file length"> $tmp/maria_chk_message.txt 2>&1
$maria_path/maria_chk -s -e --read-only $table $maria_path/maria_chk -s -e --read-only $table
checksum2=`$maria_path/maria_chk -dss $table` checksum2=`$maria_path/maria_chk -dss $table`
...@@ -95,7 +97,7 @@ do ...@@ -95,7 +97,7 @@ do
$maria_path/$prog $maria_path/$prog
# derive table's name from program's name # derive table's name from program's name
table=`echo $prog | sed -e 's;.*ma_\(test[0-9]\).*;\1;' ` table=`echo $prog | sed -e 's;.*ma_\(test[0-9]\).*;\1;' `
$maria_path/maria_chk -dvv $table | grep -v "Creation time:"> $tmp/maria_chk_message.good.txt 2>&1 $maria_path/maria_chk -dvv $table | grep -v "Creation time:" | grep -v "file length"> $tmp/maria_chk_message.good.txt 2>&1
checksum=`$maria_path/maria_chk -dss $table` checksum=`$maria_path/maria_chk -dss $table`
mv $table.MAD $tmp/$table-good.MAD mv $table.MAD $tmp/$table-good.MAD
mv $table.MAI $tmp/$table-good.MAI mv $table.MAI $tmp/$table-good.MAI
...@@ -141,7 +143,7 @@ do ...@@ -141,7 +143,7 @@ do
$maria_path/$prog $commit_run_args $maria_path/$prog $commit_run_args
# derive table's name from program's name # derive table's name from program's name
table=`echo $prog | sed -e 's;.*ma_\(test[0-9]\).*;\1;' ` table=`echo $prog | sed -e 's;.*ma_\(test[0-9]\).*;\1;' `
$maria_path/maria_chk -dvv $table | grep -v "Creation time:"> $tmp/maria_chk_message.good.txt 2>&1 $maria_path/maria_chk -dvv $table | grep -v "Creation time:" | grep -v "file length"> $tmp/maria_chk_message.good.txt 2>&1
checksum=`$maria_path/maria_chk -dss $table` checksum=`$maria_path/maria_chk -dss $table`
mv $table.MAD $tmp/$table-good.MAD mv $table.MAD $tmp/$table-good.MAD
mv $table.MAI $tmp/$table-good.MAI mv $table.MAI $tmp/$table-good.MAI
...@@ -149,11 +151,13 @@ do ...@@ -149,11 +151,13 @@ do
echo "TEST WITH $prog $abort_run_args$test_undo (additional aborted work)" echo "TEST WITH $prog $abort_run_args$test_undo (additional aborted work)"
$maria_path/$prog $abort_run_args$test_undo $maria_path/$prog $abort_run_args$test_undo
cp $table.MAD $tmp/$table.MAD.before_undo cp $table.MAD $tmp/$table.MAD.before_undo
cp $table.MAI $tmp/$table.MAI.before_undo
# The lines below seem unneeded, will be removed soon
# We have to copy and restore logs, as running maria_read_log will # We have to copy and restore logs, as running maria_read_log will
# change the maria_control_file # change the maria_control_file
rm -f $tmp/maria_log.* $tmp/maria_log_control # rm -f $tmp/maria_log.* $tmp/maria_log_control
cp $maria_path/maria_log* $tmp # cp $maria_path/maria_log* $tmp
if [ "$test_undo" != "3" ] if [ "$test_undo" != "3" ]
then then
...@@ -163,6 +167,7 @@ do ...@@ -163,6 +167,7 @@ do
apply_log "dontknow" apply_log "dontknow"
fi fi
cp $table.MAD $tmp/$table.MAD.after_undo cp $table.MAD $tmp/$table.MAD.after_undo
cp $table.MAI $tmp/$table.MAI.after_undo
# It is impossible to do a "cmp" between .good and .after_undo, # It is impossible to do a "cmp" between .good and .after_undo,
# because the UNDO phase generated log # because the UNDO phase generated log
...@@ -174,12 +179,17 @@ do ...@@ -174,12 +179,17 @@ do
echo "testing idempotency" echo "testing idempotency"
apply_log "shouldnotchangelog" apply_log "shouldnotchangelog"
cmp $table.MAD $tmp/$table.MAD.after_undo cmp $table.MAD $tmp/$table.MAD.after_undo
# can't do this, creation time differs at least; enable it if you
# have a "cmp" which ignores the header.
# cmp $table.MAI $tmp/$table.MAI.after_undo
check_table_is_same check_table_is_same
echo "testing applying of CLRs to recreate table" echo "testing applying of CLRs to recreate table"
rm $table.MA? rm $table.MA?
cp $tmp/maria_log* $maria_path # cp $tmp/maria_log* $maria_path #unneeded
apply_log "dontknow" apply_log "shouldnotchangelog"
cmp $table.MAD $tmp/$table.MAD.after_undo cmp $table.MAD $tmp/$table.MAD.after_undo
# can't do this, creation time differs at least
# cmp $table.MAI $tmp/$table.MAI.after_undo
check_table_is_same check_table_is_same
shift 3 shift 3
done done
......
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