Skip to content

Support negative MySQL and MariaDB TIME values - #5170

Open
LucaCappelletti94 wants to merge 2 commits into
diesel-rs:mainfrom
LucaCappelletti94:mysql-negative-time
Open

Support negative MySQL and MariaDB TIME values#5170
LucaCappelletti94 wants to merge 2 commits into
diesel-rs:mainfrom
LucaCappelletti94:mysql-negative-time

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Member

MySQL and MariaDB use TIME for signed durations, but Diesel rejects every negative MYSQL_TIME before MysqlTime or custom decoders can inspect it.

This PR only adds support to the sign only for SQL Time, while chrono::NaiveTime and time::Time continue to return a deserialization error because neither type can represent a signed duration. Negative Date, Datetime, and Timestamp values remain rejected at the raw-value boundary.

For this PR I use GPT Sol.

@LucaCappelletti94

Copy link
Copy Markdown
Member Author

Filed Alorel/rust-indexed-db#85 uphill so that the audit CI failure may be fixed, but I see that the last commit in that repo was last year. We'll see.

@LucaCappelletti94
LucaCappelletti94 marked this pull request as ready for review August 27, 2026 18:33
@LucaCappelletti94
LucaCappelletti94 force-pushed the mysql-negative-time branch 2 times, most recently from 85c3920 to 51e1355 Compare August 28, 2026 10:11
@weiznich
weiznich requested a review from a team September 5, 2026 09:49
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