Repository navigation
fix: Bind hms values of 256 hours or more without wrapping around - #616
Merged
Merged
Conversation
Closes #609. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ
Member
Author
Accepted limitationsThe clean review found nothing above Low.
Generated by Claude Code |
krlmlr
marked this pull request as ready for review
November 29, 2026 12:14
This was referenced Nov 29, 2026
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.
Closes #609. Stacked on #610.
Before this change, a bound
hmsof 256 hours or more was stored modulo 256 hours inTIMEcolumns: 256:00:00 became 00:00:00, and 300:00:00 became 44:00:00. All hours went into thehourfield ofMYSQL_TIME, but the binary protocol sends aTIMEvalue as days plus an hour byte.Change
TIME, whole days now go intoday, and the rest goes throughset_time_buffer().negcomes from the full value, so -24:00:00 keeps its sign.DATETIMEis unchanged.TIME's range (±838:59:59) are clamped by the server, without a warning and also underSTRICT_TRANS_TABLES. Before, they wrapped around. The clamping is left to the server.Tests
tests/testthat/test-bind-microseconds.Rgains a block for 255, 256, 300 and 838:59:59.999999 hours and their negatives. It fails without the fix when linked to libmysqlclient 8.0. With the fix, it passes against MariaDB 10.11 with both libmysqlclient 8.0 and MariaDB Connector/C 3.3.17. The whole suite had 0 failures and the onetest-timezone.Rerror ("US/Alaska" unknown to CCTZ in this container), which also happens onmain. MySQL servers were not tested: there is no server in this container, and CI's MySQL entries currently run MariaDB (#592).Session: https://claude.ai/code/session_01Hr1rd5PUWgaCJzotWt9NhJ
Generated by Claude Code