~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/lock0lock.h

Merge Joe, plus I updated the tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1996, 2010, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
12
 
13
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., 51 Franklin
15
 
St, Fifth Floor, Boston, MA 02110-1301 USA
 
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
59
59
/*============*/
60
60
        ulint   n_cells);       /*!< in: number of slots in lock hash table */
61
61
/*********************************************************************//**
62
 
Closes the lock system at database shutdown. */
63
 
UNIV_INTERN
64
 
void
65
 
lock_sys_close(void);
66
 
/*================*/
67
 
/*********************************************************************//**
68
62
Checks if some transaction has an implicit x-lock on a record in a clustered
69
63
index.
70
64
@return transaction which has the x-lock, or NULL */
340
334
        que_thr_t*      thr,    /*!< in: query thread */
341
335
        mtr_t*          mtr);   /*!< in/out: mini-transaction */
342
336
/*********************************************************************//**
343
 
Like lock_clust_rec_read_check_and_lock(), but reads a
 
337
Like the counterpart for a clustered index below, but now we read a
344
338
secondary index record.
345
 
@return DB_SUCCESS, DB_SUCCESS_LOCKED_REC, DB_LOCK_WAIT, DB_DEADLOCK,
346
 
or DB_QUE_THR_SUSPENDED */
 
339
@return DB_SUCCESS, DB_LOCK_WAIT, DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
347
340
UNIV_INTERN
348
 
enum db_err
 
341
ulint
349
342
lock_sec_rec_read_check_and_lock(
350
343
/*=============================*/
351
344
        ulint                   flags,  /*!< in: if BTR_NO_LOCKING_FLAG
372
365
puts the transaction and the query thread to the lock wait state and inserts a
373
366
waiting request for a record lock to the lock queue. Sets the requested mode
374
367
lock on the record.
375
 
@return DB_SUCCESS, DB_SUCCESS_LOCKED_REC, DB_LOCK_WAIT, DB_DEADLOCK,
376
 
or DB_QUE_THR_SUSPENDED */
 
368
@return DB_SUCCESS, DB_LOCK_WAIT, DB_DEADLOCK, or DB_QUE_THR_SUSPENDED */
377
369
UNIV_INTERN
378
 
enum db_err
 
370
ulint
379
371
lock_clust_rec_read_check_and_lock(
380
372
/*===============================*/
381
373
        ulint                   flags,  /*!< in: if BTR_NO_LOCKING_FLAG
615
607
        FILE*           file,   /*!< in: file where to print */
616
608
        const lock_t*   lock);  /*!< in: record type lock */
617
609
/*********************************************************************//**
618
 
Prints info of locks for all transactions.
619
 
@return FALSE if not able to obtain kernel mutex
620
 
and exits without printing info */
 
610
Prints info of locks for all transactions. */
621
611
UNIV_INTERN
622
 
ibool
 
612
void
623
613
lock_print_info_summary(
624
614
/*====================*/
625
 
        FILE*   file,   /*!< in: file where to print */
626
 
        ibool   nowait);/*!< in: whether to wait for the kernel mutex */
627
 
/*************************************************************************
 
615
        FILE*   file);  /*!< in: file where to print */
 
616
/*********************************************************************//**
628
617
Prints info of locks for each transaction. */
629
618
UNIV_INTERN
630
619
void
639
628
ulint
640
629
lock_number_of_rows_locked(
641
630
/*=======================*/
642
 
        const trx_t*    trx);   /*!< in: transaction */
643
 
/*******************************************************************//**
644
 
Check if a transaction holds any autoinc locks.
645
 
@return TRUE if the transaction holds any AUTOINC locks. */
646
 
UNIV_INTERN
647
 
ibool
648
 
lock_trx_holds_autoinc_locks(
649
 
/*=========================*/
650
 
        const trx_t*    trx);           /*!< in: transaction */
 
631
        trx_t*  trx);   /*!< in: transaction */
651
632
/*******************************************************************//**
652
633
Release all the transaction's autoinc locks. */
653
634
UNIV_INTERN
670
651
Gets the id of the transaction owning a lock.
671
652
@return transaction id */
672
653
UNIV_INTERN
673
 
trx_id_t
 
654
ullint
674
655
lock_get_trx_id(
675
656
/*============*/
676
657
        const lock_t*   lock);  /*!< in: lock */
699
680
Gets the id of the table on which the lock is.
700
681
@return id of the table */
701
682
UNIV_INTERN
702
 
table_id_t
 
683
ullint
703
684
lock_get_table_id(
704
685
/*==============*/
705
686
        const lock_t*   lock);  /*!< in: lock */