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(cast-format): Throw exception when value cannot be found for specific pattern in string to datetime conversion #8501

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

TreeHunter9
Copy link
Contributor

  • Example: CAST('A.M. 8' as time format 'MI A.M. HH12') where value for MI pattern is missing;
  • Handle integer overflow when converting string to int by using std::from_chars;
  • Add tests for missing values and integer overflow;

Artyom Ivanov added 2 commits April 3, 2025 15:05
…ific pattern in string to datetime conversion

- Example: CAST('A.M. 8' as time format 'MI A.M. HH12') where value for MI pattern is missing;
- Handle integer overflow when converting string to int;
@dyemanov
Copy link
Member

dyemanov commented Apr 7, 2025

Looks like CvtTest.cpp fails on Alpine and Windows 2019, while works OK on other platforms. Could you please take a look? And please also resolve the conflicts.

@TreeHunter9
Copy link
Contributor Author

TreeHunter9 commented Apr 7, 2025

As I can see, all tests where we need to parse number are failing, but tests where we parse strings are fine. I guess the problem is std::from_chars, maybe I'm handling its result incorrectly somehow and it cause UB in some compilers, I'll look into it.

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.

2 participants