Commit 7e9728a9 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-17545 Predicate lock for SPATIAL INDEX should lock non-matching record

rtr_pcur_getnext_from_path(): Remove a bogus condition.
The predicate lock should be acquired also on no match,
to ensure that the locking read will be repeatable.

This is based on the following fix in MySQL 5.7.24:

commit 365111c590082984dbae42e1d1da28ac3f7fb5bd
Author: Jimmy Yang <jimmy.yang@oracle.com>
Date:   Wed Jun 6 16:23:00 2018 -0700

    Fix Bug 27577612 - CONCURRENT SERIALIZABLE TRANSACTIONS CAN INSERT INTO
    AN AREA SELECTED FOR UPDATE
    Backport fix to mysql-5.7
Reviewed-by: default avatarAllen Lai <allen.lai@oracle.com>

No test case is added, because the MySQL 5.7 test case would pass
even when the fix is not present. We would need a test case that
only causes a locking conflict on the spatial index.
parent a21e01a5
/***************************************************************************** /*****************************************************************************
Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2016, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, MariaDB Corporation. Copyright (c) 2017, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
...@@ -389,8 +389,7 @@ rtr_pcur_getnext_from_path( ...@@ -389,8 +389,7 @@ rtr_pcur_getnext_from_path(
if (mode != PAGE_CUR_RTREE_INSERT if (mode != PAGE_CUR_RTREE_INSERT
&& mode != PAGE_CUR_RTREE_LOCATE && mode != PAGE_CUR_RTREE_LOCATE
&& mode >= PAGE_CUR_CONTAIN && mode >= PAGE_CUR_CONTAIN
&& btr_cur->rtr_info->need_prdt_lock && btr_cur->rtr_info->need_prdt_lock) {
&& found) {
lock_prdt_t prdt; lock_prdt_t prdt;
trx_t* trx = thr_get_trx( trx_t* trx = thr_get_trx(
......
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