From a7b559c825e49566352808dfe2024725110bedf7 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Sat, 28 Oct 2017 11:59:13 +0300 Subject: [PATCH] temporarily set UTC as timezone to comply with H2 behavior Original commit: elastic/x-pack-elasticsearch@00be17cebb4cd5f6262ddabf8f9606c94de7141e --- .../org/elasticsearch/xpack/qa/sql/jdbc/SqlSpecTestCase.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qa/sql/src/main/java/org/elasticsearch/xpack/qa/sql/jdbc/SqlSpecTestCase.java b/qa/sql/src/main/java/org/elasticsearch/xpack/qa/sql/jdbc/SqlSpecTestCase.java index 404682fe482..22bb8d67734 100644 --- a/qa/sql/src/main/java/org/elasticsearch/xpack/qa/sql/jdbc/SqlSpecTestCase.java +++ b/qa/sql/src/main/java/org/elasticsearch/xpack/qa/sql/jdbc/SqlSpecTestCase.java @@ -7,12 +7,14 @@ package org.elasticsearch.xpack.qa.sql.jdbc; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; +import org.elasticsearch.xpack.sql.jdbc.jdbc.JdbcConnection; import org.elasticsearch.xpack.sql.util.CollectionUtils; import org.junit.ClassRule; import java.sql.Connection; import java.sql.ResultSet; import java.util.List; +import java.util.TimeZone; /** * Tests comparing sql queries executed against our jdbc client @@ -66,6 +68,9 @@ public abstract class SqlSpecTestCase extends SpecBaseIntegrationTestCase { try (Connection h2 = H2.get(); Connection es = esJdbc()) { + // TODO: use UTC for now until deciding on a strategy for handling date extraction + ((JdbcConnection) es).setTimeZone(TimeZone.getTimeZone("UTC")); + ResultSet expected, elasticResults; expected = executeJdbcQuery(h2, query); elasticResults = executeJdbcQuery(es, query);