Permalink
Browse files

fix: accept server version with more than 3 parts (#741)

EDB uses 4 part version like 9.4.3.2, so parsing logic was updated to just ignore the last part.
  • Loading branch information...
ericmack authored and vlsi committed Feb 2, 2017
1 parent 4942f7d commit 8437f6c1c76c3560331d75c4332ab50959d57228
@@ -138,7 +138,13 @@ static int parseServerVersionStr(String serverVersion) throws NumberFormatExcept
}
}

if (versionParts == 3) {
/* #667 - Allow for versions with greater than 3 parts.
For versions with more than 3 parts, still return 3 parts (4th part ignored for now
as no functionality is dependent on the 4th part .
Allows for future versions of the server to utilize more than 3 part version numbers
without upgrading the jdbc driver */

if (versionParts >= 3) {
if (parts[1] > 99) {
throw new NumberFormatException(
"Unsupported second part of major version > 99 in invalid version string: "
@@ -31,6 +31,11 @@ public ServerVersionParseTest(String versionString, int versionNum, String rejec
@Parameterized.Parameters(name = "str = {0}, expected = {1}")
public static Iterable<Object[]> data() {
return Arrays.asList(new Object[][]{
/* 4 part version tests */
{"7.4.0.0", 70400, null},
{"9.0.0.0", 90000, null},
{"9.0.1.0", 90001, null},
{"9.2.1.0", 90201, null},
{"7.4.0", 70400, null},
{"9.0.0", 90000, null},
{"9.0.1", 90001, null},

0 comments on commit 8437f6c

Please sign in to comment.