List:Commits« Previous MessageNext Message »
From:Mikael Ronström Date:July 13 2006 12:51am
Subject:bk commit - 5.1 tree (mikael:1.2237) BUG#20852
View as plain text  
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2006/07/12 20:38:17-04:00 mikael@dator5.(none)
#   BUG#20852: Using update with full table scan causes mysqld to enter 
an eternal loop
#
# mysql-test/r/partition_innodb.result
#   2006/07/12 20:38:14-04:00 mikael@dator5.(none) +11 -0
#   New test case
#
# mysql-test/t/partition_innodb.test
#   2006/07/12 20:38:14-04:00 mikael@dator5.(none) +13 -0
#   New test case
#
# sql/ha_partition.cc
#   2006/07/12 20:38:14-04:00 mikael@dator5.(none) +2 -1
#   Two more handler interface variables not taken care of
#
diff -Nru a/mysql-test/r/partition_innodb.result 
b/mysql-test/r/partition_innodb.result
--- a/mysql-test/r/partition_innodb.result	2006-07-13 00:20:42 -04:00
+++ b/mysql-test/r/partition_innodb.result	2006-07-13 00:20:42 -04:00
@@ -107,3 +107,14 @@
  id
  aaa
  drop table t1;
+create table t1 (a int, b int, primary key (b,a))
+engine = innodb
+partition by hash (a);
+insert into t1 values (0, 0);
+insert into t1 values (1, 0);
+update t1 set b = b + 1 where a = 1;
+select * from t1;
+a	b
+0	0
+1	1
+drop table t1;
diff -Nru a/mysql-test/t/partition_innodb.test 
b/mysql-test/t/partition_innodb.test
--- a/mysql-test/t/partition_innodb.test	2006-07-13 00:20:42 -04:00
+++ b/mysql-test/t/partition_innodb.test	2006-07-13 00:20:42 -04:00
@@ -78,3 +78,16 @@
  select * from t1 where id = 'aa';
  select * from t1 where id = 'aaa';
  drop table t1;
+
+#
+# Bug #20852 Partitions: Crash if hash innodb, composite primary key
+#
+create table t1 (a int, b int, primary key (b,a))
+engine = innodb
+partition by hash (a);
+insert into t1 values (0, 0);
+insert into t1 values (1, 0);
+update t1 set b = b + 1 where a = 1;
+select * from t1;
+drop table t1;
+
diff -Nru a/sql/ha_partition.cc b/sql/ha_partition.cc
--- a/sql/ha_partition.cc	2006-07-13 00:20:42 -04:00
+++ b/sql/ha_partition.cc	2006-07-13 00:20:42 -04:00
@@ -2229,7 +2229,8 @@
    m_table_flags&= ~(HA_CAN_GEOMETRY | HA_CAN_FULLTEXT | 
HA_DUPLICATE_POS |
                      HA_CAN_SQL_HANDLER | HA_CAN_INSERT_DELAYED);
    m_table_flags|= HA_FILE_BASED | HA_REC_NOT_IN_SEQ;
-
+  key_used_on_scan= m_file[0]->key_used_on_scan;
+  implicit_emptied= m_file[0]->implicit_emptied;
    /*
      Add 2 bytes for partition id in position ref length.
      ref_length=max_in_all_partitions(ref_length) + 
PARTITION_BYTES_IN_POS

Mikael Ronstrom, Senior Software Architect
MySQL AB, www.mysql.com

Jumpstart your cluster:
http://www.mysql.com/consulting/packaged/cluster.html
My blog:
http://mikaelronstrom.blogspot.com

Thread
bk commit - 5.1 tree (mikael:1.2237) BUG#20852Mikael Ronström13 Jul