This is an automated email from the ASF dual-hosted git repository.

mbudiu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/main by this push:
     new 48f0424c1a [CALCITE-6572] Add more tests for NULL arguments to TO_CHAR 
functions
48f0424c1a is described below

commit 48f0424c1ae5e2152a07ca5eb2c1d835371c24dc
Author: Norman Jordan <[email protected]>
AuthorDate: Wed Sep 11 14:10:45 2024 -0700

    [CALCITE-6572] Add more tests for NULL arguments to TO_CHAR functions
    
    * Added a test for first argument NULL without a cast
    * Added a test for both arguments NULL without a cast
---
 testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java 
b/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java
index 825364586c..38758cc991 100644
--- a/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java
+++ b/testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java
@@ -4893,7 +4893,8 @@ public class SqlOperatorTest {
       f.checkNull("to_char(timestamp '2022-06-03 12:15:48.678', NULL)");
       f.checkNull("to_char(cast(NULL as timestamp), NULL)");
       f.checkNull("to_char(cast(NULL as timestamp), 'Day')");
-    };
+      f.checkNull("to_char(NULL, 'Day')");
+      f.checkNull("to_char(NULL, NULL)");    };
     final List<SqlLibrary> libraries =
         list(SqlLibrary.MYSQL, SqlLibrary.ORACLE, SqlLibrary.REDSHIFT);
     f0.forEachLibrary(libraries, consumer);
@@ -5161,6 +5162,8 @@ public class SqlOperatorTest {
       f.checkNull("to_char(timestamp '2022-06-03 12:15:48.678', NULL)");
       f.checkNull("to_char(cast(NULL as timestamp), NULL)");
       f.checkNull("to_char(cast(NULL as timestamp), 'Day')");
+      f.checkNull("to_char(NULL, 'Day')");
+      f.checkNull("to_char(NULL, NULL)");
     } finally {
       Locale.setDefault(originalLocale);
     }

Reply via email to