Add MariaDBMonitor Gtid unit test

Tests the class with different inputs. Also fixes a bug found by the test.
This commit is contained in:
Esa Korhonen
2018-09-12 12:30:38 +03:00
parent 56c84541df
commit eeb61216de
3 changed files with 138 additions and 1 deletions

View File

@ -139,6 +139,16 @@ uint64_t GtidList::events_ahead(const GtidList& rhs, substraction_mode_t domain_
ind_rhs++;
}
}
// If LHS has domains with higher id:s than at RHS, those domains need to be iterated here.
// This only affects the result if the LHS_ADD-mode is used.
if (domain_substraction_mode == MISSING_DOMAIN_LHS_ADD)
{
for (; ind_lhs < n_lhs; ind_lhs++)
{
events += m_triplets[ind_lhs].m_sequence;
}
}
return events;
}