Skip to content

Commit ee09550

Browse files
authored
Merge pull request #33 from XuQianJin-Stars/fix-test-timezone
Fix test_set_time and test_time_tz's timezone error
2 parents 329b9aa + a38bed0 commit ee09550

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
@@ -1152,6 +1152,7 @@ public static void test_set_date() throws Exception {
11521152
}
11531153

11541154
public static void test_set_time() throws Exception {
1155+
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
11551156
try (Connection conn = DriverManager.getConnection(JDBC_URL);
11561157
PreparedStatement stmt = conn.prepareStatement("SELECT ?::VARCHAR")) {
11571158
Time time = Time.valueOf("12:40:00");
@@ -1910,6 +1911,7 @@ public static void test_schema_reflection() throws Exception {
19101911

19111912
public static void test_time_tz() throws Exception {
19121913
try (Connection conn = DriverManager.getConnection(JDBC_URL); Statement s = conn.createStatement()) {
1914+
s.execute("set timezone = 'UTC'");
19131915
s.executeUpdate("create table t (i time with time zone)");
19141916
try (ResultSet rs = conn.getMetaData().getColumns(null, "%", "t", "i");) {
19151917
rs.next();

0 commit comments

Comments
 (0)