MySQL 26.7.0
Source Code Documentation
my_clone.cc File Reference

Functions to compare server version strings and and determine if clone should be allowed. More...

#include "my_clone.h"
#include "my_server_version.h"

Functions

bool are_versions_clone_compatible (const std::string &recipient, const std::string &donor, const bool is_recipient_lts, const bool is_donor_lts, const std::optional< std::string > &recipient_prev_lts)
 Compares versions and determine if clone is allowed. More...
 

Variables

const char * CLONE_BACKPORT_VERSION_STRING = "8.0.37"
 
const char * CLONE_TO_NEXT_LTS_SUPPORT_STRING = "9.7.0"
 
const My_server_version CLONE_BACKPORT_VERSION
 
const My_server_version CLONE_TO_NEXT_LTS_SUPPORT
 

Detailed Description

Functions to compare server version strings and and determine if clone should be allowed.

Function Documentation

◆ are_versions_clone_compatible()

bool are_versions_clone_compatible ( const std::string &  recipient,
const std::string &  donor,
const bool  is_recipient_lts = false,
const bool  is_donor_lts = false,
const std::optional< std::string > &  recipient_prev_lts = std::nullopt 
)

Compares versions and determine if clone is allowed.

Clone is allowed if both the donor and recipient have exactly same version string. In version series 8.1 and above, cloning is allowed if Major and Minor versions match. In 8.0 series, clone is allowed if patch version is above clone backport version. In this comparison, suffixes are ignored: i.e. 8.0.25 should be the same as 8.0.25-debug, but 8.0.25 isn't the same as 8.0.251. Beyond version 9.7, Cloning is also allowed from a Donor in one LTS to a recipient in the next LTS. For example, Cloning from 9.7.x to 28.4.y is allowed but not from 28.4.y to 9.7.x. Conversly, a LTS Recipient is allowed to clone from a LTS Donor if the recipient starts its LTS lineage after Donor.

Note: The Recipient performs these checks and determines if cloning is allowed

Parameters
[in]recipientRecipient's version string
[in]donorDonor's version string
[in]is_recipient_ltstrue if recipient is LTS
[in]is_donor_ltstrue if donor is LTS
[in]recipient_prev_ltsPrevious LTS version of the Recipient
Returns
true if recipient must allow clone from donor, false otherwise

Variable Documentation

◆ CLONE_BACKPORT_VERSION

const My_server_version CLONE_BACKPORT_VERSION
Initial value:
{
.version =
const char * CLONE_BACKPORT_VERSION_STRING
Definition: my_clone.cc:37
static uint version_string_to_id(const std::string &version_string)
Parse a version string to extract the major, minor and patch from the version and encode into version...
Definition: my_server_version.cc:78

◆ CLONE_BACKPORT_VERSION_STRING

const char* CLONE_BACKPORT_VERSION_STRING = "8.0.37"

◆ CLONE_TO_NEXT_LTS_SUPPORT

const My_server_version CLONE_TO_NEXT_LTS_SUPPORT
Initial value:
{
const char * CLONE_TO_NEXT_LTS_SUPPORT_STRING
Definition: my_clone.cc:38

◆ CLONE_TO_NEXT_LTS_SUPPORT_STRING

const char* CLONE_TO_NEXT_LTS_SUPPORT_STRING = "9.7.0"