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

Bug fix: the timestamp function should convert to a datetime type #2625

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

fulghum
Copy link
Contributor

@fulghum fulghum commented Aug 8, 2024

MySQL's timestamp function, despite its name, actually returns a datetime type and not a timestamp type.

MySQL example:

mysql -uroot --protocol TCP -e "select timestamp('1000-01-01 00:00:00');" --column-type-info
Field   1:  `timestamp('1000-01-01 00:00:00')`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       DATETIME
Collation:  binary (63)
Length:     19
Max_length: 19
Decimals:   0
Flags:      BINARY 

+----------------------------------+
| timestamp('1000-01-01 00:00:00') |
+----------------------------------+
| 1000-01-01 00:00:00              |
+----------------------------------+

Note: We still need to add support for the second, optional parameter to timestamp().

Customer issue: dolthub/dolt#8236

@timsehn
Copy link
Contributor

timsehn commented Aug 8, 2024

This is some MySQL garbage.

@fulghum
Copy link
Contributor Author

fulghum commented Aug 8, 2024

This is some MySQL garbage.

Yeah, MySQL has some wacky naming in several places 🤷‍♂️

@fulghum fulghum requested a review from jycor August 8, 2024 23:03
Copy link
Contributor

@jycor jycor left a comment

Choose a reason for hiding this comment

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

LGTM

@fulghum fulghum merged commit e035ac0 into main Aug 8, 2024
9 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.

3 participants