bk commit into 4.1 tree (jan:1.2174) BUG#9354 -
04-11-2005
, 07:40 AM
Below is the list of changes that have just been committed into a local
4.1 repository of jan. When jan 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/in...urce-tree.html
ChangeSet
1.2174 05/04/11 14:53:00 jan (AT) hundin (DOT) mysql.fi +1 -0
Fixed a feature request were next-key locking doesn't allow the insert
which does not produce phantom (Bug #9354).
For example if we have a query SELECT * FROM T1 WHERE A >= 100 FOR UPDATE.
We allow INSERT INTO T1 VALUES(50) without waiting if 100 exists in
cluster index.
But if we have a query SELECT * FROM T1 WHERE A <= 104 FOR UPDATE.
This patch do not allow INSERT INTO T1 VALUES(200) without waiting.
innobase/row/row0sel.c
1.68 05/04/11 14:52:33 jan (AT) hundin (DOT) mysql.fi +18 -1
Fixed a feature request were next-key locking doesn't allow the insert
which does not produce phantom (Bug #9354).
# 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: jan
# Host: hundin.mysql.fi
# Root: /home/jan/mysql-4.1
--- 1.67/innobase/row/row0sel.c Wed Apr 6 10:27:08 2005
+++ 1.68/innobase/row/row0sel.c Mon Apr 11 14:52:33 2005
@@ -3490,9 +3490,26 @@
prebuilt->select_lock_type,
LOCK_REC_NOT_GAP, thr);
} else {
- err = sel_set_rec_lock(rec, index,
+
+ /* If a constant search tuple is found
+ directly from cluster index we lock only
+ a record. For example: WHERE a >= 100,
+ where a is primary key */
+
+ if(index == clust_index &&
+ match_mode == ROW_SEL_OPEN_CURSOR &&
+ mode == PAGE_CUR_GE &&
+ !cmp_dtuple_rec(search_tuple, rec)) {
+
+ err = sel_set_rec_lock(rec, index,
+ prebuilt->select_lock_type,
+ LOCK_REC_NOT_GAP, thr);
+ } else {
+
+ err = sel_set_rec_lock(rec, index,
prebuilt->select_lock_type,
LOCK_ORDINARY, thr);
+ }
}
}
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?uns...ie.nctu.edu.tw |