You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Mihai Budiu (Jira)" <ji...@apache.org> on 2023/06/07 03:05:00 UTC

[jira] [Created] (CALCITE-5760) SqlOperatorTest::testDateTrunc does not validate results

Mihai Budiu created CALCITE-5760:
------------------------------------

             Summary: SqlOperatorTest::testDateTrunc does not validate results
                 Key: CALCITE-5760
                 URL: https://issues.apache.org/jira/browse/CALCITE-5760
             Project: Calcite
          Issue Type: Bug
          Components: tests
    Affects Versions: 1.34.0
            Reporter: Mihai Budiu


I was trying to reproduce a bug where DATE_TRUNC returns an incorrect result when truncating a constant date to a MILLENNIUM.

I found test cases for DATE_TRUNC in SqlOperatorTest; these test cases do specify the expected result, e.g.:

f.checkScalar("date_trunc(date '2015-02-19', isoyear)",
        "2014-12-29", "DATE NOT NULL");

However, the test fixture uses AbstractSqlTester::check, which ignores the result!

As a proof, one can replace the results with arbitrary strings and the tests will still pass.

I presume that this is not the intent of the test writers. How could this test be fixed to also check the results?

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)