1
/*****************************************************************************
3
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
5
This program is free software; you can redistribute it and/or modify it under
6
the terms of the GNU General Public License as published by the Free Software
7
Foundation; version 2 of the License.
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License along with
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15
Place, Suite 330, Boston, MA 02111-1307 USA
17
*****************************************************************************/
19
/**************************************************//**
20
@file include/lock0lock.h
21
The transaction lock system
23
Created 5/7/1996 Heikki Tuuri
24
*******************************************************/
30
#include "buf0types.h"
31
#include "trx0types.h"
32
#include "mtr0types.h"
33
#include "rem0types.h"
34
#include "dict0types.h"
35
#include "que0types.h"
36
#include "lock0types.h"
37
#include "read0types.h"
38
#include "hash0hash.h"
42
extern ibool lock_print_waits;
43
#endif /* UNIV_DEBUG */
44
/* Buffer for storing information about the most recent deadlock error */
45
extern FILE* lock_latest_err_file;
47
/*********************************************************************//**
48
Gets the size of a lock struct.
49
@return size in bytes */
54
/*********************************************************************//**
55
Creates the lock system at database start. */
60
ulint n_cells); /*!< in: number of slots in lock hash table */
61
/*********************************************************************//**
62
Checks if some transaction has an implicit x-lock on a record in a clustered
64
@return transaction which has the x-lock, or NULL */
67
lock_clust_rec_some_has_impl(
68
/*=========================*/
69
const rec_t* rec, /*!< in: user record */
70
dict_index_t* index, /*!< in: clustered index */
71
const ulint* offsets);/*!< in: rec_get_offsets(rec, index) */
72
/*********************************************************************//**
73
Gets the heap_no of the smallest user record on a page.
74
@return heap_no of smallest user record, or PAGE_HEAP_NO_SUPREMUM */
79
const buf_block_t* block); /*!< in: buffer block */
80
/*************************************************************//**
81
Updates the lock table when we have reorganized a page. NOTE: we copy
82
also the locks set on the infimum of the page; the infimum may carry
83
locks if an update of a record is occurring on the page, and its locks
84
were temporarily stored on the infimum. */
87
lock_move_reorganize_page(
88
/*======================*/
89
const buf_block_t* block, /*!< in: old index page, now
91
const buf_block_t* oblock);/*!< in: copy of the old, not
93
/*************************************************************//**
94
Moves the explicit locks on user records to another page if a record
95
list end is moved to another page. */
98
lock_move_rec_list_end(
99
/*===================*/
100
const buf_block_t* new_block, /*!< in: index page to move to */
101
const buf_block_t* block, /*!< in: index page */
102
const rec_t* rec); /*!< in: record on page: this
103
is the first record moved */
104
/*************************************************************//**
105
Moves the explicit locks on user records to another page if a record
106
list start is moved to another page. */
109
lock_move_rec_list_start(
110
/*=====================*/
111
const buf_block_t* new_block, /*!< in: index page to move to */
112
const buf_block_t* block, /*!< in: index page */
113
const rec_t* rec, /*!< in: record on page:
116
const rec_t* old_end); /*!< in: old
121
/*************************************************************//**
122
Updates the lock table when a page is split to the right. */
125
lock_update_split_right(
126
/*====================*/
127
const buf_block_t* right_block, /*!< in: right page */
128
const buf_block_t* left_block); /*!< in: left page */
129
/*************************************************************//**
130
Updates the lock table when a page is merged to the right. */
133
lock_update_merge_right(
134
/*====================*/
135
const buf_block_t* right_block, /*!< in: right page to
137
const rec_t* orig_succ, /*!< in: original
141
const buf_block_t* left_block); /*!< in: merged index
144
/*************************************************************//**
145
Updates the lock table when the root page is copied to another in
146
btr_root_raise_and_insert. Note that we leave lock structs on the
147
root page, even though they do not make sense on other than leaf
148
pages: the reason is that in a pessimistic update the infimum record
149
of the root page will act as a dummy carrier of the locks of the record
153
lock_update_root_raise(
154
/*===================*/
155
const buf_block_t* block, /*!< in: index page to which copied */
156
const buf_block_t* root); /*!< in: root page */
157
/*************************************************************//**
158
Updates the lock table when a page is copied to another and the original page
159
is removed from the chain of leaf pages, except if page is the root! */
162
lock_update_copy_and_discard(
163
/*=========================*/
164
const buf_block_t* new_block, /*!< in: index page to
166
const buf_block_t* block); /*!< in: index page;
168
/*************************************************************//**
169
Updates the lock table when a page is split to the left. */
172
lock_update_split_left(
173
/*===================*/
174
const buf_block_t* right_block, /*!< in: right page */
175
const buf_block_t* left_block); /*!< in: left page */
176
/*************************************************************//**
177
Updates the lock table when a page is merged to the left. */
180
lock_update_merge_left(
181
/*===================*/
182
const buf_block_t* left_block, /*!< in: left page to
184
const rec_t* orig_pred, /*!< in: original predecessor
185
of supremum on the left page
187
const buf_block_t* right_block); /*!< in: merged index page
188
which will be discarded */
189
/*************************************************************//**
190
Resets the original locks on heir and replaces them with gap type locks
191
inherited from rec. */
194
lock_rec_reset_and_inherit_gap_locks(
195
/*=================================*/
196
const buf_block_t* heir_block, /*!< in: block containing the
197
record which inherits */
198
const buf_block_t* block, /*!< in: block containing the
199
record from which inherited;
200
does NOT reset the locks on
202
ulint heir_heap_no, /*!< in: heap_no of the
204
ulint heap_no); /*!< in: heap_no of the
206
/*************************************************************//**
207
Updates the lock table when a page is discarded. */
212
const buf_block_t* heir_block, /*!< in: index page
213
which will inherit the locks */
214
ulint heir_heap_no, /*!< in: heap_no of the record
215
which will inherit the locks */
216
const buf_block_t* block); /*!< in: index page
217
which will be discarded */
218
/*************************************************************//**
219
Updates the lock table when a new user record is inserted. */
224
const buf_block_t* block, /*!< in: buffer block containing rec */
225
const rec_t* rec); /*!< in: the inserted record */
226
/*************************************************************//**
227
Updates the lock table when a record is removed. */
232
const buf_block_t* block, /*!< in: buffer block containing rec */
233
const rec_t* rec); /*!< in: the record to be removed */
234
/*********************************************************************//**
235
Stores on the page infimum record the explicit locks of another record.
236
This function is used to store the lock state of a record when it is
237
updated and the size of the record changes in the update. The record
238
is in such an update moved, perhaps to another page. The infimum record
239
acts as a dummy carrier record, taking care of lock releases while the
240
actual record is being moved. */
243
lock_rec_store_on_page_infimum(
244
/*===========================*/
245
const buf_block_t* block, /*!< in: buffer block containing rec */
246
const rec_t* rec); /*!< in: record whose lock state
247
is stored on the infimum
248
record of the same page; lock
249
bits are reset on the
251
/*********************************************************************//**
252
Restores the state of explicit lock requests on a single record, where the
253
state was stored on the infimum of the page. */
256
lock_rec_restore_from_page_infimum(
257
/*===============================*/
258
const buf_block_t* block, /*!< in: buffer block containing rec */
259
const rec_t* rec, /*!< in: record whose lock state
261
const buf_block_t* donator);/*!< in: page (rec is not
262
necessarily on this page)
263
whose infimum stored the lock
264
state; lock bits are reset on
266
/*********************************************************************//**
267
Returns TRUE if there are explicit record locks on a page.
268
@return TRUE if there are explicit record locks on the page */
271
lock_rec_expl_exist_on_page(
272
/*========================*/
273
ulint space, /*!< in: space id */
274
ulint page_no);/*!< in: page number */
275
/*********************************************************************//**
276
Checks if locks of other transactions prevent an immediate insert of
277
a record. If they do, first tests if the query thread should anyway
278
be suspended for some reason; if not, then puts the transaction and
279
the query thread to the lock wait state and inserts a waiting request
280
for a gap x-lock to the lock queue.
281
@return DB_SUCCESS, DB_LOCK_WAIT, DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
284
lock_rec_insert_check_and_lock(
285
/*===========================*/
286
ulint flags, /*!< in: if BTR_NO_LOCKING_FLAG bit is
288
const rec_t* rec, /*!< in: record after which to insert */
289
buf_block_t* block, /*!< in/out: buffer block of rec */
290
dict_index_t* index, /*!< in: index */
291
que_thr_t* thr, /*!< in: query thread */
292
mtr_t* mtr, /*!< in/out: mini-transaction */
293
ibool* inherit);/*!< out: set to TRUE if the new
294
inserted record maybe should inherit
295
LOCK_GAP type locks from the successor
297
/*********************************************************************//**
298
Checks if locks of other transactions prevent an immediate modify (update,
299
delete mark, or delete unmark) of a clustered index record. If they do,
300
first tests if the query thread should anyway be suspended for some
301
reason; if not, then puts the transaction and the query thread to the
302
lock wait state and inserts a waiting request for a record x-lock to the
304
@return DB_SUCCESS, DB_LOCK_WAIT, DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
307
lock_clust_rec_modify_check_and_lock(
308
/*=================================*/
309
ulint flags, /*!< in: if BTR_NO_LOCKING_FLAG
310
bit is set, does nothing */
311
const buf_block_t* block, /*!< in: buffer block of rec */
312
const rec_t* rec, /*!< in: record which should be
314
dict_index_t* index, /*!< in: clustered index */
315
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
316
que_thr_t* thr); /*!< in: query thread */
317
/*********************************************************************//**
318
Checks if locks of other transactions prevent an immediate modify
319
(delete mark or delete unmark) of a secondary index record.
320
@return DB_SUCCESS, DB_LOCK_WAIT, DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
323
lock_sec_rec_modify_check_and_lock(
324
/*===============================*/
325
ulint flags, /*!< in: if BTR_NO_LOCKING_FLAG
326
bit is set, does nothing */
327
buf_block_t* block, /*!< in/out: buffer block of rec */
328
const rec_t* rec, /*!< in: record which should be
329
modified; NOTE: as this is a secondary
330
index, we always have to modify the
331
clustered index record first: see the
333
dict_index_t* index, /*!< in: secondary index */
334
que_thr_t* thr, /*!< in: query thread */
335
mtr_t* mtr); /*!< in/out: mini-transaction */
336
/*********************************************************************//**
337
Like the counterpart for a clustered index below, but now we read a
338
secondary index record.
339
@return DB_SUCCESS, DB_LOCK_WAIT, DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
342
lock_sec_rec_read_check_and_lock(
343
/*=============================*/
344
ulint flags, /*!< in: if BTR_NO_LOCKING_FLAG
345
bit is set, does nothing */
346
const buf_block_t* block, /*!< in: buffer block of rec */
347
const rec_t* rec, /*!< in: user record or page
348
supremum record which should
349
be read or passed over by a
351
dict_index_t* index, /*!< in: secondary index */
352
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
353
enum lock_mode mode, /*!< in: mode of the lock which
354
the read cursor should set on
355
records: LOCK_S or LOCK_X; the
356
latter is possible in
358
ulint gap_mode,/*!< in: LOCK_ORDINARY, LOCK_GAP, or
360
que_thr_t* thr); /*!< in: query thread */
361
/*********************************************************************//**
362
Checks if locks of other transactions prevent an immediate read, or passing
363
over by a read cursor, of a clustered index record. If they do, first tests
364
if the query thread should anyway be suspended for some reason; if not, then
365
puts the transaction and the query thread to the lock wait state and inserts a
366
waiting request for a record lock to the lock queue. Sets the requested mode
368
@return DB_SUCCESS, DB_LOCK_WAIT, DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
371
lock_clust_rec_read_check_and_lock(
372
/*===============================*/
373
ulint flags, /*!< in: if BTR_NO_LOCKING_FLAG
374
bit is set, does nothing */
375
const buf_block_t* block, /*!< in: buffer block of rec */
376
const rec_t* rec, /*!< in: user record or page
377
supremum record which should
378
be read or passed over by a
380
dict_index_t* index, /*!< in: clustered index */
381
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
382
enum lock_mode mode, /*!< in: mode of the lock which
383
the read cursor should set on
384
records: LOCK_S or LOCK_X; the
385
latter is possible in
387
ulint gap_mode,/*!< in: LOCK_ORDINARY, LOCK_GAP, or
389
que_thr_t* thr); /*!< in: query thread */
390
/*********************************************************************//**
391
Checks if locks of other transactions prevent an immediate read, or passing
392
over by a read cursor, of a clustered index record. If they do, first tests
393
if the query thread should anyway be suspended for some reason; if not, then
394
puts the transaction and the query thread to the lock wait state and inserts a
395
waiting request for a record lock to the lock queue. Sets the requested mode
396
lock on the record. This is an alternative version of
397
lock_clust_rec_read_check_and_lock() that does not require the parameter
399
@return DB_SUCCESS, DB_LOCK_WAIT, DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
402
lock_clust_rec_read_check_and_lock_alt(
403
/*===================================*/
404
ulint flags, /*!< in: if BTR_NO_LOCKING_FLAG
405
bit is set, does nothing */
406
const buf_block_t* block, /*!< in: buffer block of rec */
407
const rec_t* rec, /*!< in: user record or page
408
supremum record which should
409
be read or passed over by a
411
dict_index_t* index, /*!< in: clustered index */
412
enum lock_mode mode, /*!< in: mode of the lock which
413
the read cursor should set on
414
records: LOCK_S or LOCK_X; the
415
latter is possible in
417
ulint gap_mode,/*!< in: LOCK_ORDINARY, LOCK_GAP, or
419
que_thr_t* thr); /*!< in: query thread */
420
/*********************************************************************//**
421
Checks that a record is seen in a consistent read.
422
@return TRUE if sees, or FALSE if an earlier version of the record
423
should be retrieved */
426
lock_clust_rec_cons_read_sees(
427
/*==========================*/
428
const rec_t* rec, /*!< in: user record which should be read or
429
passed over by a read cursor */
430
dict_index_t* index, /*!< in: clustered index */
431
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
432
read_view_t* view); /*!< in: consistent read view */
433
/*********************************************************************//**
434
Checks that a non-clustered index record is seen in a consistent read.
436
NOTE that a non-clustered index page contains so little information on
437
its modifications that also in the case FALSE, the present version of
438
rec may be the right, but we must check this from the clustered index
441
@return TRUE if certainly sees, or FALSE if an earlier version of the
442
clustered index record might be needed */
445
lock_sec_rec_cons_read_sees(
446
/*========================*/
447
const rec_t* rec, /*!< in: user record which
448
should be read or passed over
450
const read_view_t* view); /*!< in: consistent read view */
451
/*********************************************************************//**
452
Locks the specified database table in the mode given. If the lock cannot
453
be granted immediately, the query thread is put to wait.
454
@return DB_SUCCESS, DB_LOCK_WAIT, DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
459
ulint flags, /*!< in: if BTR_NO_LOCKING_FLAG bit is set,
461
dict_table_t* table, /*!< in: database table in dictionary cache */
462
enum lock_mode mode, /*!< in: lock mode */
463
que_thr_t* thr); /*!< in: query thread */
464
/*************************************************************//**
465
Removes a granted record lock of a transaction from the queue and grants
466
locks to other transactions waiting in the queue if they now are entitled
472
trx_t* trx, /*!< in: transaction that has
474
const buf_block_t* block, /*!< in: buffer block containing rec */
475
const rec_t* rec, /*!< in: record */
476
enum lock_mode lock_mode);/*!< in: LOCK_S or LOCK_X */
477
/*********************************************************************//**
478
Releases transaction locks, and releases possible other transactions waiting
479
because of these locks. */
482
lock_release_off_kernel(
483
/*====================*/
484
trx_t* trx); /*!< in: transaction */
485
/*********************************************************************//**
486
Cancels a waiting lock request and releases possible other transactions
487
waiting behind it. */
490
lock_cancel_waiting_and_release(
491
/*============================*/
492
lock_t* lock); /*!< in: waiting lock request */
494
/*********************************************************************//**
495
Removes locks on a table to be dropped or truncated.
496
If remove_also_table_sx_locks is TRUE then table-level S and X locks are
497
also removed in addition to other table-level and record-level locks.
498
No lock, that is going to be removed, is allowed to be a wait lock. */
501
lock_remove_all_on_table(
502
/*=====================*/
503
dict_table_t* table, /*!< in: table to be dropped
505
ibool remove_also_table_sx_locks);/*!< in: also removes
506
table S and X locks */
508
/*********************************************************************//**
509
Calculates the fold value of a page file address: used in inserting or
510
searching for a lock in the hash table.
511
@return folded value */
516
ulint space, /*!< in: space */
517
ulint page_no)/*!< in: page number */
518
__attribute__((const));
519
/*********************************************************************//**
520
Calculates the hash value of a page file address: used in inserting or
521
searching for a lock in the hash table.
522
@return hashed value */
527
ulint space, /*!< in: space */
528
ulint page_no);/*!< in: page number */
530
/**********************************************************************//**
531
Looks for a set bit in a record lock bitmap. Returns ULINT_UNDEFINED,
533
@return bit index == heap number of the record, or ULINT_UNDEFINED if
537
lock_rec_find_set_bit(
538
/*==================*/
539
const lock_t* lock); /*!< in: record lock with at least one
542
/*********************************************************************//**
543
Gets the source table of an ALTER TABLE transaction. The table must be
544
covered by an IX or IS table lock.
545
@return the source table of transaction, if it is covered by an IX or
546
IS table lock; dest if there is no source table, and NULL if the
547
transaction is locking more than two tables or an inconsistency is
553
trx_t* trx, /*!< in: transaction */
554
dict_table_t* dest, /*!< in: destination of ALTER TABLE */
555
enum lock_mode* mode); /*!< out: lock mode of the source table */
556
/*********************************************************************//**
557
Determine if the given table is exclusively "owned" by the given
558
transaction, i.e., transaction holds LOCK_IX and possibly LOCK_AUTO_INC
560
@return TRUE if table is only locked by trx, with LOCK_IX, and
561
possibly LOCK_AUTO_INC */
564
lock_is_table_exclusive(
565
/*====================*/
566
dict_table_t* table, /*!< in: table */
567
trx_t* trx); /*!< in: transaction */
568
/*********************************************************************//**
569
Checks if a lock request lock1 has to wait for request lock2.
570
@return TRUE if lock1 has to wait for lock2 to be removed */
575
const lock_t* lock1, /*!< in: waiting lock */
576
const lock_t* lock2); /*!< in: another lock; NOTE that it is
577
assumed that this has a lock bit set
578
on the same record as in lock1 if the
579
locks are record locks */
580
/*********************************************************************//**
581
Checks that a transaction id is sensible, i.e., not in the future.
582
@return TRUE if ok */
585
lock_check_trx_id_sanity(
586
/*=====================*/
587
trx_id_t trx_id, /*!< in: trx id */
588
const rec_t* rec, /*!< in: user record */
589
dict_index_t* index, /*!< in: clustered index */
590
const ulint* offsets, /*!< in: rec_get_offsets(rec, index) */
591
ibool has_kernel_mutex);/*!< in: TRUE if the caller owns the
593
/*********************************************************************//**
594
Prints info of a table lock. */
599
FILE* file, /*!< in: file where to print */
600
const lock_t* lock); /*!< in: table type lock */
601
/*********************************************************************//**
602
Prints info of a record lock. */
607
FILE* file, /*!< in: file where to print */
608
const lock_t* lock); /*!< in: record type lock */
609
/*********************************************************************//**
610
Prints info of locks for all transactions. */
613
lock_print_info_summary(
614
/*====================*/
615
FILE* file); /*!< in: file where to print */
616
/*********************************************************************//**
617
Prints info of locks for each transaction. */
620
lock_print_info_all_transactions(
621
/*=============================*/
622
FILE* file); /*!< in: file where to print */
623
/*********************************************************************//**
624
Return approximate number or record locks (bits set in the bitmap) for
625
this transaction. Since delete-marked records may be removed, the
626
record count will not be precise. */
629
lock_number_of_rows_locked(
630
/*=======================*/
631
trx_t* trx); /*!< in: transaction */
632
/*******************************************************************//**
633
Release all the transaction's autoinc locks. */
636
lock_release_autoinc_locks(
637
/*=======================*/
638
trx_t* trx); /*!< in/out: transaction */
640
/*******************************************************************//**
641
Gets the type of a lock. Non-inline version for using outside of the
643
@return LOCK_TABLE or LOCK_REC */
648
const lock_t* lock); /*!< in: lock */
650
/*******************************************************************//**
651
Gets the id of the transaction owning a lock.
652
@return transaction id */
657
const lock_t* lock); /*!< in: lock */
659
/*******************************************************************//**
660
Gets the mode of a lock in a human readable string.
661
The string should not be free()'d or modified.
667
const lock_t* lock); /*!< in: lock */
669
/*******************************************************************//**
670
Gets the type of a lock in a human readable string.
671
The string should not be free()'d or modified.
677
const lock_t* lock); /*!< in: lock */
679
/*******************************************************************//**
680
Gets the id of the table on which the lock is.
681
@return id of the table */
686
const lock_t* lock); /*!< in: lock */
688
/*******************************************************************//**
689
Gets the name of the table on which the lock is.
690
The string should not be free()'d or modified.
691
@return name of the table */
696
const lock_t* lock); /*!< in: lock */
698
/*******************************************************************//**
699
For a record lock, gets the index on which the lock is.
705
const lock_t* lock); /*!< in: lock */
707
/*******************************************************************//**
708
For a record lock, gets the name of the index on which the lock is.
709
The string should not be free()'d or modified.
710
@return name of the index */
713
lock_rec_get_index_name(
714
/*====================*/
715
const lock_t* lock); /*!< in: lock */
717
/*******************************************************************//**
718
For a record lock, gets the tablespace number on which the lock is.
719
@return tablespace number */
722
lock_rec_get_space_id(
723
/*==================*/
724
const lock_t* lock); /*!< in: lock */
726
/*******************************************************************//**
727
For a record lock, gets the page number on which the lock is.
728
@return page number */
731
lock_rec_get_page_no(
732
/*=================*/
733
const lock_t* lock); /*!< in: lock */
735
/** Lock modes and types */
737
#define LOCK_MODE_MASK 0xFUL /*!< mask used to extract mode from the
738
type_mode field in a lock */
741
#define LOCK_TABLE 16 /*!< table lock */
742
#define LOCK_REC 32 /*!< record lock */
743
#define LOCK_TYPE_MASK 0xF0UL /*!< mask used to extract lock type from the
744
type_mode field in a lock */
745
#if LOCK_MODE_MASK & LOCK_TYPE_MASK
746
# error "LOCK_MODE_MASK & LOCK_TYPE_MASK"
749
#define LOCK_WAIT 256 /*!< Waiting lock flag; when set, it
750
means that the lock has not yet been
751
granted, it is just waiting for its
752
turn in the wait queue */
754
#define LOCK_ORDINARY 0 /*!< this flag denotes an ordinary
755
next-key lock in contrast to LOCK_GAP
756
or LOCK_REC_NOT_GAP */
757
#define LOCK_GAP 512 /*!< when this bit is set, it means that the
758
lock holds only on the gap before the record;
759
for instance, an x-lock on the gap does not
760
give permission to modify the record on which
761
the bit is set; locks of this type are created
762
when records are removed from the index chain
764
#define LOCK_REC_NOT_GAP 1024 /*!< this bit means that the lock is only on
765
the index record and does NOT block inserts
766
to the gap before the index record; this is
767
used in the case when we retrieve a record
768
with a unique key, and is also used in
769
locking plain SELECTs (not part of UPDATE
770
or DELETE) when the user has set the READ
771
COMMITTED isolation level */
772
#define LOCK_INSERT_INTENTION 2048 /*!< this bit is set when we place a waiting
773
gap type record lock request in order to let
774
an insert of an index record to wait until
775
there are no conflicting locks by other
776
transactions on the gap; note that this flag
777
remains set when the waiting lock is granted,
778
or if the lock is inherited to a neighboring
780
#if (LOCK_WAIT|LOCK_GAP|LOCK_REC_NOT_GAP|LOCK_INSERT_INTENTION)&LOCK_MODE_MASK
783
#if (LOCK_WAIT|LOCK_GAP|LOCK_REC_NOT_GAP|LOCK_INSERT_INTENTION)&LOCK_TYPE_MASK
788
/** Lock operation struct */
789
typedef struct lock_op_struct lock_op_t;
790
/** Lock operation struct */
791
struct lock_op_struct{
792
dict_table_t* table; /*!< table to be locked */
793
enum lock_mode mode; /*!< lock mode */
796
/** The lock system struct */
797
struct lock_sys_struct{
798
hash_table_t* rec_hash; /*!< hash table of the record locks */
801
/** The lock system */
802
extern lock_sys_t* lock_sys;
806
#include "lock0lock.ic"