60
48
/*=========================*/
61
49
/* out: transaction which has the x-lock, or
63
rec_t* rec, /* in: user record */
51
const rec_t* rec, /* in: user record */
64
52
dict_index_t* index, /* in: clustered index */
65
53
const ulint* offsets);/* in: rec_get_offsets(rec, index) */
66
/*****************************************************************
67
Makes a record to inherit the locks of another record as gap type
68
locks, but does not reset the lock bits of the other record. Also
69
waiting lock requests on rec are inherited as GRANTED gap locks. */
72
lock_rec_inherit_to_gap(
73
/*====================*/
74
rec_t* heir, /* in: record which inherits */
75
rec_t* rec); /* in: record from which inherited; does NOT reset
76
the locks on this record */
54
/*************************************************************************
55
Gets the heap_no of the smallest user record on a page. */
60
/* out: heap_no of smallest
62
PAGE_HEAP_NO_SUPREMUM */
63
const buf_block_t* block); /* in: buffer block */
77
64
/*****************************************************************
78
65
Updates the lock table when we have reorganized a page. NOTE: we copy
79
66
also the locks set on the infimum of the page; the infimum may carry
80
67
locks if an update of a record is occurring on the page, and its locks
81
68
were temporarily stored on the infimum. */
84
71
lock_move_reorganize_page(
85
72
/*======================*/
86
page_t* page, /* in: old index page */
87
page_t* new_page); /* in: reorganized page */
73
const buf_block_t* block, /* in: old index page, now
75
const buf_block_t* oblock);/* in: copy of the old, not
88
77
/*****************************************************************
89
78
Moves the explicit locks on user records to another page if a record
90
79
list end is moved to another page. */
93
82
lock_move_rec_list_end(
94
83
/*===================*/
95
page_t* new_page, /* in: index page to move to */
96
page_t* page, /* in: index page */
97
rec_t* rec); /* in: record on page: this is the
84
const buf_block_t* new_block, /* in: index page to move to */
85
const buf_block_t* block, /* in: index page */
86
const rec_t* rec); /* in: record on page: this
87
is the first record moved */
99
88
/*****************************************************************
100
89
Moves the explicit locks on user records to another page if a record
101
90
list start is moved to another page. */
104
93
lock_move_rec_list_start(
105
94
/*=====================*/
106
page_t* new_page, /* in: index page to move to */
107
page_t* page, /* in: index page */
108
rec_t* rec, /* in: record on page: this is the
109
first record NOT copied */
110
rec_t* old_end); /* in: old previous-to-last record on
111
new_page before the records were copied */
95
const buf_block_t* new_block, /* in: index page to move to */
96
const buf_block_t* block, /* in: index page */
97
const rec_t* rec, /* in: record on page:
100
const rec_t* old_end); /* in: old
112
105
/*****************************************************************
113
106
Updates the lock table when a page is split to the right. */
116
109
lock_update_split_right(
117
110
/*====================*/
118
page_t* right_page, /* in: right page */
119
page_t* left_page); /* in: left page */
111
const buf_block_t* right_block, /* in: right page */
112
const buf_block_t* left_block); /* in: left page */
120
113
/*****************************************************************
121
114
Updates the lock table when a page is merged to the right. */
124
117
lock_update_merge_right(
125
118
/*====================*/
126
rec_t* orig_succ, /* in: original successor of infimum
127
on the right page before merge */
128
page_t* left_page); /* in: merged index page which will be
119
const buf_block_t* right_block, /* in: right page to
121
const rec_t* orig_succ, /* in: original
125
const buf_block_t* left_block); /* in: merged index
130
128
/*****************************************************************
131
129
Updates the lock table when the root page is copied to another in
132
130
btr_root_raise_and_insert. Note that we leave lock structs on the
134
132
pages: the reason is that in a pessimistic update the infimum record
135
133
of the root page will act as a dummy carrier of the locks of the record
136
134
to be updated. */
139
137
lock_update_root_raise(
140
138
/*===================*/
141
page_t* new_page, /* in: index page to which copied */
142
page_t* root); /* in: root page */
139
const buf_block_t* block, /* in: index page to which copied */
140
const buf_block_t* root); /* in: root page */
143
141
/*****************************************************************
144
142
Updates the lock table when a page is copied to another and the original page
145
143
is removed from the chain of leaf pages, except if page is the root! */
148
146
lock_update_copy_and_discard(
149
147
/*=========================*/
150
page_t* new_page, /* in: index page to which copied */
151
page_t* page); /* in: index page; NOT the root! */
148
const buf_block_t* new_block, /* in: index page to
150
const buf_block_t* block); /* in: index page;
152
152
/*****************************************************************
153
153
Updates the lock table when a page is split to the left. */
156
156
lock_update_split_left(
157
157
/*===================*/
158
page_t* right_page, /* in: right page */
159
page_t* left_page); /* in: left page */
158
const buf_block_t* right_block, /* in: right page */
159
const buf_block_t* left_block); /* in: left page */
160
160
/*****************************************************************
161
161
Updates the lock table when a page is merged to the left. */
164
164
lock_update_merge_left(
165
165
/*===================*/
166
page_t* left_page, /* in: left page to which merged */
167
rec_t* orig_pred, /* in: original predecessor of supremum
168
on the left page before merge */
169
page_t* right_page); /* in: merged index page which will be
166
const buf_block_t* left_block, /* in: left page to
168
const rec_t* orig_pred, /* in: original predecessor
169
of supremum on the left page
171
const buf_block_t* right_block); /* in: merged index page
172
which will be discarded */
171
173
/*****************************************************************
172
174
Resets the original locks on heir and replaces them with gap type locks
173
175
inherited from rec. */
176
178
lock_rec_reset_and_inherit_gap_locks(
177
179
/*=================================*/
178
rec_t* heir, /* in: heir record */
179
rec_t* rec); /* in: record */
180
const buf_block_t* heir_block, /* in: block containing the
181
record which inherits */
182
const buf_block_t* block, /* in: block containing the
183
record from which inherited;
184
does NOT reset the locks on
186
ulint heir_heap_no, /* in: heap_no of the
188
ulint heap_no); /* in: heap_no of the
180
190
/*****************************************************************
181
191
Updates the lock table when a page is discarded. */
184
194
lock_update_discard(
185
195
/*================*/
186
rec_t* heir, /* in: record which will inherit the locks */
187
page_t* page); /* in: index page which will be discarded */
196
const buf_block_t* heir_block, /* in: index page
197
which will inherit the locks */
198
ulint heir_heap_no, /* in: heap_no of the record
199
which will inherit the locks */
200
const buf_block_t* block); /* in: index page
201
which will be discarded */
188
202
/*****************************************************************
189
203
Updates the lock table when a new user record is inserted. */
192
206
lock_update_insert(
193
207
/*===============*/
194
rec_t* rec); /* in: the inserted record */
208
const buf_block_t* block, /* in: buffer block containing rec */
209
const rec_t* rec); /* in: the inserted record */
195
210
/*****************************************************************
196
211
Updates the lock table when a record is removed. */
199
214
lock_update_delete(
200
215
/*===============*/
201
rec_t* rec); /* in: the record to be removed */
216
const buf_block_t* block, /* in: buffer block containing rec */
217
const rec_t* rec); /* in: the record to be removed */
202
218
/*************************************************************************
203
219
Stores on the page infimum record the explicit locks of another record.
204
220
This function is used to store the lock state of a record when it is
206
222
is in such an update moved, perhaps to another page. The infimum record
207
223
acts as a dummy carrier record, taking care of lock releases while the
208
224
actual record is being moved. */
211
227
lock_rec_store_on_page_infimum(
212
228
/*===========================*/
213
page_t* page, /* in: page containing the record */
214
rec_t* rec); /* in: record whose lock state is stored
215
on the infimum record of the same page; lock
216
bits are reset on the record */
229
const buf_block_t* block, /* in: buffer block containing rec */
230
const rec_t* rec); /* in: record whose lock state
231
is stored on the infimum
232
record of the same page; lock
233
bits are reset on the
217
235
/*************************************************************************
218
236
Restores the state of explicit lock requests on a single record, where the
219
237
state was stored on the infimum of the page. */
222
240
lock_rec_restore_from_page_infimum(
223
241
/*===============================*/
224
rec_t* rec, /* in: record whose lock state is restored */
225
page_t* page); /* in: page (rec is not necessarily on this page)
226
whose infimum stored the lock state; lock bits are
227
reset on the infimum */
242
const buf_block_t* block, /* in: buffer block containing rec */
243
const rec_t* rec, /* in: record whose lock state
245
const buf_block_t* donator);/* in: page (rec is not
246
necessarily on this page)
247
whose infimum stored the lock
248
state; lock bits are reset on
228
250
/*************************************************************************
229
251
Returns TRUE if there are explicit record locks on a page. */
232
254
lock_rec_expl_exist_on_page(
233
255
/*========================*/
241
263
be suspended for some reason; if not, then puts the transaction and
242
264
the query thread to the lock wait state and inserts a waiting request
243
265
for a gap x-lock to the lock queue. */
246
268
lock_rec_insert_check_and_lock(
247
269
/*===========================*/
248
270
/* out: DB_SUCCESS, DB_LOCK_WAIT,
249
271
DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
250
ulint flags, /* in: if BTR_NO_LOCKING_FLAG bit is set,
272
ulint flags, /* in: if BTR_NO_LOCKING_FLAG bit is
252
274
rec_t* rec, /* in: record after which to insert */
275
buf_block_t* block, /* in/out: buffer block of rec */
253
276
dict_index_t* index, /* in: index */
254
277
que_thr_t* thr, /* in: query thread */
255
ibool* inherit);/* out: set to TRUE if the new inserted
256
record maybe should inherit LOCK_GAP type
257
locks from the successor record */
278
ibool* inherit);/* out: set to TRUE if the new
279
inserted record maybe should inherit
280
LOCK_GAP type locks from the successor
258
282
/*************************************************************************
259
283
Checks if locks of other transactions prevent an immediate modify (update,
260
284
delete mark, or delete unmark) of a clustered index record. If they do,
262
286
reason; if not, then puts the transaction and the query thread to the
263
287
lock wait state and inserts a waiting request for a record x-lock to the
267
291
lock_clust_rec_modify_check_and_lock(
268
292
/*=================================*/
269
/* out: DB_SUCCESS, DB_LOCK_WAIT,
270
DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
271
ulint flags, /* in: if BTR_NO_LOCKING_FLAG bit is set,
273
rec_t* rec, /* in: record which should be modified */
274
dict_index_t* index, /* in: clustered index */
275
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
276
que_thr_t* thr); /* in: query thread */
294
DB_LOCK_WAIT, DB_DEADLOCK, or
295
DB_QUE_THR_SUSPENDED */
296
ulint flags, /* in: if BTR_NO_LOCKING_FLAG
297
bit is set, does nothing */
298
const buf_block_t* block, /* in: buffer block of rec */
299
const rec_t* rec, /* in: record which should be
301
dict_index_t* index, /* in: clustered index */
302
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
303
que_thr_t* thr); /* in: query thread */
277
304
/*************************************************************************
278
305
Checks if locks of other transactions prevent an immediate modify
279
306
(delete mark or delete unmark) of a secondary index record. */
282
309
lock_sec_rec_modify_check_and_lock(
283
310
/*===============================*/
284
311
/* out: DB_SUCCESS, DB_LOCK_WAIT,
285
312
DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
286
ulint flags, /* in: if BTR_NO_LOCKING_FLAG bit is set,
288
rec_t* rec, /* in: record which should be modified;
289
NOTE: as this is a secondary index, we
290
always have to modify the clustered index
291
record first: see the comment below */
313
ulint flags, /* in: if BTR_NO_LOCKING_FLAG
314
bit is set, does nothing */
315
buf_block_t* block, /* in/out: buffer block of rec */
316
rec_t* rec, /* in: record which should be
317
modified; NOTE: as this is a secondary
318
index, we always have to modify the
319
clustered index record first: see the
292
321
dict_index_t* index, /* in: secondary index */
293
322
que_thr_t* thr); /* in: query thread */
294
323
/*************************************************************************
295
324
Like the counterpart for a clustered index below, but now we read a
296
325
secondary index record. */
299
328
lock_sec_rec_read_check_and_lock(
300
329
/*=============================*/
301
/* out: DB_SUCCESS, DB_LOCK_WAIT,
302
DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
303
ulint flags, /* in: if BTR_NO_LOCKING_FLAG bit is set,
305
rec_t* rec, /* in: user record or page supremum record
306
which should be read or passed over by a read
308
dict_index_t* index, /* in: secondary index */
309
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
310
ulint mode, /* in: mode of the lock which the read cursor
311
should set on records: LOCK_S or LOCK_X; the
312
latter is possible in SELECT FOR UPDATE */
313
ulint gap_mode,/* in: LOCK_ORDINARY, LOCK_GAP, or
315
que_thr_t* thr); /* in: query thread */
331
DB_LOCK_WAIT, DB_DEADLOCK, or
332
DB_QUE_THR_SUSPENDED */
333
ulint flags, /* in: if BTR_NO_LOCKING_FLAG
334
bit is set, does nothing */
335
const buf_block_t* block, /* in: buffer block of rec */
336
const rec_t* rec, /* in: user record or page
337
supremum record which should
338
be read or passed over by a
340
dict_index_t* index, /* in: secondary index */
341
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
342
enum lock_mode mode, /* in: mode of the lock which
343
the read cursor should set on
344
records: LOCK_S or LOCK_X; the
345
latter is possible in
347
ulint gap_mode,/* in: LOCK_ORDINARY, LOCK_GAP, or
349
que_thr_t* thr); /* in: query thread */
316
350
/*************************************************************************
317
351
Checks if locks of other transactions prevent an immediate read, or passing
318
352
over by a read cursor, of a clustered index record. If they do, first tests
320
354
puts the transaction and the query thread to the lock wait state and inserts a
321
355
waiting request for a record lock to the lock queue. Sets the requested mode
322
356
lock on the record. */
325
359
lock_clust_rec_read_check_and_lock(
326
360
/*===============================*/
327
/* out: DB_SUCCESS, DB_LOCK_WAIT,
328
DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
329
ulint flags, /* in: if BTR_NO_LOCKING_FLAG bit is set,
331
rec_t* rec, /* in: user record or page supremum record
332
which should be read or passed over by a read
334
dict_index_t* index, /* in: clustered index */
335
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
336
ulint mode, /* in: mode of the lock which the read cursor
337
should set on records: LOCK_S or LOCK_X; the
338
latter is possible in SELECT FOR UPDATE */
339
ulint gap_mode,/* in: LOCK_ORDINARY, LOCK_GAP, or
341
que_thr_t* thr); /* in: query thread */
362
DB_LOCK_WAIT, DB_DEADLOCK, or
363
DB_QUE_THR_SUSPENDED */
364
ulint flags, /* in: if BTR_NO_LOCKING_FLAG
365
bit is set, does nothing */
366
const buf_block_t* block, /* in: buffer block of rec */
367
const rec_t* rec, /* in: user record or page
368
supremum record which should
369
be read or passed over by a
371
dict_index_t* index, /* in: clustered index */
372
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
373
enum lock_mode mode, /* in: mode of the lock which
374
the read cursor should set on
375
records: LOCK_S or LOCK_X; the
376
latter is possible in
378
ulint gap_mode,/* in: LOCK_ORDINARY, LOCK_GAP, or
380
que_thr_t* thr); /* in: query thread */
342
381
/*************************************************************************
343
382
Checks if locks of other transactions prevent an immediate read, or passing
344
383
over by a read cursor, of a clustered index record. If they do, first tests
348
387
lock on the record. This is an alternative version of
349
388
lock_clust_rec_read_check_and_lock() that does not require the parameter
353
392
lock_clust_rec_read_check_and_lock_alt(
354
393
/*===================================*/
355
/* out: DB_SUCCESS, DB_LOCK_WAIT,
356
DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
357
ulint flags, /* in: if BTR_NO_LOCKING_FLAG bit is set,
359
rec_t* rec, /* in: user record or page supremum record
360
which should be read or passed over by a read
362
dict_index_t* index, /* in: clustered index */
363
ulint mode, /* in: mode of the lock which the read cursor
364
should set on records: LOCK_S or LOCK_X; the
365
latter is possible in SELECT FOR UPDATE */
366
ulint gap_mode,/* in: LOCK_ORDINARY, LOCK_GAP, or
368
que_thr_t* thr); /* in: query thread */
395
DB_LOCK_WAIT, DB_DEADLOCK, or
396
DB_QUE_THR_SUSPENDED */
397
ulint flags, /* in: if BTR_NO_LOCKING_FLAG
398
bit is set, does nothing */
399
const buf_block_t* block, /* in: buffer block of rec */
400
const rec_t* rec, /* in: user record or page
401
supremum record which should
402
be read or passed over by a
404
dict_index_t* index, /* in: clustered index */
405
enum lock_mode mode, /* in: mode of the lock which
406
the read cursor should set on
407
records: LOCK_S or LOCK_X; the
408
latter is possible in
410
ulint gap_mode,/* in: LOCK_ORDINARY, LOCK_GAP, or
412
que_thr_t* thr); /* in: query thread */
369
413
/*************************************************************************
370
414
Checks that a record is seen in a consistent read. */
373
417
lock_clust_rec_cons_read_sees(
374
418
/*==========================*/
375
419
/* out: TRUE if sees, or FALSE if an earlier
376
420
version of the record should be retrieved */
377
rec_t* rec, /* in: user record which should be read or
421
const rec_t* rec, /* in: user record which should be read or
378
422
passed over by a read cursor */
379
423
dict_index_t* index, /* in: clustered index */
380
424
const ulint* offsets,/* in: rec_get_offsets(rec, index) */
381
425
read_view_t* view); /* in: consistent read view */
382
426
/*************************************************************************
383
427
Checks that a non-clustered index record is seen in a consistent read. */
386
430
lock_sec_rec_cons_read_sees(
387
431
/*========================*/
388
/* out: TRUE if certainly sees, or FALSE if an
389
earlier version of the clustered index record
390
might be needed: NOTE that a non-clustered
391
index page contains so little information on
392
its modifications that also in the case FALSE,
393
the present version of rec may be the right,
394
but we must check this from the clustered
396
rec_t* rec, /* in: user record which should be read or
397
passed over by a read cursor */
398
dict_index_t* index, /* in: non-clustered index */
399
read_view_t* view); /* in: consistent read view */
432
/* out: TRUE if certainly
433
sees, or FALSE if an earlier
434
version of the clustered index
435
record might be needed: NOTE
436
that a non-clustered index
437
page contains so little
439
modifications that also in the
440
case FALSE, the present
441
version of rec may be the
442
right, but we must check this
443
from the clustered index
445
const rec_t* rec, /* in: user record which
446
should be read or passed over
448
const read_view_t* view); /* in: consistent read view */
400
449
/*************************************************************************
401
450
Locks the specified database table in the mode given. If the lock cannot
402
451
be granted immediately, the query thread is put to wait. */
520
583
trx_t* trx); /* in: transaction */
521
584
/*************************************************************************
522
585
Checks if a lock request lock1 has to wait for request lock2. */
525
588
lock_has_to_wait(
526
589
/*=============*/
527
/* out: TRUE if lock1 has to wait for lock2 to be
529
lock_t* lock1, /* in: waiting lock */
530
lock_t* lock2); /* in: another lock; NOTE that it is assumed that this
531
has a lock bit set on the same record as in lock1 if
532
the locks are record locks */
590
/* out: TRUE if lock1 has to wait for
591
lock2 to be removed */
592
const lock_t* lock1, /* in: waiting lock */
593
const lock_t* lock2); /* in: another lock; NOTE that it is
594
assumed that this has a lock bit set
595
on the same record as in lock1 if the
596
locks are record locks */
533
597
/*************************************************************************
534
598
Checks that a transaction id is sensible, i.e., not in the future. */
537
601
lock_check_trx_id_sanity(
538
602
/*=====================*/
539
603
/* out: TRUE if ok */
540
604
dulint trx_id, /* in: trx id */
541
rec_t* rec, /* in: user record */
605
const rec_t* rec, /* in: user record */
542
606
dict_index_t* index, /* in: clustered index */
543
607
const ulint* offsets, /* in: rec_get_offsets(rec, index) */
544
608
ibool has_kernel_mutex);/* in: TRUE if the caller owns the
546
610
/*************************************************************************
547
Validates the lock queue on a single record. */
550
lock_rec_queue_validate(
551
/*====================*/
552
/* out: TRUE if ok */
553
rec_t* rec, /* in: record to look at */
554
dict_index_t* index, /* in: index, or NULL if not known */
555
const ulint* offsets);/* in: rec_get_offsets(rec, index) */
556
/*************************************************************************
557
611
Prints info of a table lock. */
560
614
lock_table_print(
561
615
/*=============*/
562
FILE* file, /* in: file where to print */
563
lock_t* lock); /* in: table type lock */
616
FILE* file, /* in: file where to print */
617
const lock_t* lock); /* in: table type lock */
564
618
/*************************************************************************
565
619
Prints info of a record lock. */
570
FILE* file, /* in: file where to print */
571
lock_t* lock); /* in: record type lock */
624
FILE* file, /* in: file where to print */
625
const lock_t* lock); /* in: record type lock */
572
626
/*************************************************************************
573
627
Prints info of locks for all transactions. */
576
630
lock_print_info_summary(
577
631
/*====================*/
578
632
FILE* file); /* in: file where to print */
579
633
/*************************************************************************
580
634
Prints info of locks for each transaction. */
583
637
lock_print_info_all_transactions(
584
638
/*=============================*/
585
639
FILE* file); /* in: file where to print */
586
640
/*************************************************************************
587
Validates the lock queue on a table. */
590
lock_table_queue_validate(
591
/*======================*/
592
/* out: TRUE if ok */
593
dict_table_t* table); /* in: table */
594
/*************************************************************************
595
Validates the record lock queues on a page. */
598
lock_rec_validate_page(
599
/*===================*/
600
/* out: TRUE if ok */
601
ulint space, /* in: space id */
602
ulint page_no);/* in: page number */
603
/*************************************************************************
604
Validates the lock system. */
609
/* out: TRUE if ok */
610
/*************************************************************************
611
641
Return approximate number or record locks (bits set in the bitmap) for
612
642
this transaction. Since delete-marked records may be removed, the
613
643
record count will not be precise. */
616
646
lock_number_of_rows_locked(
617
647
/*=======================*/
618
648
trx_t* trx); /* in: transaction */
620
/* The lock system */
621
extern lock_sys_t* lock_sys;
650
/***********************************************************************
651
Gets the type of a lock. Non-inline version for using outside of the
657
/* out: LOCK_TABLE or LOCK_REC */
658
const lock_t* lock); /* in: lock */
660
/***********************************************************************
661
Gets the id of the transaction owning a lock. */
666
/* out: transaction id */
667
const lock_t* lock); /* in: lock */
669
/***********************************************************************
670
Gets the mode 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 type of a lock in a human readable string.
681
The string should not be free()'d or modified. */
687
const lock_t* lock); /* in: lock */
689
/***********************************************************************
690
Gets the id of the table on which the lock is. */
695
/* out: id of the table */
696
const lock_t* lock); /* in: lock */
698
/***********************************************************************
699
Gets the name of the table on which the lock is.
700
The string should not be free()'d or modified. */
705
/* out: name of the table */
706
const lock_t* lock); /* in: lock */
708
/***********************************************************************
709
For a record lock, gets the index on which the lock is. */
715
const lock_t* lock); /* in: lock */
717
/***********************************************************************
718
For a record lock, gets the name of the index on which the lock is.
719
The string should not be free()'d or modified. */
722
lock_rec_get_index_name(
723
/*====================*/
724
/* out: name of the index */
725
const lock_t* lock); /* in: lock */
727
/***********************************************************************
728
For a record lock, gets the tablespace number on which the lock is. */
731
lock_rec_get_space_id(
732
/*==================*/
733
/* out: tablespace number */
734
const lock_t* lock); /* in: lock */
736
/***********************************************************************
737
For a record lock, gets the page number on which the lock is. */
740
lock_rec_get_page_no(
741
/*=================*/
742
/* out: page number */
743
const lock_t* lock); /* in: lock */
623
745
/* Lock modes and types */
625
#define LOCK_NONE 0 /* this flag is used elsewhere to note
627
#define LOCK_IS 2 /* intention shared */
628
#define LOCK_IX 3 /* intention exclusive */
629
#define LOCK_S 4 /* shared */
630
#define LOCK_X 5 /* exclusive */
631
#define LOCK_AUTO_INC 6 /* locks the auto-inc counter of a table
632
in an exclusive mode */
633
746
#define LOCK_MODE_MASK 0xFUL /* mask used to extract mode from the
634
747
type_mode field in a lock */