~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

Viewing changes to storage/innobase/include/ha0ha.ic

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-02-14 23:59:22 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120214235922-cux5uek1e5l0hje9
Tags: 5.5.20-0ubuntu1
* New upstream release.
* d/mysql-server-5.5.mysql.upstart: Fix stop on to make sure mysql is
  fully stopped before shutdown commences. (LP: #688541) Also simplify
  start on as it is redundant.
* d/control: Depend on upstart version which has apparmor profile load
  script to prevent failure on upgrade from lucid to precise.
  (LP: #907465)
* d/apparmor-profile: need to allow /run since that is the true path
  of /var/run files. (LP: #917542)
* d/control: mysql-server-5.5 has files in it that used to be owned
  by libmysqlclient-dev, so it must break/replace it. (LP: #912487)
* d/rules, d/control: 5.5.20 Fixes segfault on tests with gcc 4.6,
  change compiler back to system default.
* d/rules: Turn off embedded libedit/readline.(Closes: #659566)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1994, 2011, Oracle and/or its affiliates. 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
25
25
 
26
26
#include "ut0rnd.h"
27
27
#include "mem0mem.h"
 
28
#include "btr0types.h"
28
29
 
29
30
/***********************************************************//**
30
31
Deletes a hash node. */
39
40
Gets a hash node data.
40
41
@return pointer to the data */
41
42
UNIV_INLINE
42
 
void*
 
43
const rec_t*
43
44
ha_node_get_data(
44
45
/*=============*/
45
 
        ha_node_t*      node)   /*!< in: hash chain node */
 
46
        const ha_node_t*        node)   /*!< in: hash chain node */
46
47
{
47
48
        return(node->data);
48
49
}
57
58
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
58
59
        buf_block_t*    block,  /*!< in: buffer block containing the data */
59
60
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
60
 
        void*           data)   /*!< in: pointer to the data */
 
61
        const rec_t*    data)   /*!< in: pointer to the data */
61
62
{
62
63
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
63
64
        node->block = block;
107
108
 
108
109
/*************************************************************//**
109
110
Looks for an element in a hash table.
110
 
@return pointer to the first hash table node in chain having the fold
111
 
number, NULL if not found */
112
 
UNIV_INLINE
113
 
ha_node_t*
114
 
ha_search(
115
 
/*======*/
116
 
        hash_table_t*   table,  /*!< in: hash table */
117
 
        ulint           fold)   /*!< in: folded value of the searched data */
118
 
{
119
 
        ha_node_t*      node;
120
 
 
121
 
        ASSERT_HASH_MUTEX_OWN(table, fold);
122
 
 
123
 
        node = ha_chain_get_first(table, fold);
124
 
 
125
 
        while (node) {
126
 
                if (node->fold == fold) {
127
 
 
128
 
                        return(node);
129
 
                }
130
 
 
131
 
                node = ha_chain_get_next(node);
132
 
        }
133
 
 
134
 
        return(NULL);
135
 
}
136
 
 
137
 
/*************************************************************//**
138
 
Looks for an element in a hash table.
139
111
@return pointer to the data of the first hash table node in chain
140
112
having the fold number, NULL if not found */
141
113
UNIV_INLINE
142
 
void*
 
114
const rec_t*
143
115
ha_search_and_get_data(
144
116
/*===================*/
145
117
        hash_table_t*   table,  /*!< in: hash table */
148
120
        ha_node_t*      node;
149
121
 
150
122
        ASSERT_HASH_MUTEX_OWN(table, fold);
 
123
#ifdef UNIV_SYNC_DEBUG
 
124
        ut_ad(rw_lock_own(&btr_search_latch, RW_LOCK_SHARED));
 
125
#endif /* UNIV_SYNC_DEBUG */
 
126
        ut_ad(btr_search_enabled);
151
127
 
152
128
        node = ha_chain_get_first(table, fold);
153
129
 
172
148
/*================*/
173
149
        hash_table_t*   table,  /*!< in: hash table */
174
150
        ulint           fold,   /*!< in: folded value of the searched data */
175
 
        void*           data)   /*!< in: pointer to the data */
 
151
        const rec_t*    data)   /*!< in: pointer to the data */
176
152
{
177
153
        ha_node_t*      node;
178
154
 
179
155
        ASSERT_HASH_MUTEX_OWN(table, fold);
180
156
 
 
157
        ut_ad(btr_search_enabled);
 
158
 
181
159
        node = ha_chain_get_first(table, fold);
182
160
 
183
161
        while (node) {
202
180
/*==========================*/
203
181
        hash_table_t*   table,  /*!< in: hash table */
204
182
        ulint           fold,   /*!< in: folded value of the searched data */
205
 
        void*           data)   /*!< in: pointer to the data */
 
183
        const rec_t*    data)   /*!< in: pointer to the data */
206
184
{
207
185
        ha_node_t*      node;
208
186
 
209
187
        ASSERT_HASH_MUTEX_OWN(table, fold);
 
188
#ifdef UNIV_SYNC_DEBUG
 
189
        ut_ad(rw_lock_own(&btr_search_latch, RW_LOCK_EX));
 
190
#endif /* UNIV_SYNC_DEBUG */
 
191
        ut_ad(btr_search_enabled);
210
192
 
211
193
        node = ha_search_with_data(table, fold, data);
212
194