@@ -122,9 +122,9 @@ struct st_debug_sync_globals
122
122
@retval false otherwise.
123
123
*/
124
124
125
- inline bool is_signalled (const String & signal_name)
125
+ inline bool is_signalled (const char * signal_name, size_t length )
126
126
{
127
- return ds_signal_set.find (signal_name. ptr (), signal_name. length () );
127
+ return ds_signal_set.find (signal_name, length);
128
128
}
129
129
130
130
void clear_signal (const String &signal_name)
@@ -140,21 +140,21 @@ struct st_debug_sync_globals
140
140
DBUG_VOID_RETURN;
141
141
}
142
142
143
- bool set_signal (const String & signal_name)
143
+ bool set_signal (const char * signal_name, size_t length )
144
144
{
145
145
/* Need to check if the signal is already in the hash set, because
146
146
Hash_set doesn't differentiate between OOM and key already in. */
147
- if (is_signalled (signal_name))
147
+ if (is_signalled (signal_name, length ))
148
148
return FALSE ;
149
149
/* LEX_CSTRING and the string allocated with only one malloc. */
150
150
LEX_CSTRING *s= (LEX_CSTRING *) my_malloc (PSI_NOT_INSTRUMENTED,
151
- sizeof (LEX_CSTRING) +
152
- signal_name. length () + 1 , MYF (0 ));
151
+ sizeof (LEX_CSTRING) + length + 1 ,
152
+ MYF (0 ));
153
153
char *str= (char *)(s + 1 );
154
- memcpy (str, signal_name. ptr (), signal_name. length () );
155
- str[signal_name. length () ]= ' \0 ' ;
154
+ memcpy (str, signal_name, length);
155
+ str[length]= ' \0 ' ;
156
156
157
- s->length = signal_name. length () ;
157
+ s->length = length;
158
158
s->str = str;
159
159
if (ds_signal_set.insert (s))
160
160
return TRUE ;
@@ -1522,7 +1522,23 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action)
1522
1522
1523
1523
if (action->signal .length ())
1524
1524
{
1525
- if (debug_sync_global.set_signal (action->signal ))
1525
+ int offset= 0 , pos;
1526
+ bool error= false ;
1527
+
1528
+ /* This loop covers all signals in the list except for the last one.
1529
+ Split the signal string by commas and set a signal in the global
1530
+ variable for each one. */
1531
+ while (!error && (pos= action->signal .strstr (" ," , 1 , offset)) > 0 )
1532
+ {
1533
+ error= debug_sync_global.set_signal (action->signal .ptr () + offset,
1534
+ pos - offset);
1535
+ offset= pos + 1 ;
1536
+ }
1537
+
1538
+ if (error ||
1539
+ /* The last signal in the list. */
1540
+ debug_sync_global.set_signal (action->signal .ptr () + offset,
1541
+ action->signal .length () - offset))
1526
1542
{
1527
1543
/*
1528
1544
Error is reported by my_malloc().
@@ -1578,8 +1594,9 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action)
1578
1594
The facility can become disabled when some thread cannot get
1579
1595
the required dynamic memory allocated.
1580
1596
*/
1581
- while (!debug_sync_global.is_signalled (action->wait_for ) &&
1582
- !(thd->killed & KILL_HARD_BIT)&&
1597
+ while (!debug_sync_global.is_signalled (action->wait_for .ptr (),
1598
+ action->wait_for .length ()) &&
1599
+ !(thd->killed & KILL_HARD_BIT) &&
1583
1600
opt_debug_sync_timeout)
1584
1601
{
1585
1602
error= mysql_cond_timedwait (&debug_sync_global.ds_cond ,
0 commit comments