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