Commit c0bac981 authored by unknown's avatar unknown

BUG#20852: Using update with full table scan causes mysqld to enter an eternal loop


mysql-test/r/partition_innodb.result:
  New test case
mysql-test/t/partition_innodb.test:
  New test case
sql/ha_partition.cc:
  Two more handler interface variables not taken care of
parent 32369e27
......@@ -107,3 +107,14 @@ select * from t1 where id = 'aaa';
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;
......@@ -78,3 +78,16 @@ select * from t1 where id = 'a';
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;
......@@ -2229,7 +2229,8 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment