320 #if defined(ENABLED_DEBUG_SYNC)
330 #include "sql_parse.h"
342 struct st_debug_sync_action
344 ulong activation_count;
355 struct st_debug_sync_control
357 st_debug_sync_action *ds_action;
361 ulonglong dsp_executed;
362 ulonglong dsp_max_active;
367 char ds_proc_info[80];
377 struct st_debug_sync_globals
383 ulonglong dsp_executed;
384 ulonglong dsp_max_active;
386 static st_debug_sync_globals debug_sync_global;
391 extern "C" void (*debug_sync_C_callback_ptr)(
const char *, size_t);
397 static void debug_sync_C_callback(
const char *,
size_t);
398 static int debug_sync_qsort_cmp(
const void *,
const void *);
432 static void debug_sync_C_callback(
const char *sync_point_name,
435 if (unlikely(opt_debug_sync_timeout))
436 debug_sync(current_thd, sync_point_name, name_len);
439 #ifdef HAVE_PSI_INTERFACE
440 static PSI_mutex_key key_debug_sync_globals_ds_mutex;
442 static PSI_mutex_info all_debug_sync_mutexes[]=
444 { &key_debug_sync_globals_ds_mutex,
"DEBUG_SYNC::mutex", PSI_FLAG_GLOBAL}
447 static PSI_cond_key key_debug_sync_globals_ds_cond;
449 static PSI_cond_info all_debug_sync_conds[]=
451 { &key_debug_sync_globals_ds_cond,
"DEBUG_SYNC::cond", PSI_FLAG_GLOBAL}
454 static void init_debug_sync_psi_keys(
void)
456 const char* category=
"sql";
459 count= array_elements(all_debug_sync_mutexes);
462 count= array_elements(all_debug_sync_conds);
476 int debug_sync_init(
void)
478 DBUG_ENTER(
"debug_sync_init");
480 #ifdef HAVE_PSI_INTERFACE
481 init_debug_sync_psi_keys();
484 if (opt_debug_sync_timeout)
489 debug_sync_global.ds_signal.length(0);
491 &debug_sync_global.ds_cond, NULL)) ||
493 &debug_sync_global.ds_mutex,
494 MY_MUTEX_INIT_FAST)))
498 debug_sync_C_callback_ptr= debug_sync_C_callback;
512 void debug_sync_end(
void)
514 DBUG_ENTER(
"debug_sync_end");
517 if (debug_sync_C_callback_ptr)
520 debug_sync_C_callback_ptr= NULL;
523 debug_sync_global.ds_signal.free();
530 sql_print_information(
"Debug sync points hit: %22s",
531 llstr(debug_sync_global.dsp_hits, llbuff));
532 sql_print_information(
"Debug sync points executed: %22s",
533 llstr(debug_sync_global.dsp_executed, llbuff));
534 sql_print_information(
"Debug sync points max active per thread: %22s",
535 llstr(debug_sync_global.dsp_max_active, llbuff));
553 static void debug_sync_emergency_disable(
void)
555 DBUG_ENTER(
"debug_sync_emergency_disable");
557 opt_debug_sync_timeout= 0;
559 DBUG_PRINT(
"debug_sync",
560 (
"Debug Sync Facility disabled due to lack of memory."));
561 sql_print_error(
"Debug Sync Facility disabled due to lack of memory.");
575 void debug_sync_init_thread(THD *thd)
577 DBUG_ENTER(
"debug_sync_init_thread");
580 if (opt_debug_sync_timeout)
582 thd->debug_sync_control= (st_debug_sync_control*)
583 my_malloc(
sizeof(st_debug_sync_control), MYF(MY_WME | MY_ZEROFILL));
584 if (!thd->debug_sync_control)
590 debug_sync_emergency_disable();
604 void debug_sync_end_thread(THD *thd)
606 DBUG_ENTER(
"debug_sync_end_thread");
609 if (thd->debug_sync_control)
611 st_debug_sync_control *ds_control= thd->debug_sync_control;
617 DEBUG_SYNC(thd,
"thread_end");
619 if (ds_control->ds_action)
621 st_debug_sync_action *action= ds_control->ds_action;
622 st_debug_sync_action *action_end= action + ds_control->ds_allocated;
623 for (; action < action_end; action++)
625 action->signal.free();
626 action->wait_for.free();
627 action->sync_point.free();
629 my_free(ds_control->ds_action);
634 debug_sync_global.dsp_hits+= ds_control->dsp_hits;
635 debug_sync_global.dsp_executed+= ds_control->dsp_executed;
636 if (debug_sync_global.dsp_max_active < ds_control->dsp_max_active)
637 debug_sync_global.dsp_max_active= ds_control->dsp_max_active;
641 thd->debug_sync_control= NULL;
659 static char *debug_sync_bmove_len(
char *
to,
char *to_end,
660 const char *from,
size_t length)
664 DBUG_ASSERT(!length || from);
665 set_if_smaller(length, (
size_t) (to_end - to));
666 memcpy(to, from, length);
667 return (to + length);
671 #if !defined(DBUG_OFF)
681 static void debug_sync_action_string(
char *result, uint
size,
682 st_debug_sync_action *action)
685 char *wend= wtxt + size - 1;
690 DBUG_ASSERT(!action->execute ||
691 action->signal.length() || action->wait_for.length());
695 if (action->signal.length())
697 wtxt= debug_sync_bmove_len(wtxt, wend, STRING_WITH_LEN(
"SIGNAL "));
698 wtxt= debug_sync_bmove_len(wtxt, wend, action->signal.ptr(),
699 action->signal.length());
701 if (action->wait_for.length())
703 if ((wtxt == result) && (wtxt < wend))
705 wtxt= debug_sync_bmove_len(wtxt, wend, STRING_WITH_LEN(
" WAIT_FOR "));
706 wtxt= debug_sync_bmove_len(wtxt, wend, action->wait_for.ptr(),
707 action->wait_for.length());
709 if (action->timeout != opt_debug_sync_timeout)
711 wtxt+= my_snprintf(wtxt, wend - wtxt,
" TIMEOUT %lu", action->timeout);
714 if (action->execute != 1)
716 wtxt+= my_snprintf(wtxt, wend - wtxt,
" EXECUTE %lu", action->execute);
719 if (action->hit_limit)
721 wtxt+= my_snprintf(wtxt, wend - wtxt,
"%sHIT_LIMIT %lu",
722 (wtxt == result) ?
"" :
" ", action->hit_limit);
739 static void debug_sync_print_actions(THD *thd)
741 st_debug_sync_control *ds_control= thd->debug_sync_control;
743 DBUG_ENTER(
"debug_sync_print_actions");
749 for (idx= 0; idx < ds_control->ds_active; idx++)
751 const char *dsp_name= ds_control->ds_action[idx].sync_point.c_ptr();
752 char action_string[256];
754 debug_sync_action_string(action_string,
sizeof(action_string),
755 ds_control->ds_action + idx);
756 DBUG_PRINT(
"debug_sync_list", (
"%s %s", dsp_name, action_string));
777 static int debug_sync_qsort_cmp(
const void* arg1,
const void* arg2)
779 st_debug_sync_action *action1= (st_debug_sync_action*) arg1;
780 st_debug_sync_action *action2= (st_debug_sync_action*) arg2;
782 DBUG_ASSERT(action1);
783 DBUG_ASSERT(action2);
785 if (!(diff= action1->sync_point.length() - action2->sync_point.length()))
786 diff= memcmp(action1->sync_point.ptr(), action2->sync_point.ptr(),
787 action1->sync_point.length());
809 static st_debug_sync_action *debug_sync_find(st_debug_sync_action *actionarr,
811 const char *dsp_name,
814 st_debug_sync_action *action;
819 DBUG_ASSERT(actionarr);
820 DBUG_ASSERT(dsp_name);
821 DBUG_ASSERT(name_len);
828 mid= (low + high) / 2;
829 action= actionarr + mid;
830 if (!(diff= name_len - action->sync_point.length()) &&
831 !(diff= memcmp(dsp_name, action->sync_point.ptr(), name_len)))
841 action= actionarr + low;
842 if ((name_len == action->sync_point.length()) &&
843 !memcmp(dsp_name, action->sync_point.ptr(), name_len))
861 static void debug_sync_reset(THD *thd)
863 st_debug_sync_control *ds_control= thd->debug_sync_control;
864 DBUG_ENTER(
"debug_sync_reset");
866 DBUG_ASSERT(ds_control);
869 ds_control->ds_active= 0;
873 debug_sync_global.ds_signal.length(0);
893 static void debug_sync_remove_action(st_debug_sync_control *ds_control,
894 st_debug_sync_action *action)
896 uint dsp_idx= action - ds_control->ds_action;
897 DBUG_ENTER(
"debug_sync_remove_action");
898 DBUG_ASSERT(ds_control);
899 DBUG_ASSERT(ds_control == current_thd->debug_sync_control);
901 DBUG_ASSERT(dsp_idx < ds_control->ds_active);
904 ds_control->ds_active--;
912 if (ds_control->ds_active > dsp_idx)
918 uchar save_action[
sizeof(st_debug_sync_action)];
928 memmove(save_action, action,
sizeof(st_debug_sync_action));
931 memmove(ds_control->ds_action + dsp_idx,
932 ds_control->ds_action + dsp_idx + 1,
933 (ds_control->ds_active - dsp_idx) *
934 sizeof(st_debug_sync_action));
942 memmove(ds_control->ds_action + ds_control->ds_active, save_action,
943 sizeof(st_debug_sync_action));
965 static st_debug_sync_action *debug_sync_get_action(THD *thd,
966 const char *dsp_name,
969 st_debug_sync_control *ds_control= thd->debug_sync_control;
970 st_debug_sync_action *action;
971 DBUG_ENTER(
"debug_sync_get_action");
973 DBUG_ASSERT(dsp_name);
974 DBUG_ASSERT(name_len);
975 DBUG_ASSERT(ds_control);
976 DBUG_PRINT(
"debug_sync", (
"sync_point: '%.*s'", (
int) name_len, dsp_name));
977 DBUG_PRINT(
"debug_sync", (
"active: %u allocated: %u",
978 ds_control->ds_active, ds_control->ds_allocated));
981 DBUG_ASSERT(ds_control->ds_active <= ds_control->ds_allocated);
983 DBUG_ASSERT(!ds_control->ds_active || ds_control->ds_action);
986 if (ds_control->ds_active &&
987 (action= debug_sync_find(ds_control->ds_action, ds_control->ds_active,
988 dsp_name, name_len)))
991 DBUG_ASSERT((uint)(action - ds_control->ds_action) < ds_control->ds_active);
992 DBUG_PRINT(
"debug_sync", (
"reuse action idx: %ld",
993 (
long) (action - ds_control->ds_action)));
998 int dsp_idx= ds_control->ds_active++;
999 set_if_bigger(ds_control->dsp_max_active, ds_control->ds_active);
1000 if (ds_control->ds_active > ds_control->ds_allocated)
1002 uint new_alloc= ds_control->ds_active + 3;
1003 void *new_action= my_realloc(ds_control->ds_action,
1004 new_alloc *
sizeof(st_debug_sync_action),
1005 MYF(MY_WME | MY_ALLOW_ZERO_PTR));
1011 ds_control->ds_action= (st_debug_sync_action*) new_action;
1012 ds_control->ds_allocated= new_alloc;
1014 memset((ds_control->ds_action + dsp_idx), 0,
1015 (new_alloc - dsp_idx) *
sizeof(st_debug_sync_action));
1017 DBUG_PRINT(
"debug_sync", (
"added action idx: %u", dsp_idx));
1018 action= ds_control->ds_action + dsp_idx;
1019 if (action->sync_point.copy(dsp_name, name_len, system_charset_info))
1024 action->need_sort= TRUE;
1026 DBUG_ASSERT(action >= ds_control->ds_action);
1027 DBUG_ASSERT(action < ds_control->ds_action + ds_control->ds_active);
1028 DBUG_PRINT(
"debug_sync", (
"action: 0x%lx array: 0x%lx count: %u",
1029 (
long) action, (
long) ds_control->ds_action,
1030 ds_control->ds_active));
1032 DBUG_RETURN(action);
1075 static bool debug_sync_set_action(THD *thd, st_debug_sync_action *action)
1077 st_debug_sync_control *ds_control= thd->debug_sync_control;
1078 bool is_dsp_now= FALSE;
1079 DBUG_ENTER(
"debug_sync_set_action");
1081 DBUG_ASSERT(action);
1082 DBUG_ASSERT(ds_control);
1084 action->activation_count= max(action->hit_limit, action->execute);
1085 if (!action->activation_count)
1087 debug_sync_remove_action(ds_control, action);
1088 DBUG_PRINT(
"debug_sync", (
"action cleared"));
1092 const char *dsp_name= action->sync_point.c_ptr();
1093 DBUG_EXECUTE(
"debug_sync", {
1095 const char *sig_emit= action->signal.c_ptr();
1096 const char *sig_wait= action->wait_for.c_ptr();
1097 DBUG_PRINT(
"debug_sync",
1098 (
"sync_point: '%s' activation_count: %lu hit_limit: %lu "
1099 "execute: %lu timeout: %lu signal: '%s' wait_for: '%s'",
1100 dsp_name, action->activation_count,
1101 action->hit_limit, action->execute, action->timeout,
1102 sig_emit, sig_wait));});
1105 is_dsp_now= !my_strcasecmp(system_charset_info, dsp_name,
"now");
1107 if (action->need_sort)
1109 action->need_sort= FALSE;
1111 my_qsort(ds_control->ds_action, ds_control->ds_active,
1112 sizeof(st_debug_sync_action), debug_sync_qsort_cmp);
1115 DBUG_EXECUTE(
"debug_sync_list", debug_sync_print_actions(thd););
1120 DEBUG_SYNC(thd,
"now");
1137 if (thd->is_error())
1194 static char *debug_sync_token(
char **token_p, uint *token_length_p,
char *ptr)
1196 DBUG_ASSERT(token_p);
1197 DBUG_ASSERT(token_length_p);
1201 while (my_isspace(system_charset_info, *ptr))
1202 ptr+= my_mbcharlen(system_charset_info, (uchar) *ptr);
1214 while (*ptr && !my_isspace(system_charset_info, *ptr))
1215 ptr+= my_mbcharlen(system_charset_info, (uchar) *ptr);
1218 *token_length_p= ptr - *token_p;
1224 uint mbspacelen= my_mbcharlen(system_charset_info, (uchar) *ptr);
1233 while (my_isspace(system_charset_info, *ptr))
1234 ptr+= my_mbcharlen(system_charset_info, (uchar) *ptr);
1264 static char *debug_sync_number(ulong *number_p,
char *actstrptr)
1270 DBUG_ASSERT(number_p);
1271 DBUG_ASSERT(actstrptr);
1274 if (!(ptr= debug_sync_token(&token, &token_length, actstrptr)))
1277 *number_p= strtoul(token, &ept, 10);
1318 static bool debug_sync_eval_action(THD *thd,
char *action_str)
1320 st_debug_sync_action *action= NULL;
1324 uint token_length= 0;
1325 DBUG_ENTER(
"debug_sync_eval_action");
1327 DBUG_ASSERT(action_str);
1332 if (!(ptr= debug_sync_token(&token, &token_length, action_str)))
1334 errmsg=
"Missing synchronization point name";
1344 action= debug_sync_get_action(thd, token, token_length);
1355 if (!(ptr= debug_sync_token(&token, &token_length, ptr)))
1362 if (!my_strcasecmp(system_charset_info, token,
"RESET"))
1365 debug_sync_reset(thd);
1370 errmsg=
"Missing action after synchronization point name '%.*s'";
1378 DBUG_ASSERT(action);
1383 if (!my_strcasecmp(system_charset_info, token,
"TEST"))
1388 errmsg=
"Nothing must follow action TEST";
1393 debug_sync(thd, action->sync_point.ptr(), action->sync_point.length());
1395 thd->debug_sync_control->dsp_hits--;
1403 action->activation_count= 0;
1404 action->hit_limit= 0;
1407 action->signal.length(0);
1408 action->wait_for.length(0);
1413 if (!my_strcasecmp(system_charset_info, token,
"CLEAR"))
1418 errmsg=
"Nothing must follow action CLEAR";
1433 if (!my_strcasecmp(system_charset_info, token,
"SIGNAL"))
1436 if (!(ptr= debug_sync_token(&token, &token_length, ptr)))
1438 errmsg=
"Missing signal name after action SIGNAL";
1441 if (action->signal.copy(token, token_length, system_charset_info))
1454 if (!(ptr= debug_sync_token(&token, &token_length, ptr)))
1461 if (!my_strcasecmp(system_charset_info, token,
"WAIT_FOR"))
1464 if (!(ptr= debug_sync_token(&token, &token_length, ptr)))
1466 errmsg=
"Missing signal name after action WAIT_FOR";
1469 if (action->wait_for.copy(token, token_length, system_charset_info))
1480 action->timeout= opt_debug_sync_timeout;
1483 if (!(ptr= debug_sync_token(&token, &token_length, ptr)))
1489 if (!my_strcasecmp(system_charset_info, token,
"TIMEOUT"))
1492 if (!(ptr= debug_sync_number(&action->timeout, ptr)))
1494 errmsg=
"Missing valid number after TIMEOUT";
1499 if (!(ptr= debug_sync_token(&token, &token_length, ptr)))
1507 if (!my_strcasecmp(system_charset_info, token,
"EXECUTE"))
1513 if (!action->execute)
1515 errmsg=
"Missing action before EXECUTE";
1520 if (!(ptr= debug_sync_number(&action->execute, ptr)))
1522 errmsg=
"Missing valid number after EXECUTE";
1527 if (!(ptr= debug_sync_token(&token, &token_length, ptr)))
1534 if (!my_strcasecmp(system_charset_info, token,
"HIT_LIMIT"))
1537 if (!(ptr= debug_sync_number(&action->hit_limit, ptr)))
1539 errmsg=
"Missing valid number after HIT_LIMIT";
1544 if (!(ptr= debug_sync_token(&token, &token_length, ptr)))
1548 errmsg=
"Illegal or out of order stuff: '%.*s'";
1558 set_if_smaller(token_length, 64);
1559 my_printf_error(ER_PARSE_ERROR, errmsg, MYF(0), token_length, token);
1562 debug_sync_remove_action(thd->debug_sync_control, action);
1566 DBUG_RETURN(debug_sync_set_action(thd, action));
1592 bool debug_sync_update(THD *thd,
char *val_str)
1594 DBUG_ENTER(
"debug_sync_update");
1595 DBUG_PRINT(
"debug_sync", (
"set action: '%s'", val_str));
1601 DBUG_RETURN(opt_debug_sync_timeout ?
1602 debug_sync_eval_action(thd, val_str) :
1623 uchar *debug_sync_value_ptr(THD *thd)
1626 DBUG_ENTER(
"debug_sync_value_ptr");
1628 if (opt_debug_sync_timeout)
1630 static char on[]=
"ON - current signal: '";
1635 size_t lgt= (
sizeof(on) +
1636 debug_sync_global.ds_signal.length() + 1 );
1640 if ((value= (
char*) alloc_root(thd->mem_root, lgt)))
1642 vend= value + lgt - 1;
1643 vptr= debug_sync_bmove_len(value, vend, STRING_WITH_LEN(on));
1644 vptr= debug_sync_bmove_len(vptr, vend, debug_sync_global.ds_signal.ptr(),
1645 debug_sync_global.ds_signal.length());
1655 value=
const_cast<char*
>(
"OFF");
1659 DBUG_RETURN((uchar*) value);
1673 static void debug_sync_execute(THD *thd, st_debug_sync_action *action)
1676 const char *dsp_name= action->sync_point.c_ptr();
1677 const char *sig_emit= action->signal.c_ptr();
1678 const char *sig_wait= action->wait_for.c_ptr();
1680 DBUG_ENTER(
"debug_sync_execute");
1682 DBUG_ASSERT(action);
1683 DBUG_PRINT(
"debug_sync",
1684 (
"sync_point: '%s' activation_count: %lu hit_limit: %lu "
1685 "execute: %lu timeout: %lu signal: '%s' wait_for: '%s'",
1686 dsp_name, action->activation_count, action->hit_limit,
1687 action->execute, action->timeout, sig_emit, sig_wait));
1689 DBUG_ASSERT(action->activation_count);
1690 action->activation_count--;
1692 if (action->execute)
1694 const char *UNINIT_VAR(old_proc_info);
1703 if (action->wait_for.length())
1705 st_debug_sync_control *ds_control= thd->debug_sync_control;
1706 strxnmov(ds_control->ds_proc_info,
sizeof(ds_control->ds_proc_info)-1,
1707 "debug sync point: ", action->sync_point.c_ptr(), NullS);
1708 old_proc_info= thd->proc_info;
1709 thd_proc_info(thd, ds_control->ds_proc_info);
1720 if (action->signal.length())
1723 if (debug_sync_global.ds_signal.copy(action->signal))
1729 debug_sync_emergency_disable();
1733 DBUG_PRINT(
"debug_sync_exec", (
"signal '%s' at: '%s'",
1734 sig_emit, dsp_name));
1737 if (action->wait_for.length())
1755 old_mutex= thd->mysys_var->current_mutex;
1756 old_cond= thd->mysys_var->current_cond;
1757 thd->mysys_var->current_mutex= &debug_sync_global.ds_mutex;
1758 thd->mysys_var->current_cond= &debug_sync_global.ds_cond;
1763 set_timespec(abstime, action->timeout);
1764 DBUG_EXECUTE(
"debug_sync_exec", {
1766 const char *sig_glob= debug_sync_global.ds_signal.c_ptr();
1767 DBUG_PRINT(
"debug_sync_exec",
1768 (
"wait for '%s' at: '%s' curr: '%s'",
1769 sig_wait, dsp_name, sig_glob));});
1777 while (stringcmp(&debug_sync_global.ds_signal, &action->wait_for) &&
1778 !thd->killed && opt_debug_sync_timeout)
1781 &debug_sync_global.ds_mutex,
1783 DBUG_EXECUTE(
"debug_sync", {
1785 const char *sig_glob= debug_sync_global.ds_signal.c_ptr();
1786 DBUG_PRINT(
"debug_sync",
1787 (
"awoke from %s global: %s error: %d",
1788 sig_wait, sig_glob, error));});
1789 if (error == ETIMEDOUT || error == ETIME)
1792 const bool save_abort_on_warning= thd->abort_on_warning;
1793 thd->abort_on_warning=
false;
1794 push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
1795 ER_DEBUG_SYNC_TIMEOUT, ER(ER_DEBUG_SYNC_TIMEOUT));
1796 thd->abort_on_warning= save_abort_on_warning;
1797 DBUG_EXECUTE_IF(
"debug_sync_abort_on_timeout", DBUG_ABORT(););
1802 DBUG_EXECUTE(
"debug_sync_exec",
1804 DBUG_PRINT(
"debug_sync_exec",
1805 (
"killed %d from '%s' at: '%s'",
1806 thd->killed, sig_wait, dsp_name));
1808 DBUG_PRINT(
"debug_sync_exec",
1809 (
"%s from '%s' at: '%s'",
1810 error ?
"timeout" :
"resume",
1811 sig_wait, dsp_name)););
1824 thd->mysys_var->current_mutex= old_mutex;
1825 thd->mysys_var->current_cond= old_cond;
1826 thd_proc_info(thd, old_proc_info);
1830 thd_proc_info(thd, old_proc_info);
1841 if (action->hit_limit)
1843 if (!--action->hit_limit)
1845 thd->killed= THD::KILL_QUERY;
1846 my_error(ER_DEBUG_SYNC_HIT_LIMIT, MYF(0));
1848 DBUG_PRINT(
"debug_sync_exec", (
"hit_limit: %lu at: '%s'",
1849 action->hit_limit, dsp_name));
1864 void debug_sync(THD *thd,
const char *sync_point_name,
size_t name_len)
1871 st_debug_sync_control *ds_control= thd->debug_sync_control;
1872 st_debug_sync_action *action;
1873 DBUG_ENTER(
"debug_sync");
1875 DBUG_ASSERT(sync_point_name);
1876 DBUG_ASSERT(name_len);
1877 DBUG_ASSERT(ds_control);
1878 DBUG_PRINT(
"debug_sync_point", (
"hit: '%s'", sync_point_name));
1881 ds_control->dsp_hits++;
1883 if (ds_control->ds_active &&
1884 (action= debug_sync_find(ds_control->ds_action, ds_control->ds_active,
1885 sync_point_name, name_len)) &&
1886 action->activation_count)
1889 debug_sync_execute(thd, action);
1892 ds_control->dsp_executed++;
1895 if (!action->activation_count)
1896 debug_sync_remove_action(ds_control, action);
1926 bool debug_sync_set_action(THD *thd,
const char *action_str,
size_t len)
1930 DBUG_ENTER(
"debug_sync_set_action");
1932 DBUG_ASSERT(action_str);
1934 value= strmake_root(thd->mem_root, action_str, len);
1935 rc= debug_sync_eval_action(thd, value);