Skip to content

Commit

Permalink
JDBC-540 Use legacy bind for scalar time/date function test
Browse files Browse the repository at this point in the history
Avoids complexity between Firebird 4 and earlier and Java 7 vs Java 8
  • Loading branch information
mrotteveel committed Mar 10, 2019
1 parent 2302412 commit 50f2478
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/org/firebirdsql/util/FirebirdSupportInfo.java
Expand Up @@ -511,6 +511,13 @@ public boolean supportsExplainedExecutionPlan() {
return isVersionEqualOrAbove(3, 0);
}

/**
* @return {@code true} when this Firebird version supports {@code TIME(STAMP) WITH TIME ZONE}
*/
public boolean supportsTimeZones() {
return isVersionEqualOrAbove(4, 0);
}

/**
* @param serverVersion
* Server version
Expand Down Expand Up @@ -553,4 +560,5 @@ public static FirebirdSupportInfo supportInfoFor(java.sql.Connection connection)
throw new IllegalStateException(e);
}
}

}
Expand Up @@ -33,6 +33,7 @@
import java.util.Collection;

import static org.firebirdsql.common.FBTestProperties.getConnectionViaDriverManager;
import static org.firebirdsql.common.FBTestProperties.getDefaultSupportInfo;
import static org.firebirdsql.common.JdbcResourceHelper.closeQuietly;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
Expand Down Expand Up @@ -61,6 +62,10 @@ public static void setUp() throws Exception {
// We create a connection and statement for all tests executed for performance reasons
con = getConnectionViaDriverManager();
stmt = con.createStatement();
if (getDefaultSupportInfo().supportsTimeZones()) {
// Test uses java.sql.Time/java.sql.Timestamp, avoid complications with CURRENT_TIME(STAMP)
stmt.execute("set time zone bind legacy");
}
}

@AfterClass
Expand Down

0 comments on commit 50f2478

Please sign in to comment.