~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-proposed

« back to all changes in this revision

Viewing changes to storage/xtradb/include/btr0sea.ic

  • Committer: Package Import Robot
  • Author(s): James Page, Otto Kekäläinen
  • Date: 2014-02-17 16:51:52 UTC
  • mfrom: (2.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20140217165152-k315d3175g865kkx
Tags: 5.5.35-1
[ Otto Kekäläinen ]
* New upstream release, fixing the following security issues:
  - Buffer overflow in client/mysql.cc (Closes: #737597).
    - CVE-2014-0001
  - http://www.oracle.com/technetwork/topics/security/cpujan2014-1972949.html
    - CVE-2013-5891
    - CVE-2013-5908
    - CVE-2014-0386
    - CVE-2014-0393
    - CVE-2014-0401
    - CVE-2014-0402
    - CVE-2014-0412
    - CVE-2014-0420
    - CVE-2014-0437
* Upstream https://mariadb.atlassian.net/browse/MDEV-4902
  fixes compatibility with Bison 3.0 (Closes: #733002)
* Updated Russian debconf translation (Closes: #734426)
* Updated Japanese debconf translation (Closes: #735284)
* Updated French debconf translation (Closes: #736480)
* Renamed SONAME properly (Closes: #732967)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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., 59 Temple
15
 
Place, Suite 330, Boston, MA 02111-1307 USA
 
14
this program; if not, write to the Free Software Foundation, Inc., 
 
15
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
87
87
New functions to control split btr_search_index */
88
88
UNIV_INLINE
89
89
hash_table_t*
90
 
btr_search_get_hash_index(
 
90
btr_search_get_hash_table(
91
91
/*======================*/
92
 
        index_id_t      key)
 
92
        const dict_index_t*     index)  /*!< in: index */
93
93
{
94
 
        return(btr_search_sys->hash_index[key % btr_search_index_num]);
 
94
        ut_ad(index);
 
95
        ut_ad(index->search_table);
 
96
 
 
97
        return(index->search_table);
95
98
}
96
99
 
97
100
UNIV_INLINE
98
101
rw_lock_t*
99
102
btr_search_get_latch(
100
103
/*=================*/
101
 
        index_id_t      key)
102
 
{
103
 
        return(btr_search_latch_part[key % btr_search_index_num]);
 
104
        const dict_index_t*     index)  /*!< in: index */
 
105
{
 
106
        ut_ad(index);
 
107
        ut_ad(index->search_latch >= btr_search_latch_arr &&
 
108
              index->search_latch < btr_search_latch_arr +
 
109
              btr_search_index_num);
 
110
 
 
111
        return(index->search_latch);
 
112
}
 
113
 
 
114
/*********************************************************************//**
 
115
Returns the AHI partition number corresponding to a given index ID. */
 
116
UNIV_INLINE
 
117
ulint
 
118
btr_search_get_key(
 
119
/*===============*/
 
120
        index_id_t      index_id)       /*!< in: index ID */
 
121
{
 
122
        return(index_id % btr_search_index_num);
 
123
}
 
124
 
 
125
/*********************************************************************//**
 
126
Initializes AHI-related fields in a newly created index. */
 
127
UNIV_INLINE
 
128
void
 
129
btr_search_index_init(
 
130
/*===============*/
 
131
        dict_index_t*   index)  /*!< in: index */
 
132
{
 
133
        ut_ad(index);
 
134
 
 
135
        index->search_latch =
 
136
                &btr_search_latch_arr[btr_search_get_key(index->id)];
 
137
        index->search_table =
 
138
                btr_search_sys->hash_tables[btr_search_get_key(index->id)];
104
139
}
105
140
 
106
141
UNIV_INLINE
111
146
        ulint   i;
112
147
 
113
148
        for (i = 0; i < btr_search_index_num; i++) {
114
 
                rw_lock_x_lock(btr_search_latch_part[i]);
 
149
                rw_lock_x_lock(&btr_search_latch_arr[i]);
115
150
        }
116
151
}
117
152
 
123
158
        ulint   i;
124
159
 
125
160
        for (i = 0; i < btr_search_index_num; i++) {
126
 
                rw_lock_x_unlock(btr_search_latch_part[i]);
127
 
        }
128
 
}
129
 
 
130
 
UNIV_INLINE
131
 
void
132
 
btr_search_s_lock_all(void)
133
 
/*=======================*/
134
 
{
135
 
        ulint   i;
136
 
 
137
 
        for (i = 0; i < btr_search_index_num; i++) {
138
 
                rw_lock_s_lock(btr_search_latch_part[i]);
139
 
        }
140
 
}
141
 
 
142
 
UNIV_INLINE
143
 
void
144
 
btr_search_s_unlock_all(void)
145
 
/*=========================*/
146
 
{
147
 
        ulint   i;
148
 
 
149
 
        for (i = 0; i < btr_search_index_num; i++) {
150
 
                rw_lock_s_unlock(btr_search_latch_part[i]);
151
 
        }
152
 
}
153
 
 
 
161
                rw_lock_x_unlock(&btr_search_latch_arr[i]);
 
162
        }
 
163
}
 
164
 
 
165
#ifdef UNIV_SYNC_DEBUG
 
166
/********************************************************************//**
 
167
Checks if the thread owns any adaptive hash latches in either S or X mode.
 
168
@return TRUE if the thread owns at least one latch in any mode. */
 
169
UNIV_INLINE
 
170
ibool
 
171
btr_search_own_any(void)
 
172
/*====================*/
 
173
{
 
174
        ulint   i;
 
175
 
 
176
        for (i = 0; i < btr_search_index_num; i++) {
 
177
                if (rw_lock_own(&btr_search_latch_arr[i], RW_LOCK_SHARED) ||
 
178
                    rw_lock_own(&btr_search_latch_arr[i], RW_LOCK_EX)) {
 
179
                        return(TRUE);
 
180
                }
 
181
        }
 
182
 
 
183
        return(FALSE);
 
184
}
 
185
#endif