Skip to content

Conversation

@jycor
Copy link
Contributor

@jycor jycor commented Mar 27, 2025

Changes:

  • have datetime_type equality to also compare precision
  • retain precision for date and datetime types in a table

fixes: dolthub/dolt#9025


const MaxUnixTimeMicroSecs = 32536771199999999

// noEval returns true if the expression contains an expression that cannot be evaluated without sql.Context or sql.Row.
Copy link
Contributor

Choose a reason for hiding this comment

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

update comment

Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

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

lgtm

Comment on lines 353 to 356
if dtType, isDtType := otherType.(sql.DatetimeType); isDtType {
return t.baseType == dtType.Type() && t.precision == dtType.Precision()
}
return t.baseType == otherType.Type()
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe?

Suggested change
if dtType, isDtType := otherType.(sql.DatetimeType); isDtType {
return t.baseType == dtType.Type() && t.precision == dtType.Precision()
}
return t.baseType == otherType.Type()
if dtType, isDtType := otherType.(sql.DatetimeType); isDtType {
return t.precision == dtType.Precision()
}
return false

@jycor jycor merged commit 8d4a7bc into main Mar 28, 2025
8 checks passed
@jycor jycor deleted the james/time branch March 28, 2025 18:53
nicktobey pushed a commit that referenced this pull request Mar 28, 2025
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.

unix_timestamp's precision should keep with parameter

3 participants