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

Function my_error_unregister

mysys/my_error.c:357–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355*/
356
357const char **my_error_unregister(int first, int last)
358{
359 struct my_err_head *meh_p;
360 struct my_err_head **search_meh_pp;
361 const char **errmsgs;
362
363 /* Search for the registration in the list. */
364 for (search_meh_pp= &my_errmsgs_list;
365 *search_meh_pp;
366 search_meh_pp= &(*search_meh_pp)->meh_next)
367 {
368 if (((*search_meh_pp)->meh_first == first) &&
369 ((*search_meh_pp)->meh_last == last))
370 break;
371 }
372 if (! *search_meh_pp)
373 return NULL;
374
375 /* Remove header from the chain. */
376 meh_p= *search_meh_pp;
377 *search_meh_pp= meh_p->meh_next;
378
379 /* Save the return value and free the header. */
380 errmsgs= meh_p->get_errmsgs();
381 my_free(meh_p);
382
383 return errmsgs;
384}
385
386
387/**

Callers 3

clean_upFunction · 0.85
init_errmessageFunction · 0.85

Calls 1

my_freeFunction · 0.85

Tested by

no test coverage detected