List:Commits« Previous MessageNext Message »
From:mattiasj Date:January 4 2008 11:06am
Subject:bk commit into 5.1 tree (mattiasj:1.2650) BUG#30459
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of mattiasj.  When mattiasj does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-01-04 12:06:20+01:00, mattiasj@witty. +7 -0
  Bug#30459 Partitioning across disks failing on Windows
  
  Problem was that there are no support for symlinked files on Windows for
  mysqld. So we fail when trying to create them.
  
  Solution: Ignore the DATA/INDEX DIRECTORY clause for partitions and push
  a warning. (Just like a MyISAM table)

  mysql-test/r/partition.result@stripped, 2008-01-04 12:06:17+01:00, mattiasj@witty. +0 -28
    Bug#30459 Partitioning across disks failing on Windows
    Moved symlink specific tests to partition_symlink
    result file

  mysql-test/r/partition_symlink.result@stripped, 2008-01-04 12:06:17+01:00, mattiasj@witty. +31 -0
    Bug#30459 Partitioning across disks failing on Windows
    Moved symlink specific tests from partition.test
    result file

  mysql-test/r/partition_windows.result@stripped, 2008-01-04 12:06:17+01:00, mattiasj@witty. +28 -12
    Bug#30459 Partitioning across disks failing on Windows
    result file

  mysql-test/t/partition.test@stripped, 2008-01-04 12:06:17+01:00, mattiasj@witty. +0 -47
    Bug#30459 Partitioning across disks failing on Windows
    Moved symlink specific tests to partition_symlink
    test file

  mysql-test/t/partition_symlink.test@stripped, 2008-01-04 12:06:17+01:00, mattiasj@witty. +49 -1
    Bug#30459 Partitioning across disks failing on Windows
    Moved symlink specific tests from partition.test
    test file

  mysql-test/t/partition_windows.test@stripped, 2008-01-04 12:06:17+01:00, mattiasj@witty. +24 -13
    Bug#30459 Partitioning across disks failing on Windows
    test file

  sql/partition_info.cc@stripped, 2008-01-04 12:06:17+01:00, mattiasj@witty. +12 -2
    Bug#30459 Partitioning across disks failing on Windows
    
    Problem was that there are no support for symlinked files on Windows for
    mysqld. So we fail when trying to create them.
    
    Solution: Ignore the DATA/INDEX DIRECTORY clause for partitions and push
    a warning. (Just like a MyISAM table)

diff -Nrup a/mysql-test/r/partition.result b/mysql-test/r/partition.result
--- a/mysql-test/r/partition.result	2007-12-13 12:56:00 +01:00
+++ b/mysql-test/r/partition.result	2008-01-04 12:06:17 +01:00
@@ -44,15 +44,6 @@ partition by key(a)
 partitions 1e+300;
 ERROR 42000: Only integers allowed as number here near '1e+300' at line 3
 create table t1 (a int)
-partition by key (a)
-(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
-ERROR 42000: Incorrect table name 'part-data'
-create table t1 (a int)
-partition by key (a)
-(partition p0,
-partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
-ERROR 42000: Incorrect table name 'part-data'
-create table t1 (a int)
 partition by list (a)
 (partition p0 values in (1));
 create procedure pz()
@@ -1207,25 +1198,6 @@ SELECT t2.id FROM t2 WHERE t2.id IN (SEL
 id
 22589
 drop table t1, t2;
-set @org_mode=@@sql_mode;
-set @@sql_mode='NO_DIR_IN_CREATE';
-select @@sql_mode;
-@@sql_mode
-NO_DIR_IN_CREATE
-create table t1 (i int )
-partition by range (i)
-(
-partition p01 values less than (1000)
-data directory='/not/existing'
-    index directory='/not/existing'
-);
-show create table t2;
-Table	Create Table
-t2	CREATE TABLE `t2` (
-  `i` int(11) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
-DROP TABLE t1, t2;
-set @@sql_mode=@org_mode;
 create table t1 (c1 varchar(255),c2 tinyint,primary key(c1))
 partition by key (c1) partitions 10 ;
 insert into t1 values ('aaa','1') on duplicate key update c2 = c2 + 1;
diff -Nrup a/mysql-test/r/partition_symlink.result b/mysql-test/r/partition_symlink.result
--- a/mysql-test/r/partition_symlink.result	2007-11-12 13:23:43 +01:00
+++ b/mysql-test/r/partition_symlink.result	2008-01-04 12:06:17 +01:00
@@ -81,3 +81,34 @@ Got one of the listed errors
 DROP DATABASE mysqltest2;
 USE test;
 DROP USER mysqltest_1@localhost;
+set @org_mode=@@sql_mode;
+set @@sql_mode='NO_DIR_IN_CREATE';
+select @@sql_mode;
+@@sql_mode
+NO_DIR_IN_CREATE
+create table t1 (i int )
+partition by range (i)
+(
+partition p01 values less than (1000)
+data directory='/not/existing'
+    index directory='/not/existing'
+);
+Warnings:
+Warning	0	DATA DIRECTORY option ignored
+Warning	0	INDEX DIRECTORY option ignored
+show create table t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
+DROP TABLE t1, t2;
+set @@sql_mode=@org_mode;
+create table t1 (a int)
+partition by key (a)
+(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
+ERROR 42000: Incorrect table name 'part-data'
+create table t1 (a int)
+partition by key (a)
+(partition p0,
+partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
+ERROR 42000: Incorrect table name 'part-data'
diff -Nrup a/mysql-test/r/partition_windows.result b/mysql-test/r/partition_windows.result
--- a/mysql-test/r/partition_windows.result	2007-04-23 19:50:32 +02:00
+++ b/mysql-test/r/partition_windows.result	2008-01-04 12:06:17 +01:00
@@ -1,14 +1,30 @@
-DROP TABLE IF EXISTS `example`;
-CREATE TABLE `example` (
-`ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
-`DESCRIPTION` varchar(30) NOT NULL,
-`LEVEL` smallint(5) unsigned DEFAULT NULL,
-PRIMARY KEY (`ID_EXAMPLE`)
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+c1 int(10) unsigned NOT NULL AUTO_INCREMENT,
+c2 varchar(30) NOT NULL,
+c3 smallint(5) unsigned DEFAULT NULL,
+PRIMARY KEY (c1)
 ) ENGINE = MYISAM 
-PARTITION BY HASH(ID_EXAMPLE)(
-PARTITION p0 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p0Data',
-PARTITION p1 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p1Data',
-PARTITION p2 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p2Data',
-PARTITION p3 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p3Data'
+PARTITION BY HASH(c1)(
+PARTITION p0
+DATA DIRECTORY = 'C:/mysqltest/p0Data'
+    INDEX DIRECTORY = 'D:/mysqltest/p0Index',
+PARTITION p1,
+PARTITION p2
+DATA DIRECTORY = 'E:/mysqltest/p2Data'
+    INDEX DIRECTORY = 'F:/mysqltest/p2Index'
 );
-ERROR HY000: Can't create/write to file 'C:\build\5.1\data\partitiontest\p0Data\example#P#p0.MYD' (Errcode: 2)
+Warnings:
+Warning	0	DATA DIRECTORY option ignored
+Warning	0	INDEX DIRECTORY option ignored
+Warning	0	DATA DIRECTORY option ignored
+Warning	0	INDEX DIRECTORY option ignored
+INSERT INTO t1 VALUES (NULL, "first", 1);
+INSERT INTO t1 VALUES (NULL, "second", 2);
+INSERT INTO t1 VALUES (NULL, "third", 3);
+ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY = 'G:/mysqltest/p3Data' INDEX DIRECTORY = 'H:/mysqltest/p3Index');
+Warnings:
+Warning	0	DATA DIRECTORY option ignored
+Warning	0	INDEX DIRECTORY option ignored
+INSERT INTO t1 VALUES (NULL, "last", 4);
+DROP TABLE t1;
diff -Nrup a/mysql-test/t/partition.test b/mysql-test/t/partition.test
--- a/mysql-test/t/partition.test	2007-12-13 12:56:00 +01:00
+++ b/mysql-test/t/partition.test	2008-01-04 12:06:17 +01:00
@@ -79,24 +79,6 @@ partition by key(a)
 partitions 1e+300;
 
 #
-# Bug 21350: Data Directory problems
-#
--- error ER_WRONG_TABLE_NAME
-create table t1 (a int)
-partition by key (a)
-(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
-
-#
-# Insert a test that manages to create the first partition and fails with
-# the second, ensure that we clean up afterwards in a proper manner.
-#
---error ER_WRONG_TABLE_NAME
-create table t1 (a int)
-partition by key (a)
-(partition p0,
- partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
-
-#
 # Bug 19309 Partitions: Crash if double procedural alter
 #
 create table t1 (a int)
@@ -1397,35 +1379,6 @@ INSERT INTO t2 VALUES
 SELECT t2.id FROM t2 WHERE t2.id IN (SELECT id FROM t1 WHERE status = 'Verified');
 
 drop table t1, t2;
-
-#
-# Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables 
-#
-
-disable_query_log;
-eval create table t2 (i int )
-partition by range (i)
-(
-    partition p01 values less than (1000)
-    data directory="$MYSQLTEST_VARDIR/master-data/test/"
-    index directory="$MYSQLTEST_VARDIR/master-data/test/"
-);
-enable_query_log;
-
-set @org_mode=@@sql_mode;
-set @@sql_mode='NO_DIR_IN_CREATE';
-select @@sql_mode;
-create table t1 (i int )
-partition by range (i)
-(
-    partition p01 values less than (1000)
-    data directory='/not/existing'
-    index directory='/not/existing'
-);
-
-show create table t2;
-DROP TABLE t1, t2;
-set @@sql_mode=@org_mode;
 
 #
 # Bug #27123 partition + on duplicate key update + varchar = Can't find record in <table> 
diff -Nrup a/mysql-test/t/partition_symlink.test b/mysql-test/t/partition_symlink.test
--- a/mysql-test/t/partition_symlink.test	2007-11-13 11:12:51 +01:00
+++ b/mysql-test/t/partition_symlink.test	2008-01-04 12:06:17 +01:00
@@ -2,7 +2,9 @@
 # (DATA/INDEX DIR requires symlinks)
 -- source include/have_partition.inc
 -- source include/have_symlink.inc
-# remove the not_windows line after fixing bug#30459
+# remove the not_windows line after fixing bug#33687
+# symlinks must also work for files, not only directories
+# as in --skip-symbolic-links
 -- source include/not_windows.inc
 -- disable_warnings
 DROP TABLE IF EXISTS t1;
@@ -118,4 +120,50 @@ connection default;
   DROP USER mysqltest_1@localhost;
   disconnect con1;
 
+#
+# Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables 
+#
+
+disable_query_log;
+eval create table t2 (i int )
+partition by range (i)
+(
+    partition p01 values less than (1000)
+    data directory="$MYSQLTEST_VARDIR/master-data/test/"
+    index directory="$MYSQLTEST_VARDIR/master-data/test/"
+);
+enable_query_log;
+
+set @org_mode=@@sql_mode;
+set @@sql_mode='NO_DIR_IN_CREATE';
+select @@sql_mode;
+create table t1 (i int )
+partition by range (i)
+(
+    partition p01 values less than (1000)
+    data directory='/not/existing'
+    index directory='/not/existing'
+);
+
+show create table t2;
+DROP TABLE t1, t2;
+set @@sql_mode=@org_mode;
+
+#
+# Bug 21350: Data Directory problems
+#
+-- error ER_WRONG_TABLE_NAME
+create table t1 (a int)
+partition by key (a)
+(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
+
+#
+# Insert a test that manages to create the first partition and fails with
+# the second, ensure that we clean up afterwards in a proper manner.
+#
+--error ER_WRONG_TABLE_NAME
+create table t1 (a int)
+partition by key (a)
+(partition p0,
+ partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
 
diff -Nrup a/mysql-test/t/partition_windows.test b/mysql-test/t/partition_windows.test
--- a/mysql-test/t/partition_windows.test	2007-04-23 19:50:32 +02:00
+++ b/mysql-test/t/partition_windows.test	2008-01-04 12:06:17 +01:00
@@ -7,23 +7,34 @@
 #
 # Bug 25141: Crash Server on Partitioning command
 #
+# Bug#30459: Partitioning across disks failing on Windows
+# updated this test, since symlinked files are not supported on Windows
+# (not the same as symlinked directories that have a special hack
+# on windows). This test is not dependent on have_symlink.
 
 --disable_warnings
-DROP TABLE IF EXISTS `example`;
+DROP TABLE IF EXISTS t1;
 --enable_warnings
 
---disable_abort_on_error
-CREATE TABLE `example` (
-  `ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `DESCRIPTION` varchar(30) NOT NULL,
-  `LEVEL` smallint(5) unsigned DEFAULT NULL,
-  PRIMARY KEY (`ID_EXAMPLE`)
+CREATE TABLE t1 (
+  c1 int(10) unsigned NOT NULL AUTO_INCREMENT,
+  c2 varchar(30) NOT NULL,
+  c3 smallint(5) unsigned DEFAULT NULL,
+  PRIMARY KEY (c1)
 ) ENGINE = MYISAM 
-PARTITION BY HASH(ID_EXAMPLE)(
-PARTITION p0 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p0Data',
-PARTITION p1 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p1Data',
-PARTITION p2 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p2Data',
-PARTITION p3 DATA DIRECTORY = 'C:/build/5.1/data/partitiontest/p3Data'
+PARTITION BY HASH(c1)(
+  PARTITION p0
+    DATA DIRECTORY = 'C:/mysqltest/p0Data'
+    INDEX DIRECTORY = 'D:/mysqltest/p0Index',
+  PARTITION p1,
+  PARTITION p2
+    DATA DIRECTORY = 'E:/mysqltest/p2Data'
+    INDEX DIRECTORY = 'F:/mysqltest/p2Index'
 );
---enable_abort_on_error
+INSERT INTO t1 VALUES (NULL, "first", 1);
+INSERT INTO t1 VALUES (NULL, "second", 2);
+INSERT INTO t1 VALUES (NULL, "third", 3);
+ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY = 'G:/mysqltest/p3Data' INDEX DIRECTORY = 'H:/mysqltest/p3Index');
+INSERT INTO t1 VALUES (NULL, "last", 4);
+DROP TABLE t1;
 
diff -Nrup a/sql/partition_info.cc b/sql/partition_info.cc
--- a/sql/partition_info.cc	2007-12-11 17:51:35 +01:00
+++ b/sql/partition_info.cc	2008-01-04 12:06:17 +01:00
@@ -794,8 +794,18 @@ bool partition_info::check_partition_inf
       partition_element *part_elem= part_it++;
       if (part_elem->engine_type == NULL)
         part_elem->engine_type= default_engine_type;
-      if (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE)
-        part_elem->data_file_name= part_elem->index_file_name= 0;
+#ifdef HAVE_READLINK
+      if (!my_use_symdir || (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE))
+#endif
+      {
+        if (part_elem->data_file_name)
+          push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
+                       "DATA DIRECTORY option ignored");
+        if (part_elem->index_file_name)
+          push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
+                       "INDEX DIRECTORY option ignored");
+        part_elem->data_file_name= part_elem->index_file_name= NULL;
+      }
       if (!is_sub_partitioned())
       {
         if (check_table_name(part_elem->partition_name,
Thread
bk commit into 5.1 tree (mattiasj:1.2650) BUG#30459mattiasj4 Jan