Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1964 05/08/09 22:05:07 evgen@stripped +3 -0
Fix bug #12340 Wrong comparison in ha_innobase::cmp_ref()
When PRIMARY KEY is present ha_innobase::cmp_ref() uses it to compare refs.
After comparing part of key it moves pointers to compare next part.
For varchar parts pointers were moved only by length of parts, not including
bytes containig part length itself. This results in wrong comparision and
wrong number of deleted records.
mysql-test/r/innodb.result
1.125 05/08/09 22:04:21 evgen@stripped +8 -0
Test case for bug #12340 ha_innobase::cmp_ref() moves pointers by wrong length.
mysql-test/t/innodb.test
1.98 05/08/09 22:03:32 evgen@stripped +10 -0
Test case for bug #12340 ha_innobase::cmp_ref() moves pointers by wrong length.
sql/ha_innodb.cc
1.239 05/08/09 21:59:59 evgen@stripped +2 -2
Fix bug #12340 ha_innobase::cmp_ref() moves pointers by wrong length.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: evgen
# Host: moonbone.local
# Root: /work/mysql-5.0-bug-12340
--- 1.124/mysql-test/r/innodb.result 2005-07-28 13:30:30 +04:00
+++ 1.125/mysql-test/r/innodb.result 2005-08-09 22:04:21 +04:00
@@ -2475,3 +2475,11 @@
GRADE
151
DROP TABLE t1;
+create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb;
+create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb;
+insert into t2 values ('aa','cc');
+insert into t1 values ('aa','bb'),('aa','cc');
+delete t1 from t1,t2 where f1=f3 and f4='cc';
+select * from t1;
+f1 f2
+drop table t1,t2;
--- 1.97/mysql-test/t/innodb.test 2005-07-28 18:09:48 +04:00
+++ 1.98/mysql-test/t/innodb.test 2005-08-09 22:03:32 +04:00
@@ -1394,3 +1394,13 @@
SELECT GRADE FROM t1 WHERE GRADE= 151;
DROP TABLE t1;
+#
+# Bug #12340 multitable delete deletes only one record
+#
+create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb;
+create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb;
+insert into t2 values ('aa','cc');
+insert into t1 values ('aa','bb'),('aa','cc');
+delete t1 from t1,t2 where f1=f3 and f4='cc';
+select * from t1;
+drop table t1,t2;
--- 1.238/sql/ha_innodb.cc 2005-08-09 12:21:41 +04:00
+++ 1.239/sql/ha_innodb.cc 2005-08-09 21:59:59 +04:00
@@ -6852,8 +6852,8 @@
return(result);
}
- ref1 += key_part->length;
- ref2 += key_part->length;
+ ref1 += key_part->store_length;
+ ref2 += key_part->store_length;
}
return(0);
| Thread |
|---|
| • bk commit into 5.0 tree (evgen:1.1964) BUG#12340 | eugene | 9 Aug |