Skip to content

Commit

Permalink
Add handling for off-cycle releases - postfix
Browse files Browse the repository at this point in the history
Fix dependencies on global variable.

Change-Id: I9222afc901d16fa849edda9593ca4530010c5ba2
  • Loading branch information
Paweł Andruszkiewicz committed Sep 4, 2024
1 parent 538871b commit 2c88051
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions mysqlshdk/libs/utils/version.cc
Original file line number Diff line number Diff line change
Expand Up @@ -217,25 +217,26 @@ namespace detail {
// ID of an 8.0 LTS release
constexpr int k_release_8_0_id = 7;

// LTS off-cycle releases
const std::unordered_map<int, off_cycle_releases_t> k_off_cycle_releases{
{
k_release_8_0_id, // 8.0.x
{
39,
},
},
{
8, // 8.4.x
{
2,
},
},
};

bool off_cycle_releases(int version_id, const off_cycle_releases_t **releases) {
assert(releases);

// LTS off-cycle releases
static const std::unordered_map<int, off_cycle_releases_t>
k_off_cycle_releases{
{
k_release_8_0_id, // 8.0.x
{
39,
},
},
{
8, // 8.4.x
{
2,
},
},
};

if (const auto found = k_off_cycle_releases.find(version_id);
k_off_cycle_releases.end() != found) {
*releases = &found->second;
Expand Down

0 comments on commit 2c88051

Please sign in to comment.