Fix the CSV serialization/deserialization bug for Time#87622
Fix the CSV serialization/deserialization bug for Time#87622
Conversation
|
Workflow [PR], commit [2ffa20f] Summary: ❌
|
| { | ||
| if (!tryReadTimeText(x, istr) || !checkChar('\'', istr)) | ||
| { | ||
| istr.position() = const_cast<char *>(begin); // rollback on failure |
There was a problem hiding this comment.
This looks incorrect, as the buffer could have changed.
| } | ||
| time_t x = 0; | ||
| ReadBufferFromString buf(time_str); | ||
| // Parse inside an isolated buffer, and fail gracefully if it doesn't fit |
There was a problem hiding this comment.
Why do we need this change?
|
@yariks5s, good news, the error was not anywhere around your code for the Time data type, and these changes are unneeded. The error was introduced in this PR: #51716, @Avogar I recommend @Avogar deprecating that old mis-feature. |
|
I think we can close this PR now as it will not fix the problem completely |
|
The problem not in the #51716, the problem is here: Function Also I noticed that ClickHouse/src/Processors/Formats/IRowInputFormat.cpp Lines 36 to 56 in d8595d7 |
tests/queries/0_stateless/03365_csv_time_deserialization_bug.sql
Outdated
Show resolved
Hide resolved
Co-authored-by: Pavel Kruglov <48961922+Avogar@users.noreply.github.com>
Closes #82407
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix a bug when incorrect type order during CSV deserialization led to the
LOGICAL_ERRORDocumentation entry for user-facing changes