1
################################################################################
2
# inc/partition_layout_check1.inc #
5
# Store the SHOW CREATE TABLE output and the list of files belonging to #
6
# this table + print this into the protocol #
7
# This script is only usefule when sourced within the partitioning tests. #
9
# Attention: The routine inc/partition_layout_check2.inc is very similar #
10
# to this one. So if something has to be changed here it #
11
# might be necessary to do it also there #
13
#------------------------------------------------------------------------------#
14
# Original Author: mleich #
15
# Original Date: 2006-03-05 #
19
################################################################################
25
# Clean the table holding the definition of t1
26
DELETE FROM t0_definition;
28
# Dump the current definition of the table t1 to tmp1
29
# This complicated method - let another mysqltest collect the output - is used
30
# because of two reasons
31
# - SHOW CREATE TABLE t1 is at least currently most probably more reliable than
32
# the corresponding SELECT on the INFORMATION_SCHEMA
33
# - SHOW CREATE TABLE .. cannot write its out put into a file like SELECT
34
--exec echo "SHOW CREATE TABLE t1;" | $MYSQL_TEST > $MYSQLTEST_VARDIR/master-data/test/tmp1 2>&1 || true
37
# List the files belonging to the table t1
38
--exec ls $MYSQLTEST_VARDIR/master-data/test/t1* > $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true
39
if ($with_directories)
41
--exec ls $MYSQLTEST_VARDIR/mysql-test-data-dir/t1* >> $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true
42
--exec ls $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1* >> $MYSQLTEST_VARDIR/master-data/test/tmp2 2>&1 || true
44
eval SET @aux = CONCAT('load_file(''$MYSQLTEST_VARDIR','/master-data/test/tmp2''
46
let $file_list= `SELECT @aux`;
50
let $file_list= '--- not determined ---';
53
# Insert the current definition of the table t1 into t0_definition
54
eval INSERT INTO t0_definition SET state = 'old',
55
create_command = load_file('$MYSQLTEST_VARDIR/master-data/test/tmp1'),
56
file_list = $file_list;
58
# Print the create table statement into the protocol
59
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
60
SELECT create_command FROM t0_definition WHERE state = 'old';
63
# We stored the list of files, therefore printing the content makes sense
66
# Print the list of files into the protocol
67
eval SELECT REPLACE(file_list,'$MYSQLTEST_VARDIR','\$MYSQLTEST_VARDIR')
69
FROM t0_definition WHERE state = 'old';