MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / ha_init_errors

Function ha_init_errors

sql/handler.cc:196–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194 return handler_errmsgs;
195}
196C_MODE_END
197
198
199/**
200 Register handler error messages for use with my_error().
201
202 @retval
203 0 OK
204 @retval
205 !=0 Error
206*/
207
208int ha_init_errors(void)
209{
210#define SETMSG(nr, msg) handler_errmsgs[(nr) - HA_ERR_FIRST]= (msg)
211
212 /* Allocate a pointer array for the error message strings. */
213 /* Zerofill it to avoid uninitialized gaps. */
214 if (! (handler_errmsgs= (const char**) my_malloc(HA_ERR_ERRORS * sizeof(char*),
215 MYF(MY_WME | MY_ZEROFILL))))
216 return 1;
217
218 /* Set the dedicated error messages. */
219 SETMSG(HA_ERR_KEY_NOT_FOUND, ER_DEFAULT(ER_KEY_NOT_FOUND));
220 SETMSG(HA_ERR_FOUND_DUPP_KEY, ER_DEFAULT(ER_DUP_KEY));
221 SETMSG(HA_ERR_RECORD_CHANGED, "Update wich is recoverable");
222 SETMSG(HA_ERR_WRONG_INDEX, "Wrong index given to function");
223 SETMSG(HA_ERR_CRASHED, ER_DEFAULT(ER_NOT_KEYFILE));
224 SETMSG(HA_ERR_WRONG_IN_RECORD, ER_DEFAULT(ER_CRASHED_ON_USAGE));
225 SETMSG(HA_ERR_OUT_OF_MEM, "Table handler out of memory");
226 SETMSG(HA_ERR_NOT_A_TABLE, "Incorrect file format '%.64s'");
227 SETMSG(HA_ERR_WRONG_COMMAND, "Command not supported");
228 SETMSG(HA_ERR_OLD_FILE, ER_DEFAULT(ER_OLD_KEYFILE));
229 SETMSG(HA_ERR_NO_ACTIVE_RECORD, "No record read in update");
230 SETMSG(HA_ERR_RECORD_DELETED, "Intern record deleted");
231 SETMSG(HA_ERR_RECORD_FILE_FULL, ER_DEFAULT(ER_RECORD_FILE_FULL));
232 SETMSG(HA_ERR_INDEX_FILE_FULL, "No more room in index file '%.64s'");
233 SETMSG(HA_ERR_END_OF_FILE, "End in next/prev/first/last");
234 SETMSG(HA_ERR_UNSUPPORTED, ER_DEFAULT(ER_ILLEGAL_HA));
235 SETMSG(HA_ERR_TO_BIG_ROW, "Too big row");
236 SETMSG(HA_WRONG_CREATE_OPTION, "Wrong create option");
237 SETMSG(HA_ERR_FOUND_DUPP_UNIQUE, ER_DEFAULT(ER_DUP_UNIQUE));
238 SETMSG(HA_ERR_UNKNOWN_CHARSET, "Can't open charset");
239 SETMSG(HA_ERR_WRONG_MRG_TABLE_DEF, ER_DEFAULT(ER_WRONG_MRG_TABLE));
240 SETMSG(HA_ERR_CRASHED_ON_REPAIR, ER_DEFAULT(ER_CRASHED_ON_REPAIR));
241 SETMSG(HA_ERR_CRASHED_ON_USAGE, ER_DEFAULT(ER_CRASHED_ON_USAGE));
242 SETMSG(HA_ERR_LOCK_WAIT_TIMEOUT, ER_DEFAULT(ER_LOCK_WAIT_TIMEOUT));
243 SETMSG(HA_ERR_LOCK_TABLE_FULL, ER_DEFAULT(ER_LOCK_TABLE_FULL));
244 SETMSG(HA_ERR_READ_ONLY_TRANSACTION, ER_DEFAULT(ER_READ_ONLY_TRANSACTION));
245 SETMSG(HA_ERR_LOCK_DEADLOCK, ER_DEFAULT(ER_LOCK_DEADLOCK));
246 SETMSG(HA_ERR_CANNOT_ADD_FOREIGN, ER_DEFAULT(ER_CANNOT_ADD_FOREIGN));
247 SETMSG(HA_ERR_NO_REFERENCED_ROW, ER_DEFAULT(ER_NO_REFERENCED_ROW_2));
248 SETMSG(HA_ERR_ROW_IS_REFERENCED, ER_DEFAULT(ER_ROW_IS_REFERENCED_2));
249 SETMSG(HA_ERR_NO_SAVEPOINT, "No savepoint with that name");
250 SETMSG(HA_ERR_NON_UNIQUE_BLOCK_SIZE, "Non unique key block size");
251 SETMSG(HA_ERR_NO_SUCH_TABLE, "No such table: '%.64s'");
252 SETMSG(HA_ERR_TABLE_EXIST, ER_DEFAULT(ER_TABLE_EXISTS_ERROR));
253 SETMSG(HA_ERR_NO_CONNECTION, "Could not connect to storage engine");

Callers

nothing calls this directly

Calls 2

my_mallocFunction · 0.85
my_error_registerFunction · 0.85

Tested by

no test coverage detected