1 /*****************************************************************************
2 
3 Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License, version 2.0,
7 as published by the Free Software Foundation.
8 
9 This program is also distributed with certain software (including
10 but not limited to OpenSSL) that is licensed under separate terms,
11 as designated in a particular file or component or in included license
12 documentation.  The authors of MySQL hereby grant you an additional
13 permission to link the program and your derivative works with the
14 separately licensed software that they have included with MySQL.
15 
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 GNU General Public License, version 2.0, for more details.
20 
21 You should have received a copy of the GNU General Public License along with
22 this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
24 
25 *****************************************************************************/
26 
27 /**************************************************//**
28 @file include/dict0types.h
29 Data dictionary global types
30 
31 Created 1/8/1996 Heikki Tuuri
32 *******************************************************/
33 
34 #ifndef dict0types_h
35 #define dict0types_h
36 
37 struct dict_sys_t;
38 struct dict_col_t;
39 struct dict_field_t;
40 struct dict_index_t;
41 struct dict_table_t;
42 struct dict_foreign_t;
43 
44 struct ind_node_t;
45 struct tab_node_t;
46 
47 /* Space id and page no where the dictionary header resides */
48 #define	DICT_HDR_SPACE		0	/* the SYSTEM tablespace */
49 #define	DICT_HDR_PAGE_NO	FSP_DICT_HDR_PAGE_NO
50 
51 /* The ibuf table and indexes's ID are assigned as the number
52 DICT_IBUF_ID_MIN plus the space id */
53 #define DICT_IBUF_ID_MIN	0xFFFFFFFF00000000ULL
54 
55 typedef ib_id_t		table_id_t;
56 typedef ib_id_t		index_id_t;
57 
58 /** Error to ignore when we load table dictionary into memory. However,
59 the table and index will be marked as "corrupted", and caller will
60 be responsible to deal with corrupted table or index.
61 Note: please define the IGNORE_ERR_* as bits, so their value can
62 be or-ed together */
63 enum dict_err_ignore_t {
64 	DICT_ERR_IGNORE_NONE = 0,	/*!< no error to ignore */
65 	DICT_ERR_IGNORE_INDEX_ROOT = 1,	/*!< ignore error if index root
66 					page is FIL_NULL or incorrect value */
67 	DICT_ERR_IGNORE_CORRUPT = 2,	/*!< skip corrupted indexes */
68 	DICT_ERR_IGNORE_FK_NOKEY = 4,	/*!< ignore error if any foreign
69 					key is missing */
70 	DICT_ERR_IGNORE_RECOVER_LOCK = 8,
71 					/*!< Used when recovering table locks
72 					for resurrected transactions.
73 					Silently load a missing
74 					tablespace, and do not load
75 					incomplete index definitions. */
76 	DICT_ERR_IGNORE_ALL = 0xFFFF	/*!< ignore all errors */
77 };
78 
79 /** Quiescing states for flushing tables to disk. */
80 enum ib_quiesce_t {
81 	QUIESCE_NONE,
82 	QUIESCE_START,			/*!< Initialise, prepare to start */
83 	QUIESCE_COMPLETE		/*!< All done */
84 };
85 
86 /** Prefix for tmp tables, adopted from sql/table.h */
87 #define tmp_file_prefix		"#sql"
88 #define tmp_file_prefix_length	4
89 #define TEMP_FILE_PREFIX_INNODB	"#sql-ib"
90 
91 #define TEMP_TABLE_PREFIX                "#sql"
92 #define TEMP_TABLE_PATH_PREFIX           "/" TEMP_TABLE_PREFIX
93 
94 #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
95 /** Flag to control insert buffer debugging. */
96 extern uint		ibuf_debug;
97 #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
98 
99 #endif
100