Skip to content

Commit f1bb35c

Browse files
committed
Merge ../mysql-5.6-cluster-7.3 into mysql-5.6-cluster-7.4
2 parents d03fe06 + 0496563 commit f1bb35c

File tree

2 files changed

+100
-9
lines changed

2 files changed

+100
-9
lines changed

storage/ndb/include/ndb_version.h.in

+40-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License, version 2.0,
@@ -941,4 +941,43 @@ ndbd_isolate_ord(Uint32 x)
941941
return 1;
942942
}
943943

944+
// New limitations from WL#12757
945+
946+
#define NDBD_80_PROTOCOL_ACCEPT_74 NDB_MAKE_VERSION(7,4,6)
947+
#define NDBD_80_PROTOCOL_ACCEPT_75 NDB_MAKE_VERSION(7,5,6)
948+
#define NDBD_80_PROTOCOL_ACCEPT_76 NDB_MAKE_VERSION(7,6,4)
949+
950+
static
951+
inline
952+
int
953+
ndbd_protocol_accepted_by_8_0(Uint32 x)
954+
{
955+
const Uint32 major = (x >> 16) & 0xFF;
956+
const Uint32 minor = (x >> 8) & 0xFF;
957+
if (major < 7)
958+
{
959+
return 0;
960+
}
961+
else if (major == 7)
962+
{
963+
if (minor < 4)
964+
{
965+
return 0;
966+
}
967+
else if (minor == 4)
968+
{
969+
return x >= NDBD_80_PROTOCOL_ACCEPT_74;
970+
}
971+
else if (minor == 5)
972+
{
973+
return x >= NDBD_80_PROTOCOL_ACCEPT_75;
974+
}
975+
else if (minor == 6)
976+
{
977+
return x >= NDBD_80_PROTOCOL_ACCEPT_76;
978+
}
979+
}
980+
return 1;
981+
}
982+
944983
#endif

storage/ndb/test/ndbapi/testUpgrade.cpp

+60-8
Original file line numberDiff line numberDiff line change
@@ -1448,24 +1448,64 @@ bool versionsSpanBoundary(int verA, int verB, int incBoundaryVer)
14481448
(maxPeerVer >= incBoundaryVer) );
14491449
}
14501450

1451+
bool versionsProtocolCompatible(int verA, int verB)
1452+
{
1453+
/**
1454+
* Version 8.0 introduced some incompatibilities, check
1455+
* whether they make a test unusable
1456+
*/
1457+
if (versionsSpanBoundary(verA, verB, NDB_MAKE_VERSION(8,0,0)))
1458+
{
1459+
/* Versions span 8.0 boundary, check compatibility */
1460+
if (!ndbd_protocol_accepted_by_8_0(verA) ||
1461+
!ndbd_protocol_accepted_by_8_0(verB))
1462+
{
1463+
ndbout_c("Versions spanning 8.0 boundary not protocol compatible : "
1464+
"%x -> %x",
1465+
verA, verB);
1466+
return false;
1467+
}
1468+
}
1469+
1470+
return true;
1471+
}
1472+
14511473
static int checkForDowngrade(NDBT_Context* ctx, NDBT_Step* step)
14521474
{
1453-
if (preVersion >= postVersion)
1475+
if (preVersion < postVersion)
14541476
{
1455-
return NDBT_OK;
1477+
ndbout_c("Error: Not doing downgrade as expected : "
1478+
"%x -> %x",
1479+
preVersion, postVersion);
1480+
return NDBT_FAILED;
1481+
}
1482+
1483+
if (!versionsProtocolCompatible(preVersion, postVersion))
1484+
{
1485+
ndbout_c("Skipping test due to protocol incompatibility");
1486+
return NDBT_SKIPPED;
14561487
}
1457-
ndbout << "Error: Not doing downgrade as expected" << endl;
1458-
return NDBT_FAILED;
1488+
1489+
return NDBT_OK;
14591490
}
14601491

14611492
static int checkForUpgrade(NDBT_Context* ctx, NDBT_Step* step)
14621493
{
1463-
if (preVersion <= postVersion)
1494+
if (preVersion > postVersion)
14641495
{
1465-
return NDBT_OK;
1496+
ndbout_c("Error: Not doing upgrade as expected : "
1497+
"%x -> %x",
1498+
preVersion, postVersion);
1499+
return NDBT_FAILED;
14661500
}
1467-
ndbout << "Error: Not doing upgrade as expected" << endl;
1468-
return NDBT_FAILED;
1501+
1502+
if (!versionsProtocolCompatible(preVersion, postVersion))
1503+
{
1504+
ndbout_c("Skipping test due to protocol incompatibility");
1505+
return NDBT_SKIPPED;
1506+
}
1507+
1508+
return NDBT_OK;
14691509
}
14701510

14711511
#define NDB_USE_CONFIG_VERSION_V2_80 NDB_MAKE_VERSION(8,0,18)
@@ -2117,13 +2157,25 @@ NDBT_TESTSUITE(testUpgrade);
21172157
TESTCASE("ShowVersions",
21182158
"Upgrade API, showing actual versions run")
21192159
{
2160+
/**
2161+
* This test is used to check the versions involved, and
2162+
* should do a minimal amount of other things, so that it
2163+
* does not depend on anything that can break between
2164+
* releases.
2165+
*/
21202166
INITIALIZER(runCheckStarted);
21212167
STEP(runShowVersion);
21222168
STEP(runRecordVersion);
21232169
VERIFIER(startPostUpgradeChecks);
21242170
}
21252171
POSTUPGRADE("ShowVersions")
21262172
{
2173+
/**
2174+
* This test postupgrade is used to check the versions involved, and
2175+
* should do a minimal amount of other things, so that it
2176+
* does not depend on anything that can break between
2177+
* releases.
2178+
*/
21272179
TC_PROPERTY("PostUpgrade", Uint32(1));
21282180
INITIALIZER(runCheckStarted);
21292181
STEP(runShowVersion);

0 commit comments

Comments
 (0)