~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/lock/lock0iter.c

Tags: innodb-plugin-1.0.3
InnoDB Plugin 1.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 
 
3
Copyright (c) 2007, 2009, Innobase Oy. All Rights Reserved.
 
4
 
 
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.
 
8
 
 
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.
 
12
 
 
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
 
16
 
 
17
*****************************************************************************/
 
18
 
1
19
/******************************************************
2
20
Lock queue iterator. Can iterate over table and record
3
21
lock queues.
4
22
 
5
 
(c) 2007 Innobase Oy
6
 
 
7
23
Created July 16, 2007 Vasil Dimov
8
24
*******************************************************/
9
25
 
15
31
#include "lock0priv.h"
16
32
#include "ut0dbg.h"
17
33
#include "ut0lst.h"
 
34
#ifdef UNIV_DEBUG
 
35
# include "srv0srv.h" /* kernel_mutex */
 
36
#endif /* UNIV_DEBUG */
18
37
 
19
38
/***********************************************************************
20
39
Initialize lock queue iterator so that it starts to iterate from
34
53
        ulint                   bit_no) /* in: record number in the
35
54
                                        heap */
36
55
{
 
56
        ut_ad(mutex_own(&kernel_mutex));
 
57
 
37
58
        iter->current_lock = lock;
38
59
 
39
60
        if (bit_no != ULINT_UNDEFINED) {
68
89
{
69
90
        const lock_t*   prev_lock;
70
91
 
 
92
        ut_ad(mutex_own(&kernel_mutex));
 
93
 
71
94
        switch (lock_get_type_low(iter->current_lock)) {
72
95
        case LOCK_REC:
73
96
                prev_lock = lock_rec_get_prev(