| 1 |
# Windows-specific partition tests |
| 2 |
--source include/windows.inc |
| 3 |
|
| 4 |
# These tests contain Windows specific directory/file format. |
| 5 |
|
| 6 |
# |
| 7 |
# Bug 25141: Crash Server on Partitioning command |
| 8 |
# |
| 9 |
# Bug#30459: Partitioning across disks failing on Windows |
| 10 |
# updated this test, since symlinked files are not supported on Windows |
| 11 |
# (not the same as symlinked directories that have a special hack |
| 12 |
# on windows). This test is not dependent on have_symlink. |
| 13 |
|
| 14 |
--echo # Get available drive letters on this host (must be at least two). |
| 15 |
--perl |
| 16 |
my @devices= `$ENV{'systemroot'}\\system32\\wbem\\wmic logicaldisk where drivetype=3 get name`; |
| 17 |
# Element 0 is the string 'Name'. |
| 18 |
(scalar @devices > 2) or die ("Too few devices"); |
| 19 |
|
| 20 |
# Set input separator to make chomp work, and trim white space. |
| 21 |
local $/ = "\r\n"; |
| 22 |
chomp @devices; |
| 23 |
s{^\s+|\s+$}{}g foreach @devices; |
| 24 |
|
| 25 |
# Create tmp script to transfer into variables. |
| 26 |
open(FILE, ">", "$ENV{'MYSQLTEST_VARDIR'}/tmp/devices.tmp") or die; |
| 27 |
print FILE "--let base_1= $devices[1]/mysqltest\n"; |
| 28 |
print FILE "--let base_2= $devices[2]/mysqltest\n"; |
| 29 |
close FILE; |
| 30 |
EOF |
| 31 |
|
| 32 |
--echo # Bring the names into variables by sourcing the generated script. |
| 33 |
--source $MYSQLTEST_VARDIR/tmp/devices.tmp |
| 34 |
|
| 35 |
--echo # The tmp script is not needed anymore, delete it. |
| 36 |
--remove_file $MYSQLTEST_VARDIR/tmp/devices.tmp |
| 37 |
|
| 38 |
--echo # Create build paths. |
| 39 |
--let $path_1= $base_1/p0Data |
| 40 |
--let $path_2= $base_2/p2Data |
| 41 |
--let $path_3= $base_2/p3Data |
| 42 |
|
| 43 |
--echo # Create the target directories. This will fail e.g. |
| 44 |
--echo # if the directories exist already. |
| 45 |
--mkdir $base_1 |
| 46 |
--mkdir $base_2 |
| 47 |
--mkdir $path_1 |
| 48 |
--mkdir $path_2 |
| 49 |
--mkdir $path_3 |
| 50 |
|
| 51 |
--let $restart_parameters = restart: --innodb-directories=$path_1;$path_2;$path_3 |
| 52 |
--replace_result $path_1 PATH_1 $path_2 PATH_2 $path_3 PATH_3 |
| 53 |
--source include/restart_mysqld.inc |
| 54 |
|
| 55 |
--replace_result $path_1 PATH_1 $path_2 PATH_2 |
| 56 |
eval |
| 57 |
CREATE TABLE t1 ( |
| 58 |
c1 int unsigned NOT NULL AUTO_INCREMENT, |
| 59 |
c2 varchar(30) NOT NULL, |
| 60 |
c3 smallint unsigned DEFAULT NULL, |
| 61 |
PRIMARY KEY (c1) |
| 62 |
) |
| 63 |
PARTITION BY HASH(c1)( |
| 64 |
PARTITION p0 |
| 65 |
DATA DIRECTORY = '$path_1', |
| 66 |
PARTITION p1, |
| 67 |
PARTITION p2 |
| 68 |
DATA DIRECTORY = '$path_2' |
| 69 |
); |
| 70 |
|
| 71 |
INSERT INTO t1 VALUES (NULL, "first", 1); |
| 72 |
INSERT INTO t1 VALUES (NULL, "second", 2); |
| 73 |
INSERT INTO t1 VALUES (NULL, "third", 3); |
| 74 |
|
| 75 |
--replace_result $path_1 PATH_1 $path_2 PATH_2 |
| 76 |
SHOW CREATE TABLE t1; |
| 77 |
|
| 78 |
--replace_result $path_3 PATH_3 |
| 79 |
eval ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY = '$path_3'); |
| 80 |
INSERT INTO t1 VALUES (NULL, "last", 4); |
| 81 |
|
| 82 |
--replace_result $path_1 PATH_1 $path_2 PATH_2 $path_3 PATH_3 |
| 83 |
SHOW CREATE TABLE t1; |
| 84 |
DROP TABLE t1; |
| 85 |
|
| 86 |
--echo # Clean up: Delete target directories. |
| 87 |
--rmdir $path_1\test |
| 88 |
--rmdir $path_2\test |
| 89 |
--rmdir $path_3\test |
| 90 |
|
| 91 |
--rmdir $path_1 |
| 92 |
--rmdir $path_2 |
| 93 |
--rmdir $path_3 |
| 94 |
|
| 95 |
--rmdir $base_1 |
| 96 |
--rmdir $base_2 |
| 97 |
|
| 98 |
--let $restart_parameters = restart: |
| 99 |
--source include/restart_mysqld.inc |