Skip to content

Implemented clampling DateTime64 values when parsed from float string literal#20543

Closed
Enmk wants to merge 2 commits intoClickHouse:masterfrom
Enmk:DateTime64_toDateTime_from_string_clamping
Closed

Implemented clampling DateTime64 values when parsed from float string literal#20543
Enmk wants to merge 2 commits intoClickHouse:masterfrom
Enmk:DateTime64_toDateTime_from_string_clamping

Conversation

@Enmk
Copy link
Copy Markdown
Contributor

@Enmk Enmk commented Feb 15, 2021

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fixes out of range values for DateTime64 when parsed from float string literal.
...

Detailed description / Documentation draft:

...

By adding documentation, you'll allow users to try your new feature immediately, not when someone else will have time to document it later. Documentation is necessary for all features that affect user experience in any way. You can add brief documentation draft above, or add documentation right into your patch as Markdown files in docs folder.

If you are doing this for the first time, it's recommended to read the lightweight Contributing to ClickHouse Documentation guide first.

Information about CI checks: https://clickhouse.tech/docs/en/development/continuous-integration/

closes: #20494

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Feb 15, 2021
@Enmk Enmk changed the title Implemented clumpling DateTime64 values when parsed from float string… Implemented clampling DateTime64 values when parsed from float string literal Feb 15, 2021
Copy link
Copy Markdown
Member

@alexey-milovidov alexey-milovidov left a comment

Choose a reason for hiding this comment

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

Looks like this patch does not solve the issue:

SELECT toDateTime64(CAST('10000000000.1' AS Decimal64(1)), 1)

@alexey-milovidov alexey-milovidov self-assigned this Feb 17, 2021
@alexey-milovidov
Copy link
Copy Markdown
Member

#19362

@Enmk
Copy link
Copy Markdown
Contributor Author

Enmk commented Feb 17, 2021

Looks like this patch does not solve the issue:

SELECT toDateTime64(CAST('10000000000.1' AS Decimal64(1)), 1)

Addressed that with bc4d5a0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DateTime64: out of bound array access, garbage results.

4 participants