-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
188 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
mysql-test/suite/parts/r/alter_data_directory_innodb.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# | ||
# MDEV-15953 Alter InnoDB Partitioned Table Moves Files (which were originally not in the datadir) to the datadir | ||
# | ||
CREATE TABLE t ( | ||
a INT NOT NULL | ||
) ENGINE=INNODB | ||
PARTITION BY HASH (a) ( | ||
PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here/' ENGINE = INNODB, | ||
PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here/' ENGINE = INNODB | ||
); | ||
INSERT INTO t VALUES (1); | ||
SHOW CREATE TABLE t; | ||
Table Create Table | ||
t CREATE TABLE `t` ( | ||
`a` int(11) NOT NULL | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 | ||
PARTITION BY HASH (`a`) | ||
(PARTITION `p1` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB, | ||
PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB) | ||
ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE; | ||
SHOW CREATE TABLE t; | ||
Table Create Table | ||
t CREATE TABLE `t` ( | ||
`a` int(11) NOT NULL, | ||
PRIMARY KEY (`a`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 | ||
PARTITION BY HASH (`a`) | ||
(PARTITION `p1` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB, | ||
PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB) | ||
ALTER TABLE t DROP PRIMARY KEY, ALGORITHM=COPY; | ||
SHOW CREATE TABLE t; | ||
Table Create Table | ||
t CREATE TABLE `t` ( | ||
`a` int(11) NOT NULL | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 | ||
PARTITION BY HASH (`a`) | ||
(PARTITION `p1` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB, | ||
PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB) | ||
SET @TMP = @@GLOBAL.INNODB_FILE_PER_TABLE; | ||
SET GLOBAL INNODB_FILE_PER_TABLE=OFF; | ||
ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE; | ||
SHOW CREATE TABLE t; | ||
Table Create Table | ||
t CREATE TABLE `t` ( | ||
`a` int(11) NOT NULL, | ||
PRIMARY KEY (`a`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 | ||
PARTITION BY HASH (`a`) | ||
(PARTITION `p1` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB, | ||
PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB) | ||
SET GLOBAL INNODB_FILE_PER_TABLE=@TMP; | ||
ALTER TABLE t REORGANIZE PARTITION p1,p2 INTO ( | ||
PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB, | ||
PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB | ||
); | ||
SHOW CREATE TABLE t; | ||
Table Create Table | ||
t CREATE TABLE `t` ( | ||
`a` int(11) NOT NULL, | ||
PRIMARY KEY (`a`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 | ||
PARTITION BY HASH (`a`) | ||
(PARTITION `p1` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB, | ||
PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB) | ||
DROP TABLE t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--source include/have_innodb.inc | ||
--source include/have_partition.inc | ||
|
||
--echo # | ||
--echo # MDEV-15953 Alter InnoDB Partitioned Table Moves Files (which were originally not in the datadir) to the datadir | ||
--echo # | ||
|
||
mkdir $MYSQLTEST_VARDIR/tmp/partitions_here; | ||
|
||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR | ||
eval CREATE TABLE t ( | ||
a INT NOT NULL | ||
) ENGINE=INNODB | ||
PARTITION BY HASH (a) ( | ||
PARTITION p1 DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp/partitions_here/' ENGINE = INNODB, | ||
PARTITION p2 DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp/partitions_here/' ENGINE = INNODB | ||
); | ||
INSERT INTO t VALUES (1); | ||
|
||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR | ||
SHOW CREATE TABLE t; | ||
ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE; | ||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR | ||
SHOW CREATE TABLE t; | ||
ALTER TABLE t DROP PRIMARY KEY, ALGORITHM=COPY; | ||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR | ||
SHOW CREATE TABLE t; | ||
SET @TMP = @@GLOBAL.INNODB_FILE_PER_TABLE; | ||
SET GLOBAL INNODB_FILE_PER_TABLE=OFF; | ||
ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE; | ||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR | ||
SHOW CREATE TABLE t; | ||
SET GLOBAL INNODB_FILE_PER_TABLE=@TMP; | ||
|
||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR | ||
eval ALTER TABLE t REORGANIZE PARTITION p1,p2 INTO ( | ||
PARTITION p1 DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB, | ||
PARTITION p2 DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB | ||
); | ||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR | ||
SHOW CREATE TABLE t; | ||
|
||
DROP TABLE t; | ||
|
||
rmdir $MYSQLTEST_VARDIR/tmp/partitions_here/test; | ||
rmdir $MYSQLTEST_VARDIR/tmp/partitions_here; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters