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

Adjusting date/time handling #2097

Merged
merged 2 commits into from
Jan 20, 2025
Merged

Conversation

Paultagoras
Copy link
Contributor

@Paultagoras Paultagoras commented Jan 20, 2025

Summary

  • Adjusting PreparedStatement encoding to handle Instant
  • Adjusting calendar usages to avoid setTime
  • Adjusting tests to use local timezone (because new Date/Time/Timestamp all show the local timezone)

Closes #2089

Checklist

Delete items not relevant to your PR:

  • Closes #
  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@Paultagoras Paultagoras self-assigned this Jan 20, 2025
Copy link
Contributor

@mzitnik mzitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -269,42 +269,42 @@ public ResultSetMetaData getMetaData() throws SQLException {
public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException {
checkClosed();
if (cal == null) {
cal = new GregorianCalendar();
cal.setTime(x);
cal = new GregorianCalendar(TimeZone.getTimeZone("UTC"));//This says whatever date is in UTC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have default for it

@Paultagoras Paultagoras merged commit c1478f9 into main Jan 20, 2025
30 checks passed
@Paultagoras Paultagoras deleted the handle-datetimes-with-calendar branch January 20, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[jdbc-v2] date/dateTime tests fail when client timezone not UTC/GMT
2 participants