1 ################################################################################ 
    2 # inc/partition_directory.inc                                                  # 
    5 #   Create and check partitioned tables                                        # 
    6 #   The partitioning function use the column f_int1                            # 
    8 #   For all Data/Index directory combinations                                  # 
   10 #     1. Create the partitioned table                                          # 
   11 #     2  Insert the content of the table t0_template into t1                   # 
   12 #     3. Execute inc/partition_check.inc                                       # 
   13 #     4. Drop the table t1                                                     # 
   15 #------------------------------------------------------------------------------# 
   16 # Original Author: HH                                                          # 
   17 # Original Date: 2006-05-11                                                    # 
   21 ################################################################################ 
   24 DROP 
TABLE IF EXISTS t1;
 
   28 #----------- PARTITION BY HASH 
   29 if ($with_partitioning)
 
   31 let $partitioning= PARTITION BY 
HASH(f_int1) PARTITIONS 2;
 
   32 if ($with_directories)
 
   35 PARTITION BY 
HASH(f_int1) PARTITIONS 2
 
   42 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 
   43 eval CREATE 
TABLE t1 (
 
   49 --source suite/parts/inc/partition_check.inc
 
   51 --source suite/parts/inc/partition_check_drop.inc
 
   53 #----------- PARTITION BY KEY 
   54 if ($with_partitioning)
 
   56 let $partitioning= PARTITION BY 
KEY(f_int1) PARTITIONS 5;
 
   57 if ($with_directories)
 
   60 PARTITION BY 
HASH(f_int1) PARTITIONS 5
 
   73 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 
   74 eval CREATE 
TABLE t1 (
 
   80 --source suite/parts/inc/partition_check.inc
 
   82 --source suite/parts/inc/partition_check_drop.inc
 
   84 #----------- PARTITION BY LIST 
   85 if ($with_partitioning)
 
   88 PARTITION BY 
LIST(MOD(f_int1,4))
 
   89 (PARTITION part_3 VALUES IN (-3)
 
   91  PARTITION part_2 VALUES IN (-2)
 
   93  PARTITION part_1 VALUES IN (-1)
 
   94 $data_directory $index_directory,
 
   95  PARTITION part_N VALUES IN (NULL)
 
   97  PARTITION part0 VALUES IN (0)
 
   99  PARTITION part1 VALUES IN (1)
 
  101  PARTITION part2 VALUES IN (2)
 
  103  PARTITION part3 VALUES IN (3)
 
  104 $data_directory $index_directory);
 
  106 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 
  107 eval CREATE 
TABLE t1 (
 
  113 --source suite/parts/inc/partition_check.inc
 
  115 --source suite/parts/inc/partition_check_drop.inc
 
  117 #----------- PARTITION BY RANGE 
  118 if ($with_partitioning)
 
  120 let $partitioning= PARTITION BY RANGE(f_int1)
 
  121 (PARTITION parta VALUES LESS THAN (0)
 
  123 PARTITION partb VALUES LESS THAN ($max_row_div4)
 
  125 PARTITION partc VALUES LESS THAN ($max_row_div2)
 
  128 PARTITION partd VALUES LESS THAN ($max_row_div2 + $max_row_div4),
 
  129 PARTITION parte VALUES LESS THAN ($max_row)
 
  131 PARTITION partf VALUES LESS THAN $MAX_VALUE
 
  134 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 
  135 eval CREATE 
TABLE t1 (
 
  141 --source suite/parts/inc/partition_check.inc
 
  143 --source suite/parts/inc/partition_check_drop.inc
 
  145 #----------- PARTITION BY RANGE -- SUBPARTITION BY HASH 
  146 if ($with_partitioning)
 
  149 PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY 
HASH(f_int1) SUBPARTITIONS 2
 
  150 (PARTITION parta VALUES LESS THAN (0)
 
  152 PARTITION partb VALUES LESS THAN ($max_row_div4)
 
  154 PARTITION partc VALUES LESS THAN ($max_row_div2),
 
  155 PARTITION partd VALUES LESS THAN $MAX_VALUE
 
  159 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 
  160 eval CREATE 
TABLE t1 (
 
  166 --source suite/parts/inc/partition_check.inc
 
  168 --source suite/parts/inc/partition_check_drop.inc
 
  170 #----------- PARTITION BY RANGE -- SUBPARTITION BY KEY 
  171 if ($with_partitioning)
 
  173 # use the new (from bug#14326) partitioning format (i.e. multi-line comments) 
  190 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 
  191 eval CREATE 
TABLE t1 (
 
  197 --source suite/parts/inc/partition_check.inc
 
  199 --source suite/parts/inc/partition_check_drop.inc
 
  201 #----------- PARTITION BY LIST -- SUBPARTITION BY HASH 
  202 if ($with_partitioning)
 
  204 # use the old (pre bug#14326) format (i.e. one line comment) 
  207 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 
  208 eval CREATE 
TABLE t1 (
 
  214 --source suite/parts/inc/partition_check.inc
 
  216 --source suite/parts/inc/partition_check_drop.inc
 
  218 let $with_directories= FALSE;