13
13
along with this program; if not, write to the Free Software
14
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
/* Return error-text for system error messages and nisam messages */
16
/* Return error-text for system error messages and handler messages */
18
#define PERROR_VERSION "2.10"
18
#define PERROR_VERSION "2.11"
20
20
#include <my_global.h>
21
21
#include <my_sys.h>
83
87
static HA_ERRORS ha_errlist[]=
85
{ 120,"Didn't find key on read or update" },
86
{ 121,"Duplicate key on write or update" },
87
{ 123,"Someone has changed the row since it was read (while the table was locked to prevent it)" },
88
{ 124,"Wrong index given to function" },
89
{ 126,"Index file is crashed" },
90
{ 127,"Record-file is crashed" },
91
{ 128,"Out of memory" },
92
{ 130,"Incorrect file format" },
93
{ 131,"Command not supported by database" },
94
{ 132,"Old database file" },
95
{ 133,"No record read before update" },
96
{ 134,"Record was already deleted (or record file crashed)" },
97
{ 135,"No more room in record file" },
98
{ 136,"No more room in index file" },
99
{ 137,"No more records (read after end of file)" },
100
{ 138,"Unsupported extension used for table" },
101
{ 139,"Too big row"},
102
{ 140,"Wrong create options"},
103
{ 141,"Duplicate unique key or constraint on write or update"},
104
{ 142,"Unknown character set used"},
105
{ 143,"Conflicting table definitions in sub-tables of MERGE table"},
106
{ 144,"Table is crashed and last repair failed"},
107
{ 145,"Table was marked as crashed and should be repaired"},
108
{ 146,"Lock timed out; Retry transaction"},
109
{ 147,"Lock table is full; Restart program with a larger locktable"},
110
{ 148,"Updates are not allowed under a read only transactions"},
111
{ 149,"Lock deadlock; Retry transaction"},
112
{ 150,"Foreign key constraint is incorrectly formed"},
113
{ 151,"Cannot add a child row"},
114
{ 152,"Cannot delete a parent row"},
115
89
{ -30999, "DB_INCOMPLETE: Sync didn't finish"},
116
90
{ -30998, "DB_KEYEMPTY: Key/data deleted or never created"},
117
91
{ -30997, "DB_KEYEXIST: The key/data pair already exists"},
194
168
HA_ERRORS *ha_err_ptr;
171
If you got compilation error here about compile_time_assert array, check
172
that every HA_ERR_xxx constant has a corresponding error message in
173
handler_error_messages[] list (check mysys/ma_handler_errors.h and
176
compile_time_assert(HA_ERR_FIRST + array_elements(handler_error_messages) ==
178
if (code >= HA_ERR_FIRST && code <= HA_ERR_LAST)
179
return handler_error_messages[code - HA_ERR_FIRST];
196
181
for (ha_err_ptr=ha_errlist ; ha_err_ptr->errcode ;ha_err_ptr++)
197
182
if (ha_err_ptr->errcode == code)
198
183
return ha_err_ptr->msg;
290
277
(const uchar*) "Unknown Error", 13) &&
291
278
(!unknown_error || strcmp(msg, unknown_error)))
295
printf("OS error code %3d: %s\n",code,msg);
282
printf("OS error code %3d: %s\n", code, msg);
286
if ((msg= get_ha_error_msg(code)))
290
printf("MySQL error code %3d: %s\n", code, msg);
302
/* Error message still not found, look in handler error codes */
303
if (!(msg=get_ha_error_msg(code)))
305
fprintf(stderr,"Illegal error code: %d\n",code);
312
printf("MySQL error code %3d: %s\n",code,msg);
296
fprintf(stderr,"Illegal error code: %d\n", code);