List:Commits« Previous MessageNext Message »
From:Mattias Jonsson Date:October 6 2011 9:52am
Subject:bzr push into mysql-trunk branch (mattias.jonsson:3483 to 3484)
View as plain text  
 3484 Mattias Jonsson	2011-10-06 [merge]
      merge

    modified:
      mysql-test/r/partition_myisam.result
      mysql-test/t/partition_myisam.test
      sql/ha_partition.cc
      sql/ha_partition.h
 3483 Bjorn Munch	2011-10-05 [merge]
      null upmerge

=== modified file 'mysql-test/r/partition_myisam.result'
--- a/mysql-test/r/partition_myisam.result	2011-04-29 08:19:16 +0000
+++ b/mysql-test/r/partition_myisam.result	2011-10-06 09:50:40 +0000
@@ -1,5 +1,64 @@
 DROP TABLE IF EXISTS t1, t2;
 #
+# BUG#11933226 - 60681: CHECKSUM TABLE RETURNS 0 FOR PARTITIONED TABLE
+#
+CREATE TABLE t1 (
+i INT
+)
+ENGINE=MyISAM
+PARTITION BY RANGE (i)
+(PARTITION p3 VALUES LESS THAN (3),
+PARTITION p5 VALUES LESS THAN (5),
+PARTITION pMax VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6);
+CHECKSUM TABLE t1;
+Table	Checksum
+test.t1	2653438147
+ALTER TABLE t1 CHECKSUM = 1;
+CHECKSUM TABLE t1 EXTENDED;
+Table	Checksum
+test.t1	2653438147
+# Before patch this returned 0!
+CHECKSUM TABLE t1;
+Table	Checksum
+test.t1	2653438147
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 CHECKSUM=1
+/*!50100 PARTITION BY RANGE (i)
+(PARTITION p3 VALUES LESS THAN (3) ENGINE = MyISAM,
+ PARTITION p5 VALUES LESS THAN (5) ENGINE = MyISAM,
+ PARTITION pMax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+DROP TABLE t1;
+# Same test without partitioning
+CREATE TABLE t1 (
+i INT
+) ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6);
+CHECKSUM TABLE t1;
+Table	Checksum
+test.t1	2653438147
+ALTER TABLE t1 CHECKSUM = 1;
+CHECKSUM TABLE t1 EXTENDED;
+Table	Checksum
+test.t1	2653438147
+CHECKSUM TABLE t1;
+Table	Checksum
+test.t1	2653438147
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `i` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 CHECKSUM=1
+DROP TABLE t1;
+#
 # Bug#50036: Inconsistent errors when using TIMESTAMP
 #            columns/expressions
 # Added test with existing TIMESTAMP partitioning (when it was allowed).

=== modified file 'mysql-test/t/partition_myisam.test'
--- a/mysql-test/t/partition_myisam.test	2011-04-29 08:19:16 +0000
+++ b/mysql-test/t/partition_myisam.test	2011-10-06 09:50:40 +0000
@@ -9,6 +9,38 @@ DROP TABLE IF EXISTS t1, t2;
 
 let $MYSQLD_DATADIR= `SELECT @@datadir`;
 
+--echo #
+--echo # BUG#11933226 - 60681: CHECKSUM TABLE RETURNS 0 FOR PARTITIONED TABLE
+--echo #
+CREATE TABLE t1 (
+  i INT
+)
+ENGINE=MyISAM
+PARTITION BY RANGE (i)
+(PARTITION p3 VALUES LESS THAN (3),
+ PARTITION p5 VALUES LESS THAN (5),
+ PARTITION pMax VALUES LESS THAN MAXVALUE);
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6);
+CHECKSUM TABLE t1;
+ALTER TABLE t1 CHECKSUM = 1;
+CHECKSUM TABLE t1 EXTENDED;
+--echo # Before patch this returned 0!
+CHECKSUM TABLE t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo # Same test without partitioning
+CREATE TABLE t1 (
+  i INT
+) ENGINE=MyISAM;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6);
+CHECKSUM TABLE t1;
+ALTER TABLE t1 CHECKSUM = 1;
+CHECKSUM TABLE t1 EXTENDED;
+CHECKSUM TABLE t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
 
 --echo #
 --echo # Bug#50036: Inconsistent errors when using TIMESTAMP

=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc	2011-09-21 11:01:41 +0000
+++ b/sql/ha_partition.cc	2011-10-06 09:50:40 +0000
@@ -7338,6 +7338,27 @@ void ha_partition::init_table_handle_for
 }
 
 
+/**
+  Return the checksum of the table (all partitions)
+*/
+
+uint ha_partition::checksum() const
+{
+  ha_checksum sum= 0;
+
+  DBUG_ENTER("ha_partition::checksum");
+  if ((table_flags() & HA_HAS_CHECKSUM))
+  {
+    handler **file= m_file;
+    do
+    {
+      sum+= (*file)->checksum();
+    } while (*(++file));
+  }
+  DBUG_RETURN(sum);
+}
+
+
 /****************************************************************************
                 MODULE enable/disable indexes
 ****************************************************************************/

=== modified file 'sql/ha_partition.h'
--- a/sql/ha_partition.h	2011-07-05 16:45:26 +0000
+++ b/sql/ha_partition.h	2011-10-06 09:50:40 +0000
@@ -1105,8 +1105,8 @@ public:
     virtual int restore(THD* thd, HA_CHECK_OPT *check_opt);
     virtual int dump(THD* thd, int fd = -1);
     virtual int net_read_dump(NET* net);
-    virtual uint checksum() const;
   */
+    virtual uint checksum() const;
   /* Enabled keycache for performance reasons, WL#4571 */
     virtual int assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt);
     virtual int preload_keys(THD* thd, HA_CHECK_OPT* check_opt);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (mattias.jonsson:3483 to 3484) Mattias Jonsson7 Oct