caicancai commented on code in PR #3936:
URL: https://github.com/apache/calcite/pull/3936#discussion_r1739558445


##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -5185,6 +5187,61 @@ void testBitGetFunc(SqlOperatorFixture f, String 
functionName) {
     }
   }
 
+  /** Test case for
+   * <a 
href="https://issues.apache.org/jira/browse/CALCITE-6551";>[CALCITE-6551]
+   * Add DATE_FORMAT function (enabled in MySQL library)</a>. */
+  @Test void testDateFormat() {
+    final SqlOperatorFixture f = fixture()
+        .withTester(t -> TESTER).withLibrary(SqlLibrary.MYSQL);
+    f.setFor(SqlLibraryOperators.DATE_FORMAT);
+    final Locale originalLocale = Locale.getDefault();
+
+    try {
+      Locale.setDefault(Locale.US);
+      f.checkString("date_format(timestamp '2009-10-04 22:23:00', '%W %M %Y')",

Review Comment:
   > > SELECT DATE_FORMAT(timestamp '0000-01-01', '%X %V');
   > 
   > This failed because '0000-01-01' is not a timestamp. You can try:
   > 
   > ```
   > SELECT DATE_FORMAT(data '0000-01-01', '%X %V');
   > ```
   
   0000-01-01 is not even a valid date according to the SQL standard.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to