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                                                    # 
   16 # Change Author: pcrews                                                        # 
   17 # Change Date: 2008-04-15                                                      # 
   18 # Change: Added --replace_result to account for Windows' use of '\r'           # 
   19 ################################################################################ 
   25 # Clean the table holding the definition of t1 
   26 DELETE FROM t0_definition;
 
   28 # Get the MySQL Servers datadir without ending slash 
   29 let $MYSQLD_DATADIR= `select LEFT(@@datadir, LENGTH(@@datadir)-1)`;
 
   30 #echo MYSQLD_DATADIR: $MYSQLD_DATADIR; 
   32 # Save the current definition of the table t1 
   33 # - SHOW CREATE TABLE t1 is at least currently most probably more reliable than 
   34 #   the corresponding SELECT on the INFORMATION_SCHEMA 
   35 let $show_create= `SHOW CREATE 
TABLE t1`;
 
   38   # List the files belonging to the table t1 
   39   let $ls_file= $MYSQLD_DATADIR/
test/tmp2;
 
   40   --list_files_write_file $ls_file $MYSQLD_DATADIR/
test t1*
 
   42   if ($with_directories)
 
   44     --list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-
test-data-dir t1*
 
   45     --list_files_append_file $ls_file $MYSQLTEST_VARDIR/mysql-
test-idx-dir t1*
 
   47   eval SET @aux = load_file(
'$ls_file');
 
   50   --remove_file $ls_file
 
   54   SET @aux = 
'--- not determined ---';
 
   57 # Insert the current definition of the table t1 into t0_definition 
   58 eval INSERT INTO t0_definition SET state = 
'old',
 
   59      create_command = 
"$show_create",
 
   62 # Print the create table statement into the protocol 
   63 # Added the concat to avoid changing the result files 
   64 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR 
'\r' '' 
   65 SELECT concat(
'SHOW CREATE TABLE t1;\nTable\tCreate Table\n',create_command,
'\n') as `create_command` FROM t0_definition WHERE state = 'old';
 
   68    # We stored the list of files, therefore printing the content makes sense 
   71       # Print the list of files into the protocol 
   72       replace_result $MYSQLD_DATADIR MYSQLD_DATADIR $MYSQLTEST_VARDIR MYSQLTEST_VARDIR #p# #P# #sp# #SP# part_n part_N;
 
   73       SELECT file_list AS 
"unified filelist" 
   74        FROM t0_definition WHERE state = 
'old';