Skip to content

Commit 8845bfd

Browse files
pedrolgomesnacarvalho
authored andcommitted
Bug#20462601: INCORRECT (SIGNED) TYPE ON CHANNEL_GET_APPLIERS_THREAD_ID() FUNCTION
The appliers_id parameter in the channel_get_appliers_thread_id method of the channel interface was signed, not matching the my_thread_id definition. That is correct and the parameter is now unsigned.
1 parent 7fdf713 commit 8845bfd

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

sql/rpl_channel_service_interface.cc

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,8 @@ bool channel_is_active(const char* channel, enum_channel_thread_types thd_type)
432432
DBUG_RETURN(false);
433433
}
434434

435-
int channel_get_appliers_thread_id(const char* channel, long** appliers_id)
435+
int channel_get_appliers_thread_id(const char* channel,
436+
unsigned long** appliers_id)
436437
{
437438
DBUG_ENTER("channel_is_active(channel, thd_type");
438439

@@ -452,9 +453,10 @@ int channel_get_appliers_thread_id(const char* channel, long** appliers_id)
452453
int num_workers= mi->rli->slave_parallel_workers;
453454
if (num_workers > 1)
454455
{
455-
*appliers_id= (long*) my_malloc(PSI_NOT_INSTRUMENTED,
456-
num_workers * sizeof(long),
457-
MYF(MY_WME));
456+
*appliers_id=
457+
(unsigned long*) my_malloc(PSI_NOT_INSTRUMENTED,
458+
num_workers * sizeof(unsigned long),
459+
MYF(MY_WME));
458460

459461
for (int i = 0; i < num_workers; i++)
460462
{
@@ -469,9 +471,9 @@ int channel_get_appliers_thread_id(const char* channel, long** appliers_id)
469471
{
470472
if (mi->rli->info_thd != NULL)
471473
{
472-
*appliers_id= (long*) my_malloc(PSI_NOT_INSTRUMENTED,
473-
sizeof(long),
474-
MYF(MY_WME));
474+
*appliers_id= (unsigned long*) my_malloc(PSI_NOT_INSTRUMENTED,
475+
sizeof(unsigned long),
476+
MYF(MY_WME));
475477
mysql_mutex_lock(&mi->rli->info_thd_lock);
476478
**appliers_id= mi->rli->info_thd->thread_id();
477479
mysql_mutex_unlock(&mi->rli->info_thd_lock);

sql/rpl_channel_service_interface.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ bool channel_is_active(const char* channel, enum_channel_thread_types type);
204204
@retval <=0 the channel does no exists, or the applier is not present
205205
@retval >0 the number of applier ids returned.
206206
*/
207-
int channel_get_appliers_thread_id(const char* channel, long** appliers_id);
207+
int channel_get_appliers_thread_id(const char* channel,
208+
unsigned long** appliers_id);
208209

209210
/**
210211
Returns last GNO from applier from a given UUID.

0 commit comments

Comments
 (0)