Skip to content

Create TIME(6) columns for Time in MySQL.load - #267

Open
quinnj-bot[bot] wants to merge 3 commits into
mainfrom
claude/load-time-fsp
Open

quinnj-bot[bot] wants to merge 3 commits into
mainfrom
claude/load-time-fsp

Conversation

@quinnj-bot

@quinnj-bot quinnj-bot Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Why

MySQL.load creates a TIME column for a Julia Time column. TIME has no fractional
seconds, so the stored values lose them without any error:

  • MySQL 8.4 / 8.0 round: Time(12, 0, 0, 500) is stored as 12:00:01, and any value from
    23:59:59.5 up becomes 24:00:00, which then fails to read back as a Time
    (ConversionError: ... outside 0 ≤ t < 24h).
  • MariaDB 11.4 truncates: Time(12, 0, 0, 500) is stored as 12:00:00.

2.0 already changed DateTime from DATETIME to DATETIME(3) for the same reason.

What changed

  • Time => "TIME(6)" in the MySQL.load type map (MySQL's finest TIME precision).
  • Migration guide: one sentence next to the DATETIME(3) note.

Tables that already exist are not altered (MySQL.load appends to them as before), and
coltypes still overrides the generated type.

Verification

  • New live test in 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 all
    three servers return the input.
  • Serverless assertion sqltype(Time) == "TIME(6)" (main: "TIME").
  • Local Pkg.test() on Julia 1.12.6, serverless lanes plus the --trim=safe workload
    (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 → DATE are already exact); Timestamp{Nanosecond} maps to
DATETIME(6) and its parameter encoder raises on sub-microsecond values rather than
truncating.

🤖 Generated with Claude Code

quinnj and others added 3 commits November 19, 2026 03:18
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

No deployments
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.

1 participant