Debian Codegraph @

storage/innobase/include/db0err.h

raw
1 /*****************************************************************************
2
3 Copyright (c) 1996, 2026, Oracle and/or its affiliates.
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, version 2.0, as published by the
7 Free Software Foundation.
8
9 This program is designed to work 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 either included with
15 the program or referenced in the documentation.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
20 for more details.
21
22 You should have received a copy of the GNU General Public License along with
23 this program; if not, write to the Free Software Foundation, Inc.,
24 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26 *****************************************************************************/
27
28 /** @file include/db0err.h
29 Global error codes for the database
30
31 Created 5/24/1996 Heikki Tuuri
32 *******************************************************/
33
34 #ifndef db0err_h
35 #define db0err_h
36
37 /* Do not include univ.i because univ.i includes this. */
38
39 enum dberr_t {
40 DB_ERROR_UNSET = 0,
41 /** like DB_SUCCESS, but a new explicit record lock was created */
42 DB_SUCCESS_LOCKED_REC = 9,
43 DB_SUCCESS = 10,
44
45 /* The following are error codes */
46
47 DB_ERROR,
48 DB_INTERRUPTED,
49 DB_OUT_OF_MEMORY,
50 /** The tablespace could not be auto-extending */
51 DB_OUT_OF_FILE_SPACE,
52 DB_OUT_OF_DISK_SPACE,
53 DB_LOCK_WAIT,
54 DB_DEADLOCK,
55 DB_ROLLBACK,
56 DB_DUPLICATE_KEY,
57 /** required history data has been deleted due to lack of space in
58 rollback segment */
59 DB_MISSING_HISTORY,
60 /** skip lock */
61 DB_SKIP_LOCKED,
62 /** don't wait lock */
63 DB_LOCK_NOWAIT,
64 /** no session temporary tablespace could be allocated */
65 DB_NO_SESSION_TEMP,
66 DB_CLUSTER_NOT_FOUND = 30,
67 DB_TABLE_NOT_FOUND,
68 /** the database has to be stopped and restarted with more file space */
69 DB_MUST_GET_MORE_FILE_SPACE,
70 DB_TABLE_IS_BEING_USED,
71 /** a record in an index would not fit on a compressed page, or it would
72 become bigger than 1/2 free space in an uncompressed page frame */
73 DB_TOO_BIG_RECORD,
74 /** lock wait lasted too long */
75 DB_LOCK_WAIT_TIMEOUT,
76 /** referenced key value not found for a foreign key in an insert or
77 update of a row */
78 DB_NO_REFERENCED_ROW,
79 /** cannot delete or update a row because it contains a key value which
80 is referenced */
81 DB_ROW_IS_REFERENCED,
82 /** adding a foreign key constraint to a table failed */
83 DB_CANNOT_ADD_CONSTRAINT,
84 /** data structure corruption noticed */
85 DB_CORRUPTION,
86 /** dropping a foreign key constraint from a table failed */
87 DB_CANNOT_DROP_CONSTRAINT,
88 /** no savepoint exists with the given name */
89 DB_NO_SAVEPOINT,
90 /** cannot create a new tablespace because a file of the same name or
91 tablespace ID already exists */
92 DB_TABLESPACE_EXISTS,
93 /** tablespace was deleted or is being dropped right now */
94 DB_TABLESPACE_DELETED,
95 /** Attempt to delete a tablespace instance that was not found in the
96 tablespace hash table */
97 DB_TABLESPACE_NOT_FOUND,
98 /** lock structs have exhausted the buffer pool (for big transactions,
99 InnoDB stores the lock structs in the buffer pool) */
100 DB_LOCK_TABLE_FULL,
101 /** foreign key constraints activated by the operation would lead to a
102 duplicate key in some table */
103 DB_FOREIGN_DUPLICATE_KEY,
104 /** when InnoDB runs out of the preconfigured undo slots, this can only
105 happen when there are too many concurrent transactions */
106 DB_TOO_MANY_CONCURRENT_TRXS,
107 /** when InnoDB sees any artefact or a feature that it can't recoginize
108 or work with e.g., FT indexes created by a later version of the engine. */
109 DB_UNSUPPORTED,
110 /** a NOT NULL column was found to be NULL during table rebuild */
111 DB_INVALID_NULL,
112 /** an operation that requires the persistent storage, used for recording
113 table and index statistics, was requested but this storage does not exist
114 itself or the stats for a given table do not exist */
115 DB_STATS_DO_NOT_EXIST,
116 /** Foreign key constraint related cascading delete/update exceeds maximum
117 allowed depth */
118 DB_FOREIGN_EXCEED_MAX_CASCADE,
119 /** the child (foreign) table does not have an index that contains the
120 foreign keys as its prefix columns */
121 DB_CHILD_NO_INDEX,
122 /** the parent table does not have an index that contains the foreign keys
123 as its prefix columns */
124 DB_PARENT_NO_INDEX,
125 /** index column size exceeds maximum limit */
126 DB_TOO_BIG_INDEX_COL,
127 /** we have corrupted index */
128 DB_INDEX_CORRUPT,
129 /** the undo log record is too big */
130 DB_UNDO_RECORD_TOO_BIG,
131 /** Update operation attempted in a read-only transaction */
132 DB_READ_ONLY,
133 /** FTS Doc ID cannot be zero */
134 DB_FTS_INVALID_DOCID,
135 /** table is being used in foreign key check */
136 DB_TABLE_IN_FK_CHECK,
137 /** Modification log grew too big during online index creation */
138 DB_ONLINE_LOG_TOO_BIG,
139 /** Identifier name too long */
140 DB_IDENTIFIER_TOO_LONG,
141 /** FTS query memory exceeds result cache limit */
142 DB_FTS_EXCEED_RESULT_CACHE_LIMIT,
143 /** Temp file write failure */
144 DB_TEMP_FILE_WRITE_FAIL,
145 /** Cannot create specified Geometry data object */
146 DB_CANT_CREATE_GEOMETRY_OBJECT,
147 /** Cannot open a file */
148 DB_CANNOT_OPEN_FILE,
149 /** Too many words in a phrase */
150 DB_FTS_TOO_MANY_WORDS_IN_PHRASE,
151 /** Server version is lower than tablespace version */
152 DB_SERVER_VERSION_LOW,
153 /** The path is too long for the OS */
154 DB_TOO_LONG_PATH,
155 /** Generic IO error */
156 DB_IO_ERROR = 100,
157 /** Failure to decompress a page after reading it from disk */
158 DB_IO_DECOMPRESS_FAIL,
159 /** Punch hole not supported by InnoDB */
160 DB_IO_NO_PUNCH_HOLE,
161 /** The file system doesn't support punch hole */
162 DB_IO_NO_PUNCH_HOLE_FS,
163 /** The tablespace doesn't support punch hole */
164 DB_IO_NO_PUNCH_HOLE_TABLESPACE,
165 /** Failure to decrypt a page after reading it from disk */
166 DB_IO_DECRYPT_FAIL,
167 /** The tablespace doesn't support encrypt */
168 DB_IO_NO_ENCRYPT_TABLESPACE,
169 /** Partial IO request failed */
170 DB_IO_PARTIAL_FAILED,
171 /** Transaction was forced to rollback by a higher priority transaction */
172 DB_FORCED_ABORT,
173 /** Table/clustered index is corrupted */
174 DB_TABLE_CORRUPT,
175 /** Invalid Filename */
176 DB_WRONG_FILE_NAME,
177 /** Compute generated value failed */
178 DB_COMPUTE_VALUE_FAILED,
179 /** Cannot add foreign constrain placed on the base column of stored column */
180 DB_NO_FK_ON_S_BASE_COL,
181 /** Invalid encryption metadata in page 0. */
182 DB_INVALID_ENCRYPTION_META,
183 /** Incomplete cloned directory */
184 DB_ABORT_INCOMPLETE_CLONE,
185 /** Btree level limit exceeded. */
186 DB_BTREE_LEVEL_LIMIT_EXCEEDED,
187 /** Doublewrite meta data not found in the system space header */
188 DB_DBLWR_NOT_EXISTS,
189 /** Failed to initialize the doublewrite extents in the system tablespace */
190 DB_V1_DBLWR_INIT_FAILED,
191 /** Failed to create the doublewrite extents in the system tablespace */
192 DB_V1_DBLWR_CREATE_FAILED,
193 /** Failed to initialize the double write memory data structures */
194 DB_DBLWR_INIT_FAILED,
195 /* Schema mismatch between the metadata and data being imported. */
196 DB_SCHEMA_MISMATCH,
197 /** System has run out of resources. */
198 DB_OUT_OF_RESOURCES,
199 /** Page was discarded, was not written to storage. */
200 DB_PAGE_IS_STALE,
201 /** Error reading the auto-increment value. */
202 DB_AUTOINC_READ_ERROR,
203 /** Failed to read as read was beyond file size. */
204 DB_FILE_READ_BEYOND_SIZE,
205
206 /* The following are partial failure codes */
207
208 DB_FAIL = 1000,
209 DB_OVERFLOW,
210 DB_UNDERFLOW,
211 DB_STRONG_FAIL,
212 DB_ZIP_OVERFLOW,
213 DB_RECORD_NOT_FOUND = 1500,
214 DB_END_OF_BLOCK,
215 DB_END_OF_INDEX,
216 DB_END_SAMPLE_READ,
217
218 /** Generic error code for "Not found" type of errors */
219 DB_NOT_FOUND,
220
221 /* The following are API only error codes. */
222
223 /** Column update or read failed because the types mismatch */
224 DB_DATA_MISMATCH = 2000,
225 /* Too many nested sub expression in full-text search string */
226 DB_FTS_TOO_MANY_NESTED_EXP
227 };
228 #endif