summaryrefslogtreecommitdiff
path: root/innobase/row/row0sel.c
diff options
context:
space:
mode:
authorunknown <jan@hundin.mysql.fi>2004-10-14 15:36:36 +0300
committerunknown <jan@hundin.mysql.fi>2004-10-14 15:36:36 +0300
commitdbe2739292987f9c310a392ebd8af8dd96f75b6b (patch)
tree9a624ca9a10ab262e3fd87d859d44617a85f4e78 /innobase/row/row0sel.c
parent761ae02ca77722f34744a912315d52a0c0f7fca6 (diff)
downloadmariadb-git-dbe2739292987f9c310a392ebd8af8dd96f75b6b.tar.gz
This patch removes unnecessary lock from the supremum record, takes
X-locks on duplicates also on LOAD DATA...REPLACE clause and fixes a bug #6086 adding --disable_warnings and --enable_warnings around the create table clauses in ctype_utf8 tests for InnoDB. innobase/dict/dict0dict.c: Remove static. innobase/include/dict0dict.h: Add prototype for a function dict_scan_to innobase/row/row0ins.c: Add support for a LOAD DATA INFILE 'xxx' REPLACE INTO TABLE x. We should take X-locks on both REPLACE and LOAD DATA...REPLACE queries to duplicate records. innobase/row/row0sel.c: If innodb_locks_unsafe_for_binlog options is used we do not lock gaps. Supremum record is really a dummy record i.e. gap, therefore we do set locks there. mysql-test/t/ctype_utf8.test: Fix bug #6086: Add --disable_warnings and --enable_warnings around the create table where engine=innodb.
Diffstat (limited to 'innobase/row/row0sel.c')
-rw-r--r--innobase/row/row0sel.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c
index 3ff94c8f238..740241fa210 100644
--- a/innobase/row/row0sel.c
+++ b/innobase/row/row0sel.c
@@ -2794,7 +2794,7 @@ row_search_for_mysql(
rec_t* index_rec;
rec_t* clust_rec;
rec_t* old_vers;
- ulint err;
+ ulint err = DB_SUCCESS;
ibool moved;
ibool cons_read_requires_clust_rec;
ibool was_lock_wait;
@@ -3203,26 +3203,20 @@ rec_loop:
if (prebuilt->select_lock_type != LOCK_NONE
&& set_also_gap_locks) {
- /* Try to place a lock on the index record */
+ /* Try to place a lock on the index record */
- /* If innodb_locks_unsafe_for_binlog option is used,
- we lock only the record, i.e. next-key locking is
- not used.
- */
- if ( srv_locks_unsafe_for_binlog )
- {
- err = sel_set_rec_lock(rec, index,
- prebuilt->select_lock_type,
- LOCK_REC_NOT_GAP, thr);
- }
- else
+ /* If innodb_locks_unsafe_for_binlog option is used,
+ we do not lock gaps. Supremum record is really
+ a gap and therefore we do not set locks there. */
+
+ if ( srv_locks_unsafe_for_binlog == FALSE )
{
- err = sel_set_rec_lock(rec, index,
+ err = sel_set_rec_lock(rec, index,
prebuilt->select_lock_type,
LOCK_ORDINARY, thr);
}
-
- if (err != DB_SUCCESS) {
+
+ if (err != DB_SUCCESS) {
goto lock_wait_or_error;
}