List:Commits« Previous MessageNext Message »
From:Mattias Jonsson Date:October 21 2009 7:36pm
Subject:bzr commit into mysql branch (mattias.jonsson:2830) Bug#44108
View as plain text  
#At file:///Users/mattiasj/clones/bzrroot/mysql-azalea-wl4571/ based on revid:mikael@stripped

 2830 Mattias Jonsson	2009-10-21
      port of the fix for bug#44108 into mysql-azalea-wl4571

    modified:
      mysql-test/r/partition_error.result
      mysql-test/t/partition_error.test
      sql/ha_partition.cc
=== modified file 'mysql-test/r/partition_error.result'
--- a/mysql-test/r/partition_error.result	2009-02-20 12:37:37 +0000
+++ b/mysql-test/r/partition_error.result	2009-10-21 19:36:12 +0000
@@ -1,4 +1,9 @@
 drop table if exists t1;
+CREATE TABLE t1 (a int, b int) PARTITION BY HASH (a) PARTITIONS 2;
+INSERT INTO t1 VALUES (1,2);
+INSERT INTO t1 (a) SELECT * FROM t1;
+ERROR 21S01: Column count doesn't match value count at row 1
+DROP TABLE t1;
 CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a));
 INSERT INTO t1 VALUES (1),(1);
 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'

=== modified file 'mysql-test/t/partition_error.test'
--- a/mysql-test/t/partition_error.test	2009-02-20 12:37:37 +0000
+++ b/mysql-test/t/partition_error.test	2009-10-21 19:36:12 +0000
@@ -7,7 +7,16 @@
 --disable_warnings
 drop table if exists t1;
 --enable_warnings
- 
+
+#
+# Bug#44108: Assertion bitmap_is_set in ha_partition::end_bulk_insert
+#
+CREATE TABLE t1 (a int, b int) PARTITION BY HASH (a) PARTITIONS 2;
+INSERT INTO t1 VALUES (1,2);
+--error ER_WRONG_VALUE_COUNT_ON_ROW
+INSERT INTO t1 (a) SELECT * FROM t1;
+DROP TABLE t1;
+
 #
 # Bug#38719: Partitioning returns a different error code for a
 # duplicate key error

=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc	2009-08-05 12:22:27 +0000
+++ b/sql/ha_partition.cc	2009-10-21 19:36:12 +0000
@@ -2555,6 +2555,7 @@ int ha_partition::open(const char *name,
   /* Initialize the bitmap we use to minimize ha_start_bulk_insert calls */
   if (bitmap_init(&m_bulk_insert_started, NULL, m_tot_parts + 1, FALSE))
     DBUG_RETURN(1);
+  bitmap_clear_all(&m_bulk_insert_started);
   /* Initialize the bitmap we use to determine what partitions are used */
   if (!is_clone)
   {
@@ -3497,6 +3498,9 @@ ha_rows ha_partition::guess_bulk_insert_
   RETURN VALUE
     >0                      Error code
     0                       Success
+
+  Note: end_bulk_insert can be called without start_bulk_insert
+        being called, see bug#44108.
 */
 
 int ha_partition::end_bulk_insert(bool abort)
@@ -3505,7 +3509,9 @@ int ha_partition::end_bulk_insert(bool a
   uint i;
   DBUG_ENTER("ha_partition::end_bulk_insert");
 
-  DBUG_ASSERT(bitmap_is_set(&m_bulk_insert_started, m_tot_parts));
+  if (!bitmap_is_set(&m_bulk_insert_started, m_tot_parts))
+    DBUG_RETURN(error);
+
   for (i= 0; i < m_tot_parts; i++)
   {
     int tmp;


Attachment: [text/bzr-bundle]
Thread
bzr commit into mysql branch (mattias.jonsson:2830) Bug#44108Mattias Jonsson21 Oct