1 /*****************************************************************************
2 
3 Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
4 Copyright (c) 2018, 2020, MariaDB Corporation.
5 
6 This program is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free Software
8 Foundation; version 2 of the License.
9 
10 This program is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License along with
15 this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
17 
18 *****************************************************************************/
19 
20 /**************************************************//**
21 @file include/ha0ha.h
22 The hash table interface for the adaptive hash index
23 
24 Created 8/18/1994 Heikki Tuuri
25 *******************************************************/
26 
27 #ifndef ha0ha_h
28 #define ha0ha_h
29 
30 #include "hash0hash.h"
31 #include "page0types.h"
32 #include "buf0types.h"
33 #include "rem0types.h"
34 
35 #ifdef BTR_CUR_HASH_ADAPT
36 /*************************************************************//**
37 Looks for an element in a hash table.
38 @return pointer to the data of the first hash table node in chain
39 having the fold number, NULL if not found */
40 UNIV_INLINE
41 const rec_t*
42 ha_search_and_get_data(
43 /*===================*/
44 	hash_table_t*	table,	/*!< in: hash table */
45 	ulint		fold);	/*!< in: folded value of the searched data */
46 
47 /** The hash table external chain node */
48 struct ha_node_t {
49 	ulint		fold;	/*!< fold value for the data */
50 	ha_node_t*	next;	/*!< next chain node or NULL if none */
51 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
52 	buf_block_t*	block;	/*!< buffer block containing the data, or NULL */
53 #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
54 	const rec_t*	data;	/*!< pointer to the data */
55 };
56 
57 #include "ha0ha.inl"
58 #endif /* BTR_CUR_HASH_ADAPT */
59 
60 #endif
61