diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2015-04-15 12:09:25 -0700 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2015-04-15 12:09:25 -0700 |
commit | c712b376d8189b963851db86a0bedd478aab869e (patch) | |
tree | 8d02a74357f8ba77261d79bd70ca6174e0fe5dd8 /sql/wsrep_sst.cc | |
parent | 25da74ce3f17a4720f4f7f06b1d694ff417d6b60 (diff) | |
parent | d051f6c36beaf6c7ea269d6c174cca7482f3e823 (diff) | |
download | mariadb-git-bb-10.1-explain-analyze.tar.gz |
Merge branch '10.1' into bb-10.1-explain-analyzebb-10.1-explain-analyze
Diffstat (limited to 'sql/wsrep_sst.cc')
-rw-r--r-- | sql/wsrep_sst.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc index 512e8f23dd8..d37c6c0e96c 100644 --- a/sql/wsrep_sst.cc +++ b/sql/wsrep_sst.cc @@ -451,7 +451,7 @@ static void* sst_joiner_thread (void* a) } else { // Scan state ID first followed by wsrep_gtid_domain_id. char uuid[512]; - uint32 domain_id; + long int domain_id; size_t len= pos - out + 1; if (len > sizeof(uuid)) goto err; // safety check @@ -464,14 +464,18 @@ static void* sst_joiner_thread (void* a) } else if (wsrep_gtid_mode) { + errno= 0; /* Reset the errno */ domain_id= strtol(pos + 1, NULL, 10); - if (domain_id < 1000 || domain_id > 0xFFFF) + err= errno; + + /* Check if we received a valid gtid_domain_id. */ + if (err == EINVAL || err == ERANGE || domain_id < 0x0 || domain_id > 0xFFFF) { WSREP_ERROR("Failed to get donor wsrep_gtid_domain_id."); err= EINVAL; goto err; } else { - wsrep_gtid_domain_id= domain_id; + wsrep_gtid_domain_id= (uint32) domain_id; } } } |