You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by al...@apache.org on 2024/10/18 08:40:53 UTC
(ignite) branch master updated: IGNITE-23477 SQL Calcite: Fix parsing of incorrect date literal - Fixes #11601.
This is an automated email from the ASF dual-hosted git repository.
alexpl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new cbeb07061ac IGNITE-23477 SQL Calcite: Fix parsing of incorrect date literal - Fixes #11601.
cbeb07061ac is described below
commit cbeb07061aca37f6a7fe6a5c2dca4be97c3ec392
Author: Vladimir Steshin <vl...@gmail.com>
AuthorDate: Fri Oct 18 11:39:24 2024 +0300
IGNITE-23477 SQL Calcite: Fix parsing of incorrect date literal - Fixes #11601.
Signed-off-by: Aleksey Plekhanov <pl...@gmail.com>
---
modules/calcite/pom.xml | 2 +-
.../integration/TableDmlIntegrationTest.java | 25 ++++++++++++++++++++++
...p.test_ignore => test_incorrect_timestamp.test} | 1 -
3 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/modules/calcite/pom.xml b/modules/calcite/pom.xml
index d80b33b8258..47b7e4bbea3 100644
--- a/modules/calcite/pom.xml
+++ b/modules/calcite/pom.xml
@@ -35,7 +35,7 @@
<!-- Module specific package versions -->
<properties>
- <avatica.version>1.23.0</avatica.version>
+ <avatica.version>1.25.0</avatica.version>
<calcite.version>1.37.0</calcite.version>
<checker.version>3.10.0</checker.version>
<failureaccess.version>1.0.1</failureaccess.version>
diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDmlIntegrationTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDmlIntegrationTest.java
index b8f28c278fe..19027353fb3 100644
--- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDmlIntegrationTest.java
+++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDmlIntegrationTest.java
@@ -629,6 +629,31 @@ public class TableDmlIntegrationTest extends AbstractBasicIntegrationTransaction
}
}
+ /** */
+ @Test
+ public void testInsertIncorrectDate() {
+ sql("CREATE TABLE timestamp_t(t TIMESTAMP) WITH " + atomicity());
+
+ String errDate = "Invalid DATE value";
+ String errDay = "Value of DAY field is out of range";
+ Class<? extends Exception> errType = IllegalArgumentException.class;
+
+ assertThrows("INSERT INTO timestamp_t VALUES ('blabla')", errType, errDate);
+ assertThrows("INSERT INTO timestamp_t VALUES ('1993-20-14 00:00:00')", errType, errDate);
+ assertThrows("INSERT INTO timestamp_t VALUES ('1993-08-99 00:00:00')", errType, errDate);
+ assertThrows("INSERT INTO timestamp_t VALUES ('1993-02-29 00:00:00')", errType, errDay);
+ assertThrows("INSERT INTO timestamp_t VALUES ('1900-02-29 00:00:00')", errType, errDay);
+ sql("INSERT INTO timestamp_t VALUES ('1992-02-29 00:00:00')");
+ sql("INSERT INTO timestamp_t VALUES ('2000-02-29 00:00:00')");
+ assertThrows("INSERT INTO timestamp_t VALUES ('02-02-1992 00:00:00')", errType, errDate);
+ assertThrows("INSERT INTO timestamp_t VALUES ('1900-1-1 59:59:23')", errType, errDate);
+ assertThrows("INSERT INTO timestamp_t VALUES ('1900a01a01 00:00:00')", errType, errDate);
+ assertThrows("INSERT INTO timestamp_t VALUES ('1900-1-1 00;00;00')", errType, errDate);
+ assertThrows("INSERT INTO timestamp_t VALUES ('1900-1-1 00a00a00')", errType, errDate);
+ assertThrows("INSERT INTO timestamp_t VALUES ('1900-1-1 00/00/00')", errType, errDate);
+ assertThrows("INSERT INTO timestamp_t VALUES ('1900-1-1 00-00-00')", errType, errDate);
+ }
+
/** */
private void checkDefaultValue(String sqlType, String sqlVal, Object expectedVal) {
try {
diff --git a/modules/calcite/src/test/sql/types/timestamp/test_incorrect_timestamp.test_ignore b/modules/calcite/src/test/sql/types/timestamp/test_incorrect_timestamp.test
similarity index 95%
rename from modules/calcite/src/test/sql/types/timestamp/test_incorrect_timestamp.test_ignore
rename to modules/calcite/src/test/sql/types/timestamp/test_incorrect_timestamp.test
index 8901fc6e3b6..cc64d410c13 100644
--- a/modules/calcite/src/test/sql/types/timestamp/test_incorrect_timestamp.test_ignore
+++ b/modules/calcite/src/test/sql/types/timestamp/test_incorrect_timestamp.test
@@ -1,7 +1,6 @@
# name: test/sql/types/timestamp/test_incorrect_timestamp.test
# description: Test out of range/incorrect timestamp formats
# group: [timestamp]
-# Ignore https://issues.apache.org/jira/browse/IGNITE-15623
statement ok
PRAGMA enable_verification