Skip to content

fix: round SQLite and Presto timestamps to the millisecond they print - #247

Merged
huandu merged 1 commit into
huandu:masterfrom
SashaMIT:fix/sqlite-millis-round
Oct 4, 2026
Merged

huandu merged 1 commit into
huandu:masterfrom
SashaMIT:fix/sqlite-millis-round

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

SQLite and Presto timestamp literals keep three fractional digits, but the value was only rounded by half a microsecond. 12:23:34.1235 was printed as 12:23:34.123. 12:23:34.9995 was printed as 12:23:34.999. Those flavors now round by half a millisecond. 12:23:34.123456789 is still 12:23:34.123. A MySQL literal still keeps the microseconds: 12:23:34.1235 and 12:23:34.9995.

Test plan

  • TestInterpolateMillisecondRound failed on tip (12:23:34.123 and 12:23:34.999) and passes after the round
  • TestFlavorInterpolate and go test ./...

Half a millisecond was truncated, so 12:23:34.9995 was printed as 12:23:34.999.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 96.17% (+0.003%) from 96.167% — SashaMIT:fix/sqlite-millis-round into huandu:master

@huandu

huandu commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Thanks for your contribution!

@huandu
huandu merged commit a238442 into huandu:master Oct 4, 2026
2 checks passed
@SashaMIT

SashaMIT commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for merging it. The millisecond SQLite and Presto print is the one the timestamp rounds to now.

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