Skip to content

Commit a38bed0

Browse files
Fix test_set_time and test_time_tz's timezone error
1 parent 55c3f1a commit a38bed0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
build
22
.idea
3-
cmake-build-debug
3+
cmake-build-debug

src/test/java/org/duckdb/TestDuckDBJDBC.java

+2
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,7 @@ public static void test_set_date() throws Exception {
11481148
}
11491149

11501150
public static void test_set_time() throws Exception {
1151+
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
11511152
try (Connection conn = DriverManager.getConnection(JDBC_URL);
11521153
PreparedStatement stmt = conn.prepareStatement("SELECT ?::VARCHAR")) {
11531154
Time time = Time.valueOf("12:40:00");
@@ -1906,6 +1907,7 @@ public static void test_schema_reflection() throws Exception {
19061907

19071908
public static void test_time_tz() throws Exception {
19081909
try (Connection conn = DriverManager.getConnection(JDBC_URL); Statement s = conn.createStatement()) {
1910+
s.execute("set timezone = 'UTC'");
19091911
s.executeUpdate("create table t (i time with time zone)");
19101912
try (ResultSet rs = conn.getMetaData().getColumns(null, "%", "t", "i");) {
19111913
rs.next();

0 commit comments

Comments
 (0)