Skip to content

Conversation

@hubgeter
Copy link
Contributor

bp #53050
Related PR: #40695
Problem Summary:

pr #40695 introduced the function from_iso8601_date, which parses the string to get year、mouth、 day, and sets the date value through the set_time_unit function.
Since set_time_unit lacks some judgment on mouth, it may get an illegal date in the end, which may cause core in debug mode.

sql : select from_iso8601_date('2023-00-01');

F20250709 09:50:14.366984 3587796 vdatetime_value.h:1222] Check failed: date_v2_value_.month_ != 0
*** Check failure stack trace: ***
    @     0x559bd7050d96  google::LogMessage::SendToLog()
    @     0x559bd704d7e0  google::LogMessage::Flush()
    @     0x559bd70515d9  google::LogMessageFatal::~LogMessageFatal()
    @     0x559bc725a570  doris::DateV2Value<>::set_time_unit<>()
    @     0x559bc7257380  doris::vectorized::FromIso8601DateV2::execute()
    @     0x559bc7255a88  doris::vectorized::FunctionOtherTypesToDateType<>::execute_impl()
    @     0x559bc09e0781  doris::vectorized::DefaultExecutable::execute_impl()
    @     0x559bc423aa20  doris::vectorized::PreparedFunctionImpl::_execute_skipped_constant_deal()
    @     0x559bc4234938  doris::vectorized::PreparedFunctionImpl::execute_without_low_cardinality_columns()
    @     0x559bc4233f42  doris::vectorized::PreparedFunctionImpl::default_implementation_for_nulls()
    @     0x559bc423a773  doris::vectorized::PreparedFunctionImpl::_execute_skipped_constant_deal()
    @     0x559bc4234938  doris::vectorized::PreparedFunctionImpl::execute_without_low_cardinality_columns()
    @     0x559bc4234a57  doris::vectorized::PreparedFunctionImpl::execute()

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

Related PR: apache#40695
Problem Summary:

pr apache#40695 introduced the function `from_iso8601_date`, which parses the
string to get year、mouth、 day, and sets the date value through the
`set_time_unit` function.
Since `set_time_unit` lacks some judgment on mouth, it may get an
illegal date in the end, which may cause core in debug mode.

sql : `select from_iso8601_date('2023-00-01');`
```
F20250709 09:50:14.366984 3587796 vdatetime_value.h:1222] Check failed: date_v2_value_.month_ != 0
*** Check failure stack trace: ***
    @     0x559bd7050d96  google::LogMessage::SendToLog()
    @     0x559bd704d7e0  google::LogMessage::Flush()
    @     0x559bd70515d9  google::LogMessageFatal::~LogMessageFatal()
    @     0x559bc725a570  doris::DateV2Value<>::set_time_unit<>()
    @     0x559bc7257380  doris::vectorized::FromIso8601DateV2::execute()
    @     0x559bc7255a88  doris::vectorized::FunctionOtherTypesToDateType<>::execute_impl()
    @     0x559bc09e0781  doris::vectorized::DefaultExecutable::execute_impl()
    @     0x559bc423aa20  doris::vectorized::PreparedFunctionImpl::_execute_skipped_constant_deal()
    @     0x559bc4234938  doris::vectorized::PreparedFunctionImpl::execute_without_low_cardinality_columns()
    @     0x559bc4233f42  doris::vectorized::PreparedFunctionImpl::default_implementation_for_nulls()
    @     0x559bc423a773  doris::vectorized::PreparedFunctionImpl::_execute_skipped_constant_deal()
    @     0x559bc4234938  doris::vectorized::PreparedFunctionImpl::execute_without_low_cardinality_columns()
    @     0x559bc4234a57  doris::vectorized::PreparedFunctionImpl::execute()
```
@hubgeter hubgeter requested a review from yiguolei as a code owner July 17, 2025 06:29
@hubgeter
Copy link
Contributor Author

run buildall

@hubgeter hubgeter changed the title [fix](function)fix month=0 of from_iso8601_date function. (#53050) branch-2.1:[fix](function)fix month=0 of from_iso8601_date function. (#53050) Jul 17, 2025
@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 100.00% (6/6) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 39.09% (10349/26473)
Line Coverage 30.10% (86049/285836)
Region Coverage 28.81% (44460/154308)
Branch Coverage 25.52% (22754/89154)

@yiguolei yiguolei merged commit e8d1878 into apache:branch-2.1 Jul 18, 2025
20 of 21 checks passed
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.

4 participants