1 /*****************************************************************************
2 
3 Copyright (c) 1996, 2020, 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/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 
38 enum dberr_t {
39 	DB_SUCCESS_LOCKED_REC = 9,	/*!< like DB_SUCCESS, but a new
40 					explicit record lock was created */
41 	DB_SUCCESS = 10,
42 
43 	/* The following are error codes */
44 	DB_ERROR,
45 	DB_INTERRUPTED,
46 	DB_OUT_OF_MEMORY,
47 	DB_OUT_OF_FILE_SPACE,
48 	DB_LOCK_WAIT,
49 	DB_DEADLOCK,
50 	DB_ROLLBACK,
51 	DB_DUPLICATE_KEY,
52 	DB_QUE_THR_SUSPENDED,
53 	DB_MISSING_HISTORY,		/*!< required history data has been
54 					deleted due to lack of space in
55 					rollback segment */
56 	DB_CLUSTER_NOT_FOUND = 30,
57 	DB_TABLE_NOT_FOUND,
58 	DB_MUST_GET_MORE_FILE_SPACE,	/*!< the database has to be stopped
59 					and restarted with more file space */
60 	DB_TABLE_IS_BEING_USED,
61 	DB_TOO_BIG_RECORD,		/*!< a record in an index would not fit
62 					on a compressed page, or it would
63 					become bigger than 1/2 free space in
64 					an uncompressed page frame */
65 	DB_LOCK_WAIT_TIMEOUT,		/*!< lock wait lasted too long */
66 	DB_NO_REFERENCED_ROW,		/*!< referenced key value not found
67 					for a foreign key in an insert or
68 					update of a row */
69 	DB_ROW_IS_REFERENCED,		/*!< cannot delete or update a row
70 					because it contains a key value
71 					which is referenced */
72 	DB_CANNOT_ADD_CONSTRAINT,	/*!< adding a foreign key constraint
73 					to a table failed */
74 	DB_CORRUPTION,			/*!< data structure corruption noticed */
75 	DB_CANNOT_DROP_CONSTRAINT,	/*!< dropping a foreign key constraint
76 					from a table failed */
77 	DB_NO_SAVEPOINT,		/*!< no savepoint exists with the given
78 					name */
79 	DB_TABLESPACE_EXISTS,		/*!< we cannot create a new single-table
80 					tablespace because a file of the same
81 					name already exists */
82 	DB_TABLESPACE_DELETED,		/*!< tablespace was deleted or is
83 					being dropped right now */
84 	DB_TABLESPACE_NOT_FOUND,	/*<! Attempt to delete a tablespace
85 					instance that was not found in the
86 					tablespace hash table */
87 	DB_LOCK_TABLE_FULL,		/*!< lock structs have exhausted the
88 					buffer pool (for big transactions,
89 					InnoDB stores the lock structs in the
90 					buffer pool) */
91 	DB_FOREIGN_DUPLICATE_KEY,	/*!< foreign key constraints
92 					activated by the operation would
93 					lead to a duplicate key in some
94 					table */
95 	DB_TOO_MANY_CONCURRENT_TRXS,	/*!< when InnoDB runs out of the
96 					preconfigured undo slots, this can
97 					only happen when there are too many
98 					concurrent transactions */
99 	DB_UNSUPPORTED,			/*!< when InnoDB sees any artefact or
100 					a feature that it can't recoginize or
101 					work with e.g., FT indexes created by
102 					a later version of the engine. */
103 
104 	DB_INVALID_NULL,		/*!< a NOT NULL column was found to
105 					be NULL during table rebuild */
106 
107 	DB_STATS_DO_NOT_EXIST,		/*!< an operation that requires the
108 					persistent storage, used for recording
109 					table and index statistics, was
110 					requested but this storage does not
111 					exist itself or the stats for a given
112 					table do not exist */
113 	DB_FOREIGN_EXCEED_MAX_CASCADE,	/*!< Foreign key constraint related
114 					cascading delete/update exceeds
115 					maximum allowed depth */
116 	DB_CHILD_NO_INDEX,		/*!< the child (foreign) table does
117 					not have an index that contains the
118 					foreign keys as its prefix columns */
119 	DB_PARENT_NO_INDEX,		/*!< the parent table does not
120 					have an index that contains the
121 					foreign keys as its prefix columns */
122 	DB_TOO_BIG_INDEX_COL,		/*!< index column size exceeds
123 					maximum limit */
124 	DB_INDEX_CORRUPT,		/*!< we have corrupted index */
125 	DB_UNDO_RECORD_TOO_BIG,		/*!< the undo log record is too big */
126 	DB_READ_ONLY,			/*!< Update operation attempted in
127 					a read-only transaction */
128 	DB_FTS_INVALID_DOCID,		/* FTS Doc ID cannot be zero */
129 	DB_TABLE_IN_FK_CHECK,		/* table is being used in foreign
130 					key check */
131 	DB_ONLINE_LOG_TOO_BIG,		/*!< Modification log grew too big
132 					during online index creation */
133 
134 	DB_IO_ERROR,			/*!< Generic IO error */
135 	DB_IDENTIFIER_TOO_LONG,		/*!< Identifier name too long */
136 	DB_FTS_EXCEED_RESULT_CACHE_LIMIT,	/*!< FTS query memory
137 					exceeds result cache limit */
138 	DB_TEMP_FILE_WRITE_FAILURE,	/*!< Temp file write failure */
139 	DB_FTS_TOO_MANY_WORDS_IN_PHRASE,
140 					/*< Too many words in a phrase */
141 	DB_TOO_BIG_FOR_REDO,		/* Record length greater than 10%
142 					of redo log */
143 	/* The following are partial failure codes */
144 	DB_FAIL = 1000,
145 	DB_OVERFLOW,
146 	DB_UNDERFLOW,
147 	DB_STRONG_FAIL,
148 	DB_ZIP_OVERFLOW,
149 	DB_RECORD_NOT_FOUND = 1500,
150 	DB_END_OF_INDEX,
151 	DB_DICT_CHANGED,		/*!< Some part of table dictionary has
152 					changed. Such as index dropped or
153 					foreign key dropped */
154 
155 
156         /* The following are API only error codes. */
157 	DB_DATA_MISMATCH = 2000,	/*!< Column update or read failed
158 					because the types mismatch */
159 
160 	DB_SCHEMA_NOT_LOCKED,		/*!< If an API function expects the
161 					schema to be locked in exclusive mode
162 					and if it's not then that API function
163 					will return this error code */
164 	DB_FTS_TOO_MANY_NESTED_EXP,	/*< Too many nested sub expression
165 					in full-text search string */
166 
167 	DB_NOT_FOUND			/*!< Generic error code for "Not found"
168 					type of errors */
169 };
170 
171 #endif
172