List:Commits« Previous MessageNext Message »
From:Anurag Shekhar Date:July 27 2009 11:20am
Subject:bzr commit into mysql-5.1-bugteam branch (anurag.shekhar:3039)
Bug#30102
View as plain text  
#At file:///home/anurag/mysqlsrc/mysql-5.1-bugteam/ based on revid:satya.bn@stripped

 3039 Anurag Shekhar	2009-07-27
      Bug #30102 rename table does corrupt tables with partition files on failure.
      
      One of the tests introduced for this bug was failing 
      because of path size restriction in windows.
      Moved the test case to a new test which is disabled under windows.
     @ mysql-test/r/partition_not_embedded.result
        updated test results after removing a test case.
     @ mysql-test/r/partition_rename_longfilename.result
        Test result for partition_rename_longfilename
     @ mysql-test/t/partition_not_embedded.test
        Removed the test case which tests renaming partition table such that
        the file name is 255 char long.
     @ mysql-test/t/partition_rename_longfilename.test
        Test case to test renaming partition table such that
        the file name is 255 char long.
        Moved from partition_no_embedded.

    added:
      mysql-test/r/partition_rename_longfilename.result
      mysql-test/t/partition_rename_longfilename.test
    modified:
      mysql-test/r/partition_not_embedded.result
      mysql-test/t/partition_not_embedded.test
=== modified file 'mysql-test/r/partition_not_embedded.result'
--- a/mysql-test/r/partition_not_embedded.result	2009-07-24 10:11:23 +0000
+++ b/mysql-test/r/partition_not_embedded.result	2009-07-27 11:20:43 +0000
@@ -41,32 +41,6 @@ a
 7
 8
 9
-# Renaming to a file name where the first partition is 155 chars
-# and the second partition is 255 chars
-RENAME TABLE t1 TO `t2_............................end`;
-# List of files in database `test`, should not be any t1-files here
-# List of files in database `test`, should be all t2-files here
-t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p0.MYD
-t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p0.MYI
-t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@stripped
-t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@stripped
-t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p2.MYD
-t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p2.MYI
-t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@stripped
-t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@stripped
-SELECT * FROM `t2_............................end`;
-a
-1
-10
-2
-3
-4
-5
-6
-7
-8
-9
-RENAME TABLE `t2_............................end` to t1;
 # List of files in database `test`, should be all t1-files here
 t1#P#p0.MYD
 t1#P#p0.MYI

=== added file 'mysql-test/r/partition_rename_longfilename.result'
--- a/mysql-test/r/partition_rename_longfilename.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/partition_rename_longfilename.result	2009-07-27 11:20:43 +0000
@@ -0,0 +1,66 @@
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (a INT)
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (6),
+PARTITION `p1....................` VALUES LESS THAN (9),
+PARTITION p2 VALUES LESS THAN MAXVALUE);
+# List of files in database `test`, all original t1-files here
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@stripped
+t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@stripped
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1.frm
+t1.par
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+# Renaming to a file name where the first partition is 155 chars
+# and the second partition is 255 chars
+RENAME TABLE t1 TO `t2_............................end`;
+# List of files in database `test`, should not be any t1-files here
+# List of files in database `test`, should be all t2-files here
+t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p0.MYD
+t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p0.MYI
+t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@stripped
+t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@stripped
+t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p2.MYD
+t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002eend#P#p2.MYI
+t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@stripped
+t2_@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@stripped
+SELECT * FROM `t2_............................end`;
+a
+1
+10
+2
+3
+4
+5
+6
+7
+8
+9
+RENAME TABLE `t2_............................end` to t1;
+# List of files in database `test`, should be all t1-files here
+t1#P#p0.MYD
+t1#P#p0.MYI
+t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@stripped
+t1#P#p1@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@stripped
+t1#P#p2.MYD
+t1#P#p2.MYI
+t1.frm
+t1.par
+SELECT * FROM t1;
+a
+1
+10
+2
+3
+4
+5
+6
+7
+8
+9
+DROP TABLE t1;
+# Should not be any files left here
+# End of bug#30102 test.

=== modified file 'mysql-test/t/partition_not_embedded.test'
--- a/mysql-test/t/partition_not_embedded.test	2009-07-24 10:11:23 +0000
+++ b/mysql-test/t/partition_not_embedded.test	2009-07-27 11:20:43 +0000
@@ -31,22 +31,6 @@ RENAME TABLE t1 TO `t2_new..............
 --list_files $MYSQLD_DATADIR/test t1*
 --sorted_result
 SELECT * FROM t1;
---echo # Renaming to a file name where the first partition is 155 chars
---echo # and the second partition is 255 chars
-RENAME TABLE t1 TO `t2_............................end`;
-#                      1234567890123456789012345678
-# t2_ + end
-#     .MY[ID] or .frm
-#         #P#p[012]
-#             28 * @002e
-# 6 + 4 + 5 + 28 * 5 = 155
---echo # List of files in database `test`, should not be any t1-files here
---list_files $MYSQLD_DATADIR/test t1*
---echo # List of files in database `test`, should be all t2-files here
---list_files $MYSQLD_DATADIR/test t2*
---sorted_result
-SELECT * FROM `t2_............................end`;
-RENAME TABLE `t2_............................end` to t1;
 --echo # List of files in database `test`, should be all t1-files here
 --list_files $MYSQLD_DATADIR/test t1*
 --echo # Renaming to a file name where the first partition is 156 chars

=== added file 'mysql-test/t/partition_rename_longfilename.test'
--- a/mysql-test/t/partition_rename_longfilename.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/partition_rename_longfilename.test	2009-07-27 11:20:43 +0000
@@ -0,0 +1,50 @@
+-- source include/not_windows.inc
+-- source include/have_partition.inc
+-- source include/not_embedded.inc
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+--enable_warnings
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+
+#
+# Bug#30102: rename table does corrupt tables with partition files on failure
+# This test case renames the table such that the partition file name 
+# is 255 chars long. Due the restriction of 260 char path name (including drive label)
+# this will fail in windows.
+# Other tests related to this bug can be found in partition_not_embedded.test
+#
+CREATE TABLE t1 (a INT)
+PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (6),
+ PARTITION `p1....................` VALUES LESS THAN (9),
+ PARTITION p2 VALUES LESS THAN MAXVALUE);
+# partition p1 is 't1#P#p1' + @002e * 20 = 107 characters + file ending
+# total path lenght of './test/t1#P#p1@002e@002e<...>@002e.MY[ID]' is 118 chars
+--echo # List of files in database `test`, all original t1-files here
+--list_files $MYSQLD_DATADIR/test t1*
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+--echo # Renaming to a file name where the first partition is 155 chars
+--echo # and the second partition is 255 chars
+RENAME TABLE t1 TO `t2_............................end`;
+#                      1234567890123456789012345678
+# t2_ + end
+#     .MY[ID] or .frm
+#         #P#p[012]
+#             28 * @002e
+# 6 + 4 + 5 + 28 * 5 = 155
+--echo # List of files in database `test`, should not be any t1-files here
+--list_files $MYSQLD_DATADIR/test t1*
+--echo # List of files in database `test`, should be all t2-files here
+--list_files $MYSQLD_DATADIR/test t2*
+--sorted_result
+SELECT * FROM `t2_............................end`;
+RENAME TABLE `t2_............................end` to t1;
+--echo # List of files in database `test`, should be all t1-files here
+--list_files $MYSQLD_DATADIR/test t1*
+--sorted_result
+SELECT * FROM t1;
+DROP TABLE t1;
+--echo # Should not be any files left here
+--list_files $MYSQLD_DATADIR/test t1*
+--list_files $MYSQLD_DATADIR/test t2*
+--echo # End of bug#30102 test.


Attachment: [text/bzr-bundle] bzr/anurag.shekhar@sun.com-20090727112043-0lyi2jjdivbjrwno.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (anurag.shekhar:3039)Bug#30102Anurag Shekhar27 Jul