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

sql/expression/function: Add UNIX_TIMESTAMP function. #63

Merged
merged 2 commits into from
Feb 13, 2020

Conversation

reltuk
Copy link
Contributor

@reltuk reltuk commented Feb 12, 2020

No description provided.

@reltuk reltuk requested a review from zachmu February 12, 2020 23:10
Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

LGTM but confused why this isn't an integer expression.

return sql.Float64.Convert(ut.clock().Unix())
}

date, err := ut.Date.Eval(ctx, row)
Copy link
Member

Choose a reason for hiding this comment

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

Fix formatting

}

func (ut *UnixTimestamp) Type() sql.Type {
return sql.Float64
Copy link
Member

Choose a reason for hiding this comment

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

Why not int?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MySQL returns fractional seconds if the underlying value includes fractional seconds. I meant to include that here...

@reltuk reltuk merged commit 294cb16 into ld-master Feb 13, 2020
@Hydrocharged Hydrocharged deleted the aaron/unix-timestamp-func branch April 23, 2020 18:39
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.

None yet

2 participants