List:Commits« Previous MessageNext Message »
From:Jon Olav Hauglid Date:May 10 2011 8:54am
Subject:bzr commit into mysql-trunk branch (jon.hauglid:3388) Bug#11747690
View as plain text  
#At file:///export/home/x/mysql-trunk-bug11747690/ based on revid:serge.kozlov@stripped

 3388 Jon Olav Hauglid	2011-05-10
      Bug#11747690 (former 33650)
      MYSQL_ALTER_TABLE() UNNECESSARILY DOES FULL TABLE COPY
      
      The problem was that full table copy was done when creating an
      index on a UTF-8 VARCHAR column (rather than using in-place
      ALTER TABLE).
      
      This problem is not repeatable using InnoDB. It is repeatable
      using MyISAM, but MyISAM does not support in-place add index in
      general, not just for UTF-8 VARCHAR columns. Therefore the current
      behavior is not a bug with regards to MyISAM.
      
      This patch adds a regression test for InnoDB and contains no
      code changes.

    modified:
      mysql-test/r/innodb_mysql_lock.result
      mysql-test/t/innodb_mysql_lock.test
=== modified file 'mysql-test/r/innodb_mysql_lock.result'
--- a/mysql-test/r/innodb_mysql_lock.result	2011-04-13 18:43:08 +0000
+++ b/mysql-test/r/innodb_mysql_lock.result	2011-05-10 08:54:26 +0000
@@ -170,3 +170,15 @@ id	value
 1	12345
 COMMIT;
 DROP TABLE t1;
+#
+# Bug#11747690 33650: MYSQL_ALTER_TABLE() UNNECESSARILY DOES
+#              FULL TABLE COPY 
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a INT, b VARCHAR(255), PRIMARY KEY(a,b))
+engine=innodb default charset=utf8;
+INSERT INTO t1 VALUES (1, 'a'), (2, 'b');
+CREATE INDEX t1ba ON t1(b,a);
+affected rows: 0
+info: Records: 0  Duplicates: 0  Warnings: 0
+DROP TABLE t1;

=== modified file 'mysql-test/t/innodb_mysql_lock.test'
--- a/mysql-test/t/innodb_mysql_lock.test	2011-04-13 18:43:08 +0000
+++ b/mysql-test/t/innodb_mysql_lock.test	2011-05-10 08:54:26 +0000
@@ -311,6 +311,27 @@ DROP TABLE t1;
 disconnect con1;
 
 
+--echo #
+--echo # Bug#11747690 33650: MYSQL_ALTER_TABLE() UNNECESSARILY DOES
+--echo #              FULL TABLE COPY 
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1(a INT, b VARCHAR(255), PRIMARY KEY(a,b))
+  engine=innodb default charset=utf8;
+INSERT INTO t1 VALUES (1, 'a'), (2, 'b');
+
+# Check that 0 rows are affected
+--enable_info
+CREATE INDEX t1ba ON t1(b,a);
+--disable_info
+
+DROP TABLE t1;
+
+
 # Check that all connections opened by test cases in this file are really
 # gone so execution of other tests won't be affected by their presence.
 --source include/wait_until_count_sessions.inc


Attachment: [text/bzr-bundle] bzr/jon.hauglid@oracle.com-20110510085426-q2uq6f8uj5xqrgby.bundle
Thread
bzr commit into mysql-trunk branch (jon.hauglid:3388) Bug#11747690Jon Olav Hauglid10 May