~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/include/maria_make_snapshot.inc

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Maria helper script
 
2
# Copies table' data and index file to other directory, or back, or compares.
 
3
# The other directory looks like a database directory, so that we can
 
4
# read copies from inside mysqld, that's also why we copy the frm.
 
5
 
 
6
# "mms" is a namespace for Maria_Make_Snapshot
 
7
 
 
8
# API:
 
9
# 1) set one of
 
10
# $mms_copy : to copy table from database to spare directory
 
11
# $mms_reverse : to copy it back
 
12
# $mms_compare_physically : to compare both byte-for-byte
 
13
# 2) set $mms_tname to a string and set $mms_table_to_use to a number: tables
 
14
# will be mysqltest.$mms_tname$mms_table_to_use.
 
15
# 3) set $mms_purpose to say what this copy is for (influences the naming
 
16
# of the spare directory).
 
17
 
 
18
if ($mms_copy)
 
19
{
 
20
  --echo * copied $mms_tname$mms_table_to_use for $mms_purpose
 
21
  copy_file $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAD $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAD;
 
22
  copy_file $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAI $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAI;
 
23
  copy_file $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.frm $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.frm;
 
24
}
 
25
 
 
26
if ($mms_reverse_copy)
 
27
{
 
28
  # do not call this without flushing target table first!
 
29
  --echo * copied $mms_tname$mms_table_to_use back for $mms_purpose
 
30
 -- error 0,1
 
31
  remove_file $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAD;
 
32
  copy_file $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAD $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAD;
 
33
  -- error 0,1
 
34
  remove_file $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAI;
 
35
  copy_file $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAI $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAI;
 
36
}
 
37
 
 
38
if ($mms_compare_physically)
 
39
{
 
40
  # After the UNDO phase this is normally impossible
 
41
  # (UNDO execution has created new log records => pages have new LSNs).
 
42
  # So, do this only when testing REDO phase.
 
43
  # If UNDO phase, we nevertheless compare checksums
 
44
  # (see maria_verify_recovery.inc).
 
45
  --echo * compared $mms_tname$mms_table_to_use to old version
 
46
  diff_files $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAD $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAD;
 
47
# index file not yet recovered
 
48
#  diff_files $MYSQLTEST_VARDIR/master-data/mysqltest/$mms_tname$mms_table_to_use.MAI $MYSQLTEST_VARDIR/master-data/mysqltest_for_$mms_purpose/$mms_tname$mms_table_to_use.MAI;
 
49
}