提交 9b4f437d 编写于 作者: Z zhaoyanggh

[fix] add jdbc nano second test cases

上级 df5d62ed
...@@ -70,6 +70,9 @@ public class TimestampPrecisionInNanoInJniTest { ...@@ -70,6 +70,9 @@ public class TimestampPrecisionInNanoInJniTest {
} }
private void checkCount(long count, ResultSet rs) throws SQLException { private void checkCount(long count, ResultSet rs) throws SQLException {
if (count == 0) {
Assert(0);
}
rs.next(); rs.next();
long test_count = rs.getLong(1); long test_count = rs.getLong(1);
Assert.assertEquals(count, test_count); Assert.assertEquals(count, test_count);
...@@ -154,9 +157,6 @@ public class TimestampPrecisionInNanoInJniTest { ...@@ -154,9 +157,6 @@ public class TimestampPrecisionInNanoInJniTest {
public void canSelectLastRowFromWeatherForFirstCol() { public void canSelectLastRowFromWeatherForFirstCol() {
try (Statement stmt = conn.createStatement()) { try (Statement stmt = conn.createStatement()) {
ResultSet rs = stmt.executeQuery("select last(ts) from " + ns_timestamp_db + ".weather"); ResultSet rs = stmt.executeQuery("select last(ts) from " + ns_timestamp_db + ".weather");
// int nanos = rs.getTimestamp(1).getNanos();
// Assert.assertEquals(timestamp3 % 1000_000l * 1000, nanos);
// java.lang.AssertionError: expected:<123456000> but was:<468123456>
checkTime(timestamp3, rs); checkTime(timestamp3, rs);
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
...@@ -417,18 +417,6 @@ public class TimestampPrecisionInNanoInJniTest { ...@@ -417,18 +417,6 @@ public class TimestampPrecisionInNanoInJniTest {
} }
} }
// @Test
// public void canQueryNotEqualToInDateTypeForFirstCol() {
// try (Statement stmt = conn.createStatement()) {
// ResultSet rs = stmt.executeQuery("select count(*) from " + ns_timestamp_db + ".weather where ts <> '" + date3 + "'");
// checkCount(1l, rs);
// rs = stmt.executeQuery("select ts from " + ns_timestamp_db + ".weather where ts <> '" + date3 + "'");
// checkTime(timestamp2, rs);
// } catch (SQLException e) {
// e.printStackTrace();
// }
// }
@Test @Test
public void canQueryNotEqualToInDateTypeForSecondCol() { public void canQueryNotEqualToInDateTypeForSecondCol() {
try (Statement stmt = conn.createStatement()) { try (Statement stmt = conn.createStatement()) {
...@@ -441,18 +429,6 @@ public class TimestampPrecisionInNanoInJniTest { ...@@ -441,18 +429,6 @@ public class TimestampPrecisionInNanoInJniTest {
} }
} }
// @Test
// public void canQueryNotEqualToInNumberTypeForFirstCol() {
// try (Statement stmt = conn.createStatement()) {
// ResultSet rs = stmt.executeQuery("select count(*) from " + ns_timestamp_db + ".weather where ts <> '" + timestamp3 + "'");
// checkCount(1l, rs);
// rs = stmt.executeQuery("select ts from " + ns_timestamp_db + ".weather where ts <> '" + timestamp3 + "'");
// checkTime(timestamp2, rs);
// } catch (SQLException e) {
// e.printStackTrace();
// }
// }
@Test @Test
public void canQueryNotEqualToInNumberTypeForSecondCol() { public void canQueryNotEqualToInNumberTypeForSecondCol() {
try (Statement stmt = conn.createStatement()) { try (Statement stmt = conn.createStatement()) {
...@@ -465,18 +441,6 @@ public class TimestampPrecisionInNanoInJniTest { ...@@ -465,18 +441,6 @@ public class TimestampPrecisionInNanoInJniTest {
} }
} }
// @Test
// public void canQueryNotEqualInDateTypeForFirstCol() {
// try (Statement stmt = conn.createStatement()) {
// ResultSet rs = stmt.executeQuery("select count(*) from " + ns_timestamp_db + ".weather where ts != '" + date3 + "'");
// checkCount(1l, rs);
// rs = stmt.executeQuery("select ts from " + ns_timestamp_db + ".weather where ts != '" + date3 + "'");
// checkTime(timestamp2, rs);
// } catch (SQLException e) {
// e.printStackTrace();
// }
// }
@Test @Test
public void canQueryNotEqualInDateTypeForSecondCol() { public void canQueryNotEqualInDateTypeForSecondCol() {
try (Statement stmt = conn.createStatement()) { try (Statement stmt = conn.createStatement()) {
...@@ -489,18 +453,6 @@ public class TimestampPrecisionInNanoInJniTest { ...@@ -489,18 +453,6 @@ public class TimestampPrecisionInNanoInJniTest {
} }
} }
// @Test
// public void canQueryNotEqualInNumberTypeForFirstCol() {
// try (Statement stmt = conn.createStatement()) {
// ResultSet rs = stmt.executeQuery("select count(*) from " + ns_timestamp_db + ".weather where ts != '" + timestamp3 + "'");
// checkCount(1l, rs);
// rs = stmt.executeQuery("select ts from " + ns_timestamp_db + ".weather where ts != '" + timestamp3 + "'");
// checkTime(timestamp2, rs);
// } catch (SQLException e) {
// e.printStackTrace();
// }
// }
@Test @Test
public void canQueryNotEqualInNumberTypeForSecondCol() { public void canQueryNotEqualInNumberTypeForSecondCol() {
try (Statement stmt = conn.createStatement()) { try (Statement stmt = conn.createStatement()) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册