mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Added HA_ERR_DISK_FULL handler error
Original code by Zardosht Kasheff sql/handler.cc: Added HA_ERR_DISK_FULL and ENOSPC (for handler that uses normal errno). This sets 'fatal_error' to ensure that the error is logged to err file (which hopefully is on another disk...)
This commit is contained in:
@ -446,7 +446,8 @@ enum ha_base_keytype {
|
||||
#define HA_ERR_ROW_NOT_VISIBLE 177
|
||||
#define HA_ERR_TOO_MANY_CONCURRENT_TRXS 178 /*Too many active concurrent transactions */
|
||||
#define HA_ERR_ABORTED_BY_USER 179
|
||||
#define HA_ERR_LAST 179 /* Copy of last error nr */
|
||||
#define HA_ERR_DISK_FULL 180
|
||||
#define HA_ERR_LAST 180 /* Copy of last error nr */
|
||||
|
||||
/* Number of different errors */
|
||||
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
|
||||
|
@ -64,5 +64,6 @@ static const char *handler_error_messages[]=
|
||||
"Read page with wrong checksum",
|
||||
"Too many active concurrent transactions",
|
||||
"Row is not visible by the current transaction",
|
||||
"Operation was interrupted by end user (probably kill command?)"
|
||||
"Operation was interrupted by end user (probably kill command?)",
|
||||
"Disk full"
|
||||
};
|
||||
|
@ -345,6 +345,7 @@ int ha_init_errors(void)
|
||||
SETMSG(HA_ERR_AUTOINC_READ_FAILED, ER(ER_AUTOINC_READ_FAILED));
|
||||
SETMSG(HA_ERR_AUTOINC_ERANGE, ER(ER_WARN_DATA_OUT_OF_RANGE));
|
||||
SETMSG(HA_ERR_TOO_MANY_CONCURRENT_TRXS, ER(ER_TOO_MANY_CONCURRENT_TRXS));
|
||||
SETMSG(HA_ERR_DISK_FULL, ER(ER_DISK_FULL));
|
||||
|
||||
/* Register the error messages for use with my_error(). */
|
||||
return my_error_register(errmsgs, HA_ERR_FIRST, HA_ERR_LAST);
|
||||
@ -2759,6 +2760,11 @@ void handler::print_error(int error, myf errflag)
|
||||
case ENOENT:
|
||||
textno=ER_FILE_NOT_FOUND;
|
||||
break;
|
||||
case ENOSPC:
|
||||
case HA_ERR_DISK_FULL:
|
||||
textno= ER_DISK_FULL;
|
||||
SET_FATAL_ERROR; // Ensure error is logged
|
||||
break;
|
||||
case HA_ERR_KEY_NOT_FOUND:
|
||||
case HA_ERR_NO_ACTIVE_RECORD:
|
||||
case HA_ERR_END_OF_FILE:
|
||||
|
Reference in New Issue
Block a user