[MDEV-27460] trx_has_lock_x() gives wrong result if the table has pending table lock Created: 2022-01-10  Updated: 2022-01-11  Resolved: 2022-01-10

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.6.0, 10.7, 10.8
Fix Version/s: 10.6.6, 10.7.2, 10.8.1

Type: Bug Priority: Major
Reporter: Thirunarayanan Balathandayuthapani Assignee: Thirunarayanan Balathandayuthapani
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-25315 Assertion `ptr' failed in ut_align_do... Closed

 Description   

In InnoDB, trx_has_lock_x() returns wrong value if other transaction has pending
lock on the table. n_lock_x_or_s can indicate the number of granter or pending
lock on the tables. This variable should be checked only to find out whether the lock
exists or not.



 Comments   
Comment by Thirunarayanan Balathandayuthapani [ 2022-01-10 ]

Patch is in bb-10.6-MDEV-27640 for review

Comment by Thirunarayanan Balathandayuthapani [ 2022-01-10 ]

This problem affects bulk insert operation when set foreign_key_checks=0, unique_checks=0.

Comment by Thirunarayanan Balathandayuthapani [ 2022-01-10 ]

[~/mariarepo/10.6]$git log -1
commit 428b057ee06dca05a3d20f5b4cc32ceedbc37836 (HEAD -> 10.6, origin/bb-10.6-MDEV-27640, origin/10.6, 10.6-sample)
Author: Thirunarayanan Balathandayuthapani <thiru@mariadb.com>
Date:   Mon Jan 10 19:15:39 2022 +0530
 
    MDEV-27640 trx_has_lock_x() gives wrong result if the table has pending table lock
    
    trx_has_lock_x() fails to find whether the trx has X-lock on the table
    when other transactions are waiting for an X or S lock on the table.

Sorry for messing with the MDEV#

Generated at Thu Feb 08 09:53:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.