mariadb/storage/xtradb/include/db0err.h

169 lines
6.1 KiB
C
Raw Normal View History

2009-03-25 23:11:11 -07:00
/*****************************************************************************
2015-05-04 22:17:04 +02:00
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2015, MariaDB Corporation.
2009-03-25 23:11:11 -07:00
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.,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
2009-03-25 23:11:11 -07:00
*****************************************************************************/
2009-09-07 10:22:53 +00:00
/**************************************************//**
@file include/db0err.h
Global error codes for the database
Created 5/24/1996 Heikki Tuuri
*******************************************************/
#ifndef db0err_h
#define db0err_h
2013-12-16 15:38:05 +01:00
enum dberr_t {
DB_SUCCESS_LOCKED_REC = 9, /*!< like DB_SUCCESS, but a new
explicit record lock was created */
DB_SUCCESS = 10,
/* The following are error codes */
DB_ERROR,
2010-01-06 04:00:14 -08:00
DB_INTERRUPTED,
DB_OUT_OF_MEMORY,
DB_OUT_OF_FILE_SPACE,
DB_LOCK_WAIT,
DB_DEADLOCK,
DB_ROLLBACK,
DB_DUPLICATE_KEY,
DB_QUE_THR_SUSPENDED,
2013-12-16 15:38:05 +01:00
DB_MISSING_HISTORY, /*!< required history data has been
deleted due to lack of space in
rollback segment */
DB_CLUSTER_NOT_FOUND = 30,
DB_TABLE_NOT_FOUND,
2013-12-16 15:38:05 +01:00
DB_MUST_GET_MORE_FILE_SPACE, /*!< the database has to be stopped
and restarted with more file space */
DB_TABLE_IS_BEING_USED,
2013-12-16 15:38:05 +01:00
DB_TOO_BIG_RECORD, /*!< a record in an index would not fit
on a compressed page, or it would
become bigger than 1/2 free space in
an uncompressed page frame */
2013-12-16 15:38:05 +01:00
DB_LOCK_WAIT_TIMEOUT, /*!< lock wait lasted too long */
DB_NO_REFERENCED_ROW, /*!< referenced key value not found
for a foreign key in an insert or
update of a row */
2013-12-16 15:38:05 +01:00
DB_ROW_IS_REFERENCED, /*!< cannot delete or update a row
because it contains a key value
which is referenced */
2013-12-16 15:38:05 +01:00
DB_CANNOT_ADD_CONSTRAINT, /*!< adding a foreign key constraint
to a table failed */
2013-12-16 15:38:05 +01:00
DB_CORRUPTION, /*!< data structure corruption noticed */
DB_CANNOT_DROP_CONSTRAINT, /*!< dropping a foreign key constraint
from a table failed */
2013-12-16 15:38:05 +01:00
DB_NO_SAVEPOINT, /*!< no savepoint exists with the given
name */
2013-12-16 15:38:05 +01:00
DB_TABLESPACE_EXISTS, /*!< we cannot create a new single-table
tablespace because a file of the same
name already exists */
2013-12-16 15:38:05 +01:00
DB_TABLESPACE_DELETED, /*!< tablespace was deleted or is
being dropped right now */
2013-12-16 15:38:05 +01:00
DB_TABLESPACE_NOT_FOUND, /*<! Attempt to delete a tablespace
instance that was not found in the
tablespace hash table */
DB_LOCK_TABLE_FULL, /*!< lock structs have exhausted the
buffer pool (for big transactions,
InnoDB stores the lock structs in the
buffer pool) */
2013-12-16 15:38:05 +01:00
DB_FOREIGN_DUPLICATE_KEY, /*!< foreign key constraints
activated by the operation would
lead to a duplicate key in some
table */
2013-12-16 15:38:05 +01:00
DB_TOO_MANY_CONCURRENT_TRXS, /*!< when InnoDB runs out of the
preconfigured undo slots, this can
only happen when there are too many
concurrent transactions */
2013-12-16 15:38:05 +01:00
DB_UNSUPPORTED, /*!< when InnoDB sees any artefact or
a feature that it can't recoginize or
work with e.g., FT indexes created by
a later version of the engine. */
2013-12-16 15:38:05 +01:00
DB_INVALID_NULL, /*!< a NOT NULL column was found to
be NULL during table rebuild */
2011-07-14 21:22:41 +02:00
2013-12-16 15:38:05 +01:00
DB_STATS_DO_NOT_EXIST, /*!< an operation that requires the
2011-07-14 21:22:41 +02:00
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 */
2013-12-16 15:38:05 +01:00
DB_FOREIGN_EXCEED_MAX_CASCADE, /*!< Foreign key constraint related
cascading delete/update exceeds
maximum allowed depth */
2013-12-16 15:38:05 +01:00
DB_CHILD_NO_INDEX, /*!< the child (foreign) table does
not have an index that contains the
2011-07-14 21:22:41 +02:00
foreign keys as its prefix columns */
2013-12-16 15:38:05 +01:00
DB_PARENT_NO_INDEX, /*!< the parent table does not
2011-07-14 21:22:41 +02:00
have an index that contains the
foreign keys as its prefix columns */
2013-12-16 15:38:05 +01:00
DB_TOO_BIG_INDEX_COL, /*!< index column size exceeds
maximum limit */
DB_INDEX_CORRUPT, /*!< we have corrupted index */
DB_UNDO_RECORD_TOO_BIG, /*!< the undo log record is too big */
DB_READ_ONLY, /*!< Update operation attempted in
a read-only transaction */
DB_FTS_INVALID_DOCID, /* FTS Doc ID cannot be zero */
DB_TABLE_IN_FK_CHECK, /* table is being used in foreign
key check */
2013-12-16 15:38:05 +01:00
DB_ONLINE_LOG_TOO_BIG, /*!< Modification log grew too big
during online index creation */
DB_IO_ERROR, /*!< Generic IO error */
DB_IDENTIFIER_TOO_LONG, /*!< Identifier name too long */
DB_FTS_EXCEED_RESULT_CACHE_LIMIT, /*!< FTS query memory
exceeds result cache limit */
2014-02-26 16:25:11 +01:00
DB_TEMP_FILE_WRITE_FAILURE, /*!< Temp file write failure */
2014-05-06 21:18:00 +02:00
DB_FTS_TOO_MANY_WORDS_IN_PHRASE,
/*< Too many words in a phrase */
2015-05-04 22:17:04 +02:00
DB_TOO_BIG_FOR_REDO, /* Record length greater than 10%
of redo log */
DB_DECRYPTION_FAILED, /* Tablespace encrypted and
decrypt operation failed because
of missing key management plugin,
or missing or incorrect key or
incorret AES method or algorithm. */
/* The following are partial failure codes */
DB_FAIL = 1000,
DB_OVERFLOW,
DB_UNDERFLOW,
DB_STRONG_FAIL,
DB_ZIP_OVERFLOW,
DB_RECORD_NOT_FOUND = 1500,
Fix for lp:711565 "Index Condition Pushdown can make a thread hold MyISAM locks as well as be unKILLable for long time" - In Maria/MyISAM: Release/re-acquire locks to give queries that wait on them a chance to make progress - In Maria/MyISAM: Change from numeric constants to ICP_RES values. - In Maria: Do check index condition in maria_rprev() (was lost in the merge/backport?) - In Maria/MyISAM/XtraDB: Check if the query was killed, and return immediately if it was. Added new storage engine error: HA_ERR_ABORTED_BY_USER, for handler to signal that it detected a kill of the query and aborted Authors: Sergey Petrunia & Monty include/my_base.h: Added HA_ERR_ABORTED_BY_USER, for handler to signal that it detected a kill of the query and aborted include/my_handler.h: Added comment mysql-test/r/myisam_icp.result: Updated test mysql-test/t/myisam_icp.test: Drop used tables at start of test Added test case that can help with manual testing of killing index condition pushdown query. mysys/my_handler_errors.h: Text for new storage engine error sql/handler.cc: If engine got HA_ERR_ABORTED_BY_USER, send kill message. sql/multi_range_read.cc: Return error code storage/maria/ha_maria.cc: Added ma_killed_in_mariadb() to detect kill. Ensure that file->external_ref points to TABLE object. storage/maria/ma_extra.c: Dummy test-if-killed for standalone storage/maria/ma_key.c: If ma_check_index_cond() fails, set my_errno and info->cur_row.lastpos storage/maria/ma_rkey.c: Release/re-acquire locks to give queries that wait on them a chance to make progress Check if the query was killed, and return immediately if it was storage/maria/ma_rnext.c: Check if the query was killed, and return immediately if it was Added missing fast_ma_writeinfo(info) storage/maria/ma_rnext_same.c: Check if the query was killed, and return immediately if it was Added missing fast_ma_writeinfo(info) storage/maria/ma_rprev.c: Check if the query was killed, and return immediately if it was Added missing fast_ma_writeinfo(info) and ma_check_index_cond() storage/maria/ma_search.c: Give error message if we find a wrong key storage/maria/ma_static.c: Added pointer to test-if-killed function storage/maria/maria_def.h: New prototypes storage/myisam/ha_myisam.cc: Added mi_killed_in_mariadb() Ensure that file->external_ref points to TABLE object. storage/myisam/mi_extra.c: Dummy test-if-killed for standalone storage/myisam/mi_key.c: If ma_check_index_cond() fails, set my_errno and info->lastpos storage/myisam/mi_rkey.c: Ensure that info->lastpos= HA_OFFSET_ERROR in case of error Release/re-acquire locks to give queries that wait on them a chance to make progress Check if the query was killed, and return immediately if it was Reorder code to do less things in case of error. Added missing fast_mi_writeinfo() storage/myisam/mi_rnext.c: Check if the query was killed, and return immediately if it was Simplify old ICP code Added missing fast_ma_writeinfo(info) storage/myisam/mi_rnext_same.c: Check if the query was killed, and return immediately if it was Added missing fast_mi_writeinfo(info) storage/myisam/mi_rprev.c: Check if the query was killed, and return immediately if it was Simplify error handling of ICP Added missing fast_mi_writeinfo(info) storage/myisam/mi_search.c: Give error message if we find a wrong key storage/myisam/mi_static.c: Added pointer to test-if-killed function storage/myisam/myisamdef.h: New prototypes storage/xtradb/handler/ha_innodb.cc: Added DB_SEARCH_ABORTED_BY_USER and ha_innobase::is_thd_killed() Check if the query was killed, and return immediately if it was storage/xtradb/handler/ha_innodb.h: Added prototype storage/xtradb/include/db0err.h: Added DB_SEARCH_ABORTED_BY_USER storage/xtradb/include/row0mysql.h: Added possible ICP errors storage/xtradb/row/row0sel.c: Use ICP errors instead of constants. Detect if killed and return B_SEARCH_ABORTED_BY_USER
2011-02-18 17:43:59 +02:00
DB_END_OF_INDEX,
2013-12-16 15:38:05 +01:00
DB_DICT_CHANGED, /*!< Some part of table dictionary has
changed. Such as index dropped or
foreign key dropped */
DB_SEARCH_ABORTED_BY_USER= 1533,
2013-12-16 15:38:05 +01:00
/* The following are API only error codes. */
DB_DATA_MISMATCH = 2000, /*!< Column update or read failed
because the types mismatch */
DB_SCHEMA_NOT_LOCKED, /*!< If an API function expects the
schema to be locked in exclusive mode
and if it's not then that API function
will return this error code */
DB_NOT_FOUND /*!< Generic error code for "Not found"
type of errors */
};
#endif