1
################################################################################
2
# inc/partition_layout_check2.inc #
5
# Store the SHOW CREATE TABLE output and the list of files belonging to #
6
# this table + Check if the layout of the table was not modified #
7
# since the call of inc/partition_layout_check1.inc #
8
# This script is only usefule when sourced within the partitioning tests. #
10
# Attention: The routine inc/partition_layout_check1.inc is very similar #
11
# to this one. So if something has to be changed here it #
12
# might be necessary to do it also there #
14
#------------------------------------------------------------------------------#
15
# Original Author: mleich #
16
# Original Date: 2006-03-05 #
20
################################################################################
26
# Clean the table holding the definition of t1
27
DELETE FROM t0_definition WHERE state = 'new';
29
# Dump the current definition of the table t1 to tmp1
30
--exec echo "SHOW CREATE TABLE t1;" | $MYSQL_TEST > $MYSQLTEST_VARDIR/master-data/test/tmp1 2>&1 || true
33
# List the files belonging to the table t1
34
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1* > $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true
35
if ($with_directories)
37
--exec ls $MYSQLTEST_VARDIR/mysql-test-data-dir/t1* >> $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true
38
--exec ls $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1* >> $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true
40
eval SET @aux = CONCAT('load_file(''$MYSQLTEST_VARDIR','/master-data/test/tmp2'')');
41
let $file_list= `SELECT @aux`;
45
let $file_list= '--- not determined ---';
48
# Insert the current definition of the table t1 into t0_definition
49
eval INSERT INTO t0_definition SET state = 'new',
50
create_command = load_file('$MYSQLTEST_VARDIR/master-data/test/tmp1'),
51
file_list = $file_list;
53
# Print the old and new table layout, if they differ
54
SELECT COUNT(*) <> 1 INTO @aux
55
FROM t0_definition tab1, t0_definition tab2
56
WHERE tab1.state = 'old' AND tab2.state = 'new'
57
AND tab1.create_command = tab2.create_command
58
AND tab1.file_list = tab2.file_list;
59
let $run= `SELECT @aux`;
63
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
65
REPLACE(create_command,'\n',' ') AS "Table definition",
66
REPLACE(file_list ,'\n',' ') AS "File list"
67
FROM t0_definition WHERE state in ('old','new');
69
--echo # check layout success: 0
71
let $run= `SELECT @aux = 0`;
74
--echo # check layout success: 1