From 8467bb062791487158ed427039b1b3d547a95878 Mon Sep 17 00:00:00 2001 From: diego Dupin Date: Fri, 21 Jan 2022 12:30:27 +0100 Subject: [PATCH] [misc] test correction for mysql 8.0.28 that truncate timestamps / give wrong microsecond results for SELECT ? commands --- src/test/java/org/mariadb/jdbc/ScalarFunctionsTest.java | 1 + src/test/java/org/mariadb/jdbc/SslTest.java | 6 +++--- .../org/mariadb/jdbc/TimezoneDaylightSavingTimeTest.java | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/mariadb/jdbc/ScalarFunctionsTest.java b/src/test/java/org/mariadb/jdbc/ScalarFunctionsTest.java index c07ebe87c..3d99308e8 100644 --- a/src/test/java/org/mariadb/jdbc/ScalarFunctionsTest.java +++ b/src/test/java/org/mariadb/jdbc/ScalarFunctionsTest.java @@ -168,6 +168,7 @@ public void scalarFctTest() throws SQLException { if (!isMariadbServer()) { cancelForVersion(5, 5); } + cancelForVersion(8, 0, 28); queryScalar("SELECT {fn convert(?, SQL_BIGINT)}", 2147483648L, 2147483648L); queryScalar("SELECT {fn convert(?, SQL_BIGINT)}", BigInteger.valueOf(2147483648L), 2147483648L); queryScalar("SELECT {fn convert(?, SQL_BIGINT)}", 20, new Object[] {20, 20L}); diff --git a/src/test/java/org/mariadb/jdbc/SslTest.java b/src/test/java/org/mariadb/jdbc/SslTest.java index 5a1a03bb0..9b313cd02 100644 --- a/src/test/java/org/mariadb/jdbc/SslTest.java +++ b/src/test/java/org/mariadb/jdbc/SslTest.java @@ -59,11 +59,10 @@ import java.security.NoSuchAlgorithmException; import java.sql.*; import java.util.*; +import javax.net.ssl.SSLContext; import org.junit.*; import org.mariadb.jdbc.failover.TcpProxy; -import javax.net.ssl.SSLContext; - @SuppressWarnings("ResultOfMethodCallIgnored") public class SslTest extends BaseTest { @@ -167,7 +166,8 @@ public void mandatorySsl() throws SQLException { @Test public void enabledSslProtocolSuites() throws SQLException { try { - List protocols = Arrays.asList(SSLContext.getDefault().getSupportedSSLParameters().getProtocols()); + List protocols = + Arrays.asList(SSLContext.getDefault().getSupportedSSLParameters().getProtocols()); Assume.assumeTrue(protocols.contains("TLSv1.3") && protocols.contains("TLSv1.2")); } catch (NoSuchAlgorithmException e) { // eat diff --git a/src/test/java/org/mariadb/jdbc/TimezoneDaylightSavingTimeTest.java b/src/test/java/org/mariadb/jdbc/TimezoneDaylightSavingTimeTest.java index fdcb184aa..3dc847b01 100644 --- a/src/test/java/org/mariadb/jdbc/TimezoneDaylightSavingTimeTest.java +++ b/src/test/java/org/mariadb/jdbc/TimezoneDaylightSavingTimeTest.java @@ -219,6 +219,7 @@ public void tearDown() { @Test public void testTimeStamp() throws SQLException { Assume.assumeTrue(System.getenv("AURORA") == null && !"skysql-ha".equals(System.getenv("srv"))); + cancelForVersion(8, 0, 28); TimeZone.setDefault(parisTimeZone); try (Connection connection = setConnection("&serverTimezone=Europe/Paris&useServerPrepStmts=true")) { @@ -235,7 +236,7 @@ public void testTimeStamp() throws SQLException { @Test public void testTimeStampUtc() throws SQLException { - + cancelForVersion(8, 0, 28); TimeZone.setDefault(parisTimeZone); try (Connection connection = setConnection("&serverTimezone=UTC&useServerPrepStmts=true")) { setSessionTimeZone(connection, "+00:00");