convert to type str to compare

because type of uuid_set[1] is string and type of master_UUID is int,
so it is never equal

Change-Id: I45b3e0dc1dfabd000d2db2912e45450eec9a8edf
This commit is contained in:
Nguyen Thanh Cong
2020-11-16 18:08:55 +07:00
parent a05b6ee13f
commit 5e1178764d
2 changed files with 2 additions and 2 deletions

View File

@@ -63,7 +63,7 @@ class MariaDBApp(mysql_service.BaseMySqlApp):
gtid_executed = self._get_gtid_executed()
for gtid_set in gtid_executed.split(','):
uuid_set = gtid_set.split('-')
if uuid_set[1] == master_UUID:
if str(uuid_set[1]) == str(master_UUID):
last_txn_id = uuid_set[-1]
break
return master_UUID, int(last_txn_id)

View File

@@ -50,7 +50,7 @@ class MySqlApp(service.BaseMySqlApp):
gtid_executed = self._get_gtid_executed()
for gtid_set in gtid_executed.split(','):
uuid_set = gtid_set.split(':')
if uuid_set[0] == master_UUID:
if str(uuid_set[0]) == str(master_UUID):
last_txn_id = uuid_set[-1].split('-')[-1]
break
return master_UUID, int(last_txn_id)