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

support to_days() and from_days() #2456

Merged
merged 6 commits into from
Apr 15, 2024
Merged

support to_days() and from_days() #2456

merged 6 commits into from
Apr 15, 2024

Conversation

jycor
Copy link
Contributor

@jycor jycor commented Apr 15, 2024

This PR implements the TO_DAYS and FROM_DAYS MySQL functions.
Initially, I attempted to use the existing logic from Add/Sub Date along with the 0 year, but there were overflow issues.
So, there's a skipped test for Intervals.

to_days docs:
https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_to-days

from_days docs:
https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_from-days

Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

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

Looks good!

sql/expression/function/days.go Outdated Show resolved Hide resolved
sql/expression/function/days.go Outdated Show resolved Hide resolved
sql/expression/function/days.go Outdated Show resolved Hide resolved
sql/expression/function/days.go Outdated Show resolved Hide resolved
sql/expression/function/days.go Outdated Show resolved Hide resolved
@jycor jycor merged commit 483f5cc into main Apr 15, 2024
7 checks passed
@jycor jycor deleted the james/days branch April 15, 2024 23:57
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