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 #
17 ################################################################################
23 # Clean the table holding the definition of t1
24 DELETE FROM t0_definition WHERE state =
'new';
27 # Get the MySQL Servers datadir without ending slash
28 let $MYSQLD_DATADIR= `select LEFT(@@datadir, LENGTH(@@datadir)-1)`;
29 #echo MYSQLD_DATADIR: $MYSQLD_DATADIR;
31 # Save the current definition of the table t1
32 let $show_create= `SHOW CREATE
TABLE t1`;
36 # List the files belonging to the table t1
37 let $ls_file= $MYSQLD_DATADIR/
test/tmp2;
38 --list_files_write_file $ls_file $MYSQLD_DATADIR/
test t1*
40 if ($with_directories)
42 --list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-
test-data-dir t1*
43 --list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-
test-idx-dir t1*
45 eval SET @aux = load_file(
'$ls_file');
48 --remove_file $ls_file
52 SET @aux =
'--- not determined ---';
55 # Insert the current definition of the table t1 into t0_definition
56 eval INSERT INTO t0_definition SET state =
'new',
57 create_command =
"$show_create",
60 # Print the old and new table layout, if they differ
61 SELECT COUNT(*) <> 1 INTO @aux
62 FROM t0_definition tab1, t0_definition
tab2
63 WHERE tab1.state =
'old' AND
tab2.state =
'new'
64 AND tab1.create_command =
tab2.create_command
65 AND tab1.file_list =
tab2.file_list;
66 let $run= `SELECT @aux`;
70 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR #p# #P# #sp# #SP#
72 REPLACE(create_command,
'\n',
' ') AS "Table definition",
73 REPLACE(file_list ,'\
n',' ') AS "File list"
74 FROM t0_definition WHERE state in ('old','new');
76 --echo
# check layout success: 0
78 let $run= `SELECT @aux = 0`;
81 --echo # check layout success: 1