~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

Viewing changes to mysql-test/suite/parts/inc/partition_layout_check1.inc

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
################################################################################
 
2
# inc/partition_layout_check1.inc                                          #
 
3
#                                                                              #
 
4
# Purpose:                                                                     #
 
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.    #
 
8
#                                                                              #
 
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                            #
 
12
#                                                                              #
 
13
#------------------------------------------------------------------------------#
 
14
# Original Author: mleich                                                      #
 
15
# Original Date: 2006-03-05                                                    #
 
16
# Change Author:                                                               #
 
17
# Change Date:                                                                 #
 
18
# Change:                                                                      #
 
19
################################################################################
 
20
 
 
21
if ($no_debug)
 
22
{
 
23
--disable_query_log
 
24
}
 
25
# Clean the table holding the definition of t1
 
26
DELETE FROM t0_definition;
 
27
 
 
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
 
35
if ($do_file_tests)
 
36
{
 
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)
 
40
{
 
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
 
43
}
 
44
eval SET @aux = CONCAT('load_file(''$MYSQLTEST_VARDIR','/master-data/test/tmp2''
 
45
)');
 
46
let $file_list= `SELECT @aux`;
 
47
}
 
48
if (!$do_file_tests)
 
49
{
 
50
let $file_list= '--- not determined ---';
 
51
}
 
52
 
 
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;
 
57
 
 
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';
 
61
if ($do_file_tests)
 
62
{
 
63
   # We stored the list of files, therefore printing the content makes sense
 
64
   if ($ls)
 
65
   {
 
66
      # Print the list of files into the protocol
 
67
      eval SELECT REPLACE(file_list,'$MYSQLTEST_VARDIR','\$MYSQLTEST_VARDIR')
 
68
                  AS "unified filelist"
 
69
           FROM t0_definition WHERE state = 'old';
 
70
   }
 
71
}
 
72
--enable_query_log