1 /*****************************************************************************
2 
3 Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
4 Copyright (c) 2015, 2018, 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/db0err.h
22 Global error codes for the database
23 
24 Created 5/24/1996 Heikki Tuuri
25 *******************************************************/
26 
27 #ifndef db0err_h
28 #define db0err_h
29 
30 /* Do not include univ.i because univ.i includes this. */
31 
32 enum dberr_t {
33 	DB_SUCCESS,
34 
35 	DB_SUCCESS_LOCKED_REC = 9,	/*!< like DB_SUCCESS, but a new
36 					explicit record lock was created */
37 
38 	/* The following are error codes */
39 	DB_ERROR = 11,
40 	DB_INTERRUPTED,
41 	DB_OUT_OF_MEMORY,
42 	DB_OUT_OF_FILE_SPACE,
43 	DB_LOCK_WAIT,
44 	DB_DEADLOCK,
45 	DB_ROLLBACK,
46 	DB_DUPLICATE_KEY,
47 	DB_MISSING_HISTORY,		/*!< required history data has been
48 					deleted due to lack of space in
49 					rollback segment */
50 	DB_CLUSTER_NOT_FOUND = 30,
51 	DB_TABLE_NOT_FOUND,
52 	DB_MUST_GET_MORE_FILE_SPACE,	/*!< the database has to be stopped
53 					and restarted with more file space */
54 	DB_TABLE_IS_BEING_USED,
55 	DB_TOO_BIG_RECORD,		/*!< a record in an index would not fit
56 					on a compressed page, or it would
57 					become bigger than 1/2 free space in
58 					an uncompressed page frame */
59 	DB_LOCK_WAIT_TIMEOUT,		/*!< lock wait lasted too long */
60 	DB_NO_REFERENCED_ROW,		/*!< referenced key value not found
61 					for a foreign key in an insert or
62 					update of a row */
63 	DB_ROW_IS_REFERENCED,		/*!< cannot delete or update a row
64 					because it contains a key value
65 					which is referenced */
66 	DB_CANNOT_ADD_CONSTRAINT,	/*!< adding a foreign key constraint
67 					to a table failed */
68 	DB_CORRUPTION,			/*!< data structure corruption
69 					noticed */
70 	DB_CANNOT_DROP_CONSTRAINT,	/*!< dropping a foreign key constraint
71 					from a table failed */
72 	DB_NO_SAVEPOINT,		/*!< no savepoint exists with the given
73 					name */
74 	DB_TABLESPACE_EXISTS,		/*!< we cannot create a new single-table
75 					tablespace because a file of the same
76 					name already exists */
77 	DB_TABLESPACE_DELETED,		/*!< tablespace was deleted or is
78 					being dropped right now */
79 	DB_TABLESPACE_NOT_FOUND,	/*<! Attempt to delete a tablespace
80 					instance that was not found in the
81 					tablespace hash table */
82 	DB_LOCK_TABLE_FULL,		/*!< lock structs have exhausted the
83 					buffer pool (for big transactions,
84 					InnoDB stores the lock structs in the
85 					buffer pool) */
86 	DB_FOREIGN_DUPLICATE_KEY,	/*!< foreign key constraints
87 					activated by the operation would
88 					lead to a duplicate key in some
89 					table */
90 	DB_TOO_MANY_CONCURRENT_TRXS,	/*!< when InnoDB runs out of the
91 					preconfigured undo slots, this can
92 					only happen when there are too many
93 					concurrent transactions */
94 	DB_UNSUPPORTED,			/*!< when InnoDB sees any artefact or
95 					a feature that it can't recoginize or
96 					work with e.g., FT indexes created by
97 					a later version of the engine. */
98 
99 	DB_INVALID_NULL,		/*!< a NOT NULL column was found to
100 					be NULL during table rebuild */
101 
102 	DB_STATS_DO_NOT_EXIST,		/*!< an operation that requires the
103 					persistent storage, used for recording
104 					table and index statistics, was
105 					requested but this storage does not
106 					exist itself or the stats for a given
107 					table do not exist */
108 	DB_FOREIGN_EXCEED_MAX_CASCADE,	/*!< Foreign key constraint related
109 					cascading delete/update exceeds
110 					maximum allowed depth */
111 	DB_CHILD_NO_INDEX,		/*!< the child (foreign) table does
112 					not have an index that contains the
113 					foreign keys as its prefix columns */
114 	DB_PARENT_NO_INDEX,		/*!< the parent table does not
115 					have an index that contains the
116 					foreign keys as its prefix columns */
117 	DB_TOO_BIG_INDEX_COL,		/*!< index column size exceeds
118 					maximum limit */
119 	DB_INDEX_CORRUPT,		/*!< we have corrupted index */
120 	DB_UNDO_RECORD_TOO_BIG,		/*!< the undo log record is too big */
121 	DB_READ_ONLY,			/*!< Update operation attempted in
122 					a read-only transaction */
123 	DB_FTS_INVALID_DOCID,		/* FTS Doc ID cannot be zero */
124 	DB_TABLE_IN_FK_CHECK,		/* table is being used in foreign
125 					key check */
126 	DB_ONLINE_LOG_TOO_BIG,		/*!< Modification log grew too big
127 					during online index creation */
128 
129 	DB_IDENTIFIER_TOO_LONG,		/*!< Identifier name too long */
130 	DB_FTS_EXCEED_RESULT_CACHE_LIMIT,	/*!< FTS query memory
131 					exceeds result cache limit */
132 	DB_TEMP_FILE_WRITE_FAIL,	/*!< Temp file write failure */
133 	DB_CANT_CREATE_GEOMETRY_OBJECT,	/*!< Cannot create specified Geometry
134 					data object */
135 	DB_CANNOT_OPEN_FILE,		/*!< Cannot open a file */
136 	DB_FTS_TOO_MANY_WORDS_IN_PHRASE,
137 					/*< Too many words in a phrase */
138 
139 	DB_DECRYPTION_FAILED,		/* Tablespace encrypted and
140 					decrypt operation failed because
141 					of missing key management plugin,
142 					or missing or incorrect key or
143 					incorret AES method or algorithm. */
144 
145 	DB_IO_ERROR = 100,		/*!< Generic IO error */
146 
147 	DB_IO_PARTIAL_FAILED,		/*!< Partial IO request failed */
148 
149 	DB_FORCED_ABORT,		/*!< Transaction was forced to rollback
150 					by a higher priority transaction */
151 
152 	DB_TABLE_CORRUPT,		/*!< Table/clustered index is
153 					corrupted */
154 
155 	DB_COMPUTE_VALUE_FAILED,	/*!< Compute generated value failed */
156 
157 	DB_NO_FK_ON_S_BASE_COL,		/*!< Cannot add foreign constrain
158 					placed on the base column of
159 					stored column */
160 
161 	DB_IO_NO_PUNCH_HOLE,		/*!< Punch hole not supported by
162 					file system. */
163 
164 	DB_PAGE_CORRUPTED,		/* Page read from tablespace is
165 					corrupted. */
166 	/* The following are partial failure codes */
167 	DB_FAIL = 1000,
168 	DB_OVERFLOW,
169 	DB_UNDERFLOW,
170 	DB_STRONG_FAIL,
171 	DB_ZIP_OVERFLOW,
172 	DB_RECORD_NOT_FOUND = 1500,
173 	DB_END_OF_INDEX,
174 	DB_NOT_FOUND,			/*!< Generic error code for "Not found"
175 					type of errors */
176 };
177 
178 #endif
179