Repository navigation
Create TIME(6) columns for Time in MySQL.load - #267
Open
quinnj-bot[bot] wants to merge 3 commits into
Open
quinnj-bot[bot] wants to merge 3 commits into
quinnj-bot[bot] wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A TIME column has no fractional seconds, so the server rounded every loaded Time to the second (MariaDB truncates), and on MySQL a value from 23:59:59.5 up became 24:00:00, which no longer reads back as a Time. DateTime already maps to DATETIME(3) for the same reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The coverage job includes test/protocol/runtests.jl on its own, where Dates is not imported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
MySQL.loadcreates aTIMEcolumn for a JuliaTimecolumn.TIMEhas no fractionalseconds, so the stored values lose them without any error:
Time(12, 0, 0, 500)is stored as12:00:01, and any value from23:59:59.5up becomes24:00:00, which then fails to read back as aTime(
ConversionError: ... outside 0 ≤ t < 24h).Time(12, 0, 0, 500)is stored as12:00:00.2.0 already changed
DateTimefromDATETIMEtoDATETIME(3)for the same reason.What changed
Time => "TIME(6)"in theMySQL.loadtype map (MySQL's finest TIME precision).DATETIME(3)note.Tables that already exist are not altered (
MySQL.loadappends to them as before), andcoltypesstill overrides the generated type.Verification
test/user_workflow.jl(runs in the Docker integration job): loads[Time(12, 0, 0, 500), Time(23, 59, 59, 999, 999), Time(0, 0, 0, 0, 1)]and reads them back.The same steps on main against MySQL 8.4.13 / 8.0.36 raise the 24:00:00
ConversionError,and on MariaDB 11.4.13 return
[Time(12), Time(23, 59, 59), Time(0)]. On this branch allthree servers return the input.
sqltype(Time) == "TIME(6)"(main:"TIME").Pkg.test()on Julia 1.12.6, serverless lanes plus the--trim=safeworkload(
MYSQL_INTEGRATION=0 MYSQL_PERF_GATES=0):MySQL | 1917 1917.Reviewed for: other temporal entries in the map (
DateTime→DATETIME(3),Timestamp{P}→matching precision,
Date→DATEare already exact);Timestamp{Nanosecond}maps toDATETIME(6)and its parameter encoder raises on sub-microsecond values rather thantruncating.
🤖 Generated with Claude Code