Skip to content

Commit d051f6c

Browse files
author
Nirbhay Choubey
committed
MDEV-6594: Use separate domain_id for Galera transactions
Post-fix : A typo and better error handling.
1 parent a1f3356 commit d051f6c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

sql/wsrep_sst.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ static void* sst_joiner_thread (void* a)
451451
} else {
452452
// Scan state ID first followed by wsrep_gtid_domain_id.
453453
char uuid[512];
454-
uint32 domain_id;
454+
long int domain_id;
455455
size_t len= pos - out + 1;
456456

457457
if (len > sizeof(uuid)) goto err; // safety check
@@ -464,14 +464,18 @@ static void* sst_joiner_thread (void* a)
464464
}
465465
else if (wsrep_gtid_mode)
466466
{
467+
errno= 0; /* Reset the errno */
467468
domain_id= strtol(pos + 1, NULL, 10);
468-
if (domain_id < 1000 || domain_id > 0xFFFF)
469+
err= errno;
470+
471+
/* Check if we received a valid gtid_domain_id. */
472+
if (err == EINVAL || err == ERANGE || domain_id < 0x0 || domain_id > 0xFFFF)
469473
{
470474
WSREP_ERROR("Failed to get donor wsrep_gtid_domain_id.");
471475
err= EINVAL;
472476
goto err;
473477
} else {
474-
wsrep_gtid_domain_id= domain_id;
478+
wsrep_gtid_domain_id= (uint32) domain_id;
475479
}
476480
}
477481
}

0 commit comments

Comments
 (0)