Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](date) fix the value may be changed during the parsing of date and datetime types #11573

Merged
merged 3 commits into from
Aug 8, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add fe ut
  • Loading branch information
luozenglin committed Aug 7, 2022
commit aa91dc2b9a762cddea1f067332cdd890fe14304c
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,24 @@ public void testDateFormatForDateV2() {
Assert.assertEquals(2023, literal.getYear());
Assert.assertEquals(6, literal.getMonth());
Assert.assertEquals(1, literal.getDay());

literal = new DateLiteral("2020-02-29", Type.DATEV2);
Assert.assertEquals(2020, literal.getYear());
Assert.assertEquals(2, literal.getMonth());
Assert.assertEquals(29, literal.getDay());
} catch (AnalysisException e) {
e.printStackTrace();
hasException = true;
}
Assert.assertFalse(hasException);

try {
new DateLiteral("2022-02-29", Type.DATEV2);
} catch (AnalysisException e) {
e.printStackTrace();
hasException = true;
}
Assert.assertTrue(hasException);
}

@Test
Expand Down