From b183e7c5a2fd0f70ed72d78a9b3380da291bbb19 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Thu, 11 Mar 2010 14:00:36 +0100 Subject: Bug#42954: SQL MODE 'NO_DIR_IN_CREATE' does not work with subpartitions There was no check for DATA/INDEX DIRECTORY for subpartitions Added the same check as for partitions. mysql-test/r/partition_error.result: Bug#42954: SQL MODE 'NO_DIR_IN_CREATE' does not work with subpartitions Updated results mysql-test/t/partition_error.test: Bug#42954: SQL MODE 'NO_DIR_IN_CREATE' does not work with subpartitions Added tests sql/partition_info.cc: Bug#42954: SQL MODE 'NO_DIR_IN_CREATE' does not work with subpartitions moved the check for DATA/INDEX DIRECTORY into a function and used it for both partitions as well as subpartitions. (Was not checked at all for subpartitions before) --- mysql-test/r/partition_error.result | 70 +++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) (limited to 'mysql-test/r/partition_error.result') diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index b692203823d..c03d5e16a48 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -1,4 +1,74 @@ drop table if exists t1; +# +# Bug#42954: SQL MODE 'NO_DIR_IN_CREATE' does not work with +# subpartitions +SET @org_mode=@@sql_mode; +SET @@sql_mode='NO_DIR_IN_CREATE'; +SELECT @@sql_mode; +@@sql_mode +NO_DIR_IN_CREATE +CREATE TABLE t1 (id INT, purchased DATE) +PARTITION BY RANGE(YEAR(purchased)) +SUBPARTITION BY HASH(TO_DAYS(purchased)) +(PARTITION p0 VALUES LESS THAN MAXVALUE +DATA DIRECTORY = '/tmp/not-existing' +INDEX DIRECTORY = '/tmp/not-existing'); +Warnings: +Warning 1618 option ignored +Warning 1618 option ignored +Warning 1618 option ignored +Warning 1618 option ignored +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) DEFAULT NULL, + `purchased` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (YEAR(purchased)) +SUBPARTITION BY HASH (TO_DAYS(purchased)) +(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +DROP TABLE t1; +CREATE TABLE t1 (id INT, purchased DATE) +PARTITION BY RANGE(YEAR(purchased)) +SUBPARTITION BY HASH(TO_DAYS(purchased)) SUBPARTITIONS 2 +(PARTITION p0 VALUES LESS THAN MAXVALUE +(SUBPARTITION sp0 +DATA DIRECTORY = '/tmp/not-existing' +INDEX DIRECTORY = '/tmp/not-existing', +SUBPARTITION sp1)); +Warnings: +Warning 1618 option ignored +Warning 1618 option ignored +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) DEFAULT NULL, + `purchased` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (YEAR(purchased)) +SUBPARTITION BY HASH (TO_DAYS(purchased)) +(PARTITION p0 VALUES LESS THAN MAXVALUE + (SUBPARTITION sp0 ENGINE = MyISAM, + SUBPARTITION sp1 ENGINE = MyISAM)) */ +DROP TABLE t1; +CREATE TABLE t1 (id INT, purchased DATE) +PARTITION BY RANGE(YEAR(purchased)) +(PARTITION p0 VALUES LESS THAN MAXVALUE +DATA DIRECTORY = '/tmp/not-existing' +INDEX DIRECTORY = '/tmp/not-existing'); +Warnings: +Warning 1618 option ignored +Warning 1618 option ignored +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) DEFAULT NULL, + `purchased` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY RANGE (YEAR(purchased)) +(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ +DROP TABLE t1; +SET @@sql_mode= @org_mode; CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a)); INSERT INTO t1 VALUES (1),(1); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -- cgit v1.2.1