From 611456362f520bd5b3380e7cf90cfb2aaadd18be Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Apr 2007 21:43:42 +0500 Subject: Bug #27123 (partition + on duplicate key update + varchar = Can't find record in table) key_restore function didn't work as intended in the case of VARCHAR or BLOB fields, stored the restored key in field->ptr instead of to_record. That produced the wrong key so search returned wrong result mysql-test/r/partition.result: result added mysql-test/t/partition.test: testcase sql/field.cc: Field_blob::store_length made static sql/field.h: Field_blob::store_length and set_ptr functions implemented in slightly different way sql/ha_ndbcluster.cc: set_ptr_offset used sql/key.cc: set key_part->field->ptr to the proper place inside the to_record so the restored key will be placed there as key_restore is supposed to behave --- mysql-test/r/partition.result | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mysql-test/r/partition.result') diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 2e5fa4b9195..46b704dc7b7 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1238,4 +1238,12 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */ DROP TABLE t1, t2; set @@sql_mode=@org_mode; +create table t1 (c1 varchar(255),c2 tinyint,primary key(c1)) +partition by key (c1) partitions 10 ; +insert into t1 values ('aaa','1') on duplicate key update c2 = c2 + 1; +insert into t1 values ('aaa','1') on duplicate key update c2 = c2 + 1; +select * from t1; +c1 c2 +aaa 2 +drop table t1; End of 5.1 tests -- cgit v1.2.1