db0err.h 4.32 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*****************************************************************************

Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA

*****************************************************************************/

19 20
/**************************************************//**
@file include/db0err.h
osku's avatar
osku committed
21 22 23 24 25 26 27 28 29
Global error codes for the database

Created 5/24/1996 Heikki Tuuri
*******************************************************/

#ifndef db0err_h
#define db0err_h


30
enum db_err {
31 32
	DB_SUCCESS_LOCKED_REC = 9,	/*!< like DB_SUCCESS, but a new
					explicit record lock was created */
33
	DB_SUCCESS = 10,
osku's avatar
osku committed
34

35 36
	/* The following are error codes */
	DB_ERROR,
37
	DB_INTERRUPTED,
38 39 40 41 42 43 44 45
	DB_OUT_OF_MEMORY,
	DB_OUT_OF_FILE_SPACE,
	DB_LOCK_WAIT,
	DB_DEADLOCK,
	DB_ROLLBACK,
	DB_DUPLICATE_KEY,
	DB_QUE_THR_SUSPENDED,
	DB_MISSING_HISTORY,		/* required history data has been
osku's avatar
osku committed
46 47
					deleted due to lack of space in
					rollback segment */
48
	DB_CLUSTER_NOT_FOUND = 30,
49 50
	DB_TABLE_NOT_FOUND,
	DB_MUST_GET_MORE_FILE_SPACE,	/* the database has to be stopped
osku's avatar
osku committed
51
					and restarted with more file space */
52 53
	DB_TABLE_IS_BEING_USED,
	DB_TOO_BIG_RECORD,		/* a record in an index would not fit
54 55 56
					on a compressed page, or it would
					become bigger than 1/2 free space in
					an uncompressed page frame */
57 58
	DB_LOCK_WAIT_TIMEOUT,		/* lock wait lasted too long */
	DB_NO_REFERENCED_ROW,		/* referenced key value not found
osku's avatar
osku committed
59 60
					for a foreign key in an insert or
					update of a row */
61
	DB_ROW_IS_REFERENCED,		/* cannot delete or update a row
osku's avatar
osku committed
62 63
					because it contains a key value
					which is referenced */
64
	DB_CANNOT_ADD_CONSTRAINT,	/* adding a foreign key constraint
osku's avatar
osku committed
65
					to a table failed */
66 67
	DB_CORRUPTION,			/* data structure corruption noticed */
	DB_COL_APPEARS_TWICE_IN_INDEX,	/* InnoDB cannot handle an index
68
					where same column appears twice */
69
	DB_CANNOT_DROP_CONSTRAINT,	/* dropping a foreign key constraint
osku's avatar
osku committed
70
					from a table failed */
71
	DB_NO_SAVEPOINT,		/* no savepoint exists with the given
osku's avatar
osku committed
72
					name */
73
	DB_TABLESPACE_ALREADY_EXISTS,	/* we cannot create a new single-table
74
					tablespace because a file of the same
osku's avatar
osku committed
75
					name already exists */
76
	DB_TABLESPACE_DELETED,		/* tablespace does not exist or is
osku's avatar
osku committed
77
					being dropped right now */
78
	DB_LOCK_TABLE_FULL,		/* lock structs have exhausted the
osku's avatar
osku committed
79 80 81
					buffer pool (for big transactions,
					InnoDB stores the lock structs in the
					buffer pool) */
82
	DB_FOREIGN_DUPLICATE_KEY,	/* foreign key constraints
83 84 85
					activated by the operation would
					lead to a duplicate key in some
					table */
86
	DB_TOO_MANY_CONCURRENT_TRXS,	/* when InnoDB runs out of the
87 88 89
					preconfigured undo slots, this can
					only happen when there are too many
					concurrent transactions */
90
	DB_UNSUPPORTED,			/* when InnoDB sees any artefact or
91 92 93 94
					a feature that it can't recoginize or
					work with e.g., FT indexes created by
					a later version of the engine. */

95 96 97
	DB_PRIMARY_KEY_IS_NULL,		/* a column in the PRIMARY KEY
					was found to be NULL */

vdimov's avatar
vdimov committed
98 99 100 101 102 103
	DB_STATS_DO_NOT_EXIST,		/* an operation that requires the
					persistent storage, used for recording
					table and index statistics, was
					requested but this storage does not
					exist itself or the stats for a given
					table do not exist */
104 105 106
	DB_FOREIGN_EXCEED_MAX_CASCADE,	/* Foreign key constraint related
					cascading delete/update exceeds
					maximum allowed depth */
107 108 109 110 111 112
	DB_CHILD_NO_INDEX,		/* the child (foreign) table does not
					have an index that contains the
					foreign keys as its prefix columns */
	DB_PARENT_NO_INDEX,		/* the parent table does not
					have an index that contains the
					foreign keys as its prefix columns */
vdimov's avatar
vdimov committed
113

114
	/* The following are partial failure codes */
115
	DB_FAIL = 1000,
116 117 118 119
	DB_OVERFLOW,
	DB_UNDERFLOW,
	DB_STRONG_FAIL,
	DB_ZIP_OVERFLOW,
120
	DB_RECORD_NOT_FOUND = 1500,
121 122
	DB_END_OF_INDEX
};
osku's avatar
osku committed
123

124
#endif