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