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

Issue with "T" when using str_to_date #8807

Closed
kylebrandt opened this issue Feb 3, 2025 · 3 comments · Fixed by dolthub/go-mysql-server#2839
Closed

Issue with "T" when using str_to_date #8807

kylebrandt opened this issue Feb 3, 2025 · 3 comments · Fixed by dolthub/go-mysql-server#2839
Assignees
Labels
bug Something isn't working correctness We don't return the same result as MySQL customer issue

Comments

@kylebrandt
Copy link

kylebrandt commented Feb 3, 2025

When there is a literal T null is returned.

$ mysql --host=127.0.0.1 --port=3306 --user=root mydb --execute="select str_to_date('2025-02-03T3:00:00','%Y-%m-%dT%H:%i:%s') as ts;"
+------+
| ts   |
+------+
| NULL |
+------+

$ mysql --host=127.0.0.1 --port=3306 --user=root mydb --execute="select str_to_date('2025-02-03-3:00:00','%Y-%m-%d-%H:%i:%s') as ts;"
+---------------------+
| ts                  |
+---------------------+
| 2025-02-03 03:00:00 |
+---------------------+
@kylebrandt
Copy link
Author

(Also, when I go over the sql.Row the interface{} is a string (with the working one), thought it would be a time.Time?

@jycor jycor transferred this issue from dolthub/go-mysql-server Feb 3, 2025
@jycor
Copy link
Contributor

jycor commented Feb 3, 2025

Hey @kylebrandt , thanks for reporting this issue. I moved it to dolt for more visibility.
I can reproduce the bug and can confirm it does not alilgn with MySQL behavior.
We'll start on a fix for this ASAP!

@jycor
Copy link
Contributor

jycor commented Feb 5, 2025

Hey @kylebrandt , the fix for this has been merged to GMS and is making its way to dolt main.
Expect a dolt release with the fix later this week.

@jycor jycor self-assigned this Feb 5, 2025
samjewell added a commit to grafana/grafana that referenced this issue Feb 6, 2025
This is so we receive a few bug fixes - fixes to these issues:

- dolthub/dolt#8807
- dolthub/dolt#8735
- dolthub/dolt#8724
samjewell added a commit to grafana/grafana that referenced this issue Feb 6, 2025
Bump go-mysql-server dependency to `main`

This is so we receive a few bug fixes - fixes to these issues:

- dolthub/dolt#8807
- dolthub/dolt#8735
- dolthub/dolt#8724
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctness We don't return the same result as MySQL customer issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants