| 1 | /***************************************************************************** | 
| 2 |  | 
| 3 | Copyright (c) 1996, 2015, Oracle and/or its affiliates. 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., | 
| 15 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA | 
| 16 |  | 
| 17 | *****************************************************************************/ | 
| 18 |  | 
| 19 | /********************************************************************//** | 
| 20 | @file include/btr0types.h | 
| 21 | The index tree general types | 
| 22 |  | 
| 23 | Created 2/17/1996 Heikki Tuuri | 
| 24 | *************************************************************************/ | 
| 25 |  | 
| 26 | #ifndef btr0types_h | 
| 27 | #define btr0types_h | 
| 28 |  | 
| 29 | #include "univ.i" | 
| 30 |  | 
| 31 | #include "rem0types.h" | 
| 32 | #include "page0types.h" | 
| 33 | #include "sync0rw.h" | 
| 34 | #include "page0size.h" | 
| 35 |  | 
| 36 | /** Persistent cursor */ | 
| 37 | struct btr_pcur_t; | 
| 38 | /** B-tree cursor */ | 
| 39 | struct btr_cur_t; | 
| 40 | /** B-tree search information for the adaptive hash index */ | 
| 41 | struct btr_search_t; | 
| 42 |  | 
| 43 | #ifdef BTR_CUR_HASH_ADAPT | 
| 44 | /** Is search system enabled. | 
| 45 | Search system is protected by array of latches. */ | 
| 46 | extern char	btr_search_enabled; | 
| 47 |  | 
| 48 | /** Number of adaptive hash index partition. */ | 
| 49 | extern ulong	btr_ahi_parts; | 
| 50 | #endif /* BTR_CUR_HASH_ADAPT */ | 
| 51 |  | 
| 52 | /** The size of a reference to data stored on a different page. | 
| 53 | The reference is stored at the end of the prefix of the field | 
| 54 | in the index record. */ | 
| 55 | #define BTR_EXTERN_FIELD_REF_SIZE	FIELD_REF_SIZE | 
| 56 |  | 
| 57 | /** If the data don't exceed the size, the data are stored locally. */ | 
| 58 | #define BTR_EXTERN_LOCAL_STORED_MAX_SIZE	\ | 
| 59 | 	(BTR_EXTERN_FIELD_REF_SIZE * 2) | 
| 60 |  | 
| 61 | /** The information is used for creating a new index tree when | 
| 62 | applying TRUNCATE log record during recovery */ | 
| 63 | struct btr_create_t { | 
| 64 |  | 
| 65 | 	explicit btr_create_t(const byte* const ptr) | 
| 66 | 		: | 
| 67 | 		format_flags(), | 
| 68 | 		n_fields(), | 
| 69 | 		field_len(), | 
| 70 | 		fields(ptr), | 
| 71 | 		trx_id_pos(ULINT_UNDEFINED) | 
| 72 | 	{ | 
| 73 | 		/* Do nothing */ | 
| 74 | 	} | 
| 75 |  | 
| 76 | 	/** Page format */ | 
| 77 | 	ulint			format_flags; | 
| 78 |  | 
| 79 | 	/** Numbr of index fields */ | 
| 80 | 	ulint			n_fields; | 
| 81 |  | 
| 82 | 	/** The length of the encoded meta-data */ | 
| 83 | 	ulint			field_len; | 
| 84 |  | 
| 85 | 	/** Field meta-data, encoded. */ | 
| 86 | 	const byte* const	fields; | 
| 87 |  | 
| 88 | 	/** Position of trx-id column. */ | 
| 89 | 	ulint			trx_id_pos; | 
| 90 | }; | 
| 91 |  | 
| 92 | #endif | 
| 93 |  |