Details
-
Admin & Maintenance Task
-
Status: Done
-
Low
-
Resolution: Done
-
8.0.x
-
None
Description
Currently, in the PXC source code, we are using the hard coded version numbers for special handling and for checking compatibility between versions.
Something like below.
if (wsrep_protocol_version < 3) { tmp_length = charset->coll->strnxfrm( charset, str, str_length, str_length, tmp_str, tmp_length, 0); DBUG_ASSERT(tmp_length <= str_length); } else {
This may work well for now. But, it becomes difficult to search for its occurrences or such checks when the version changes in the future.
This ticket aims at replacing all such hard coded numbers with a more meaningful enum which is not only type-safe, also makes the code more readable and easily discoverable.
Something like:
enum enum_wsrep_version { WSREP_VERSION_V2 = 2, WSREP_VERSION_V3 = 3, WSREP_VERSION_V4 = 4 };