Skip to content

bug: Modify MySQL connection URL to use system timezone#134

Merged
debba merged 1 commit intodebba:mainfrom
thomaswasle:bug/mysql-connections-always-use-utc-time
Apr 15, 2026
Merged

bug: Modify MySQL connection URL to use system timezone#134
debba merged 1 commit intodebba:mainfrom
thomaswasle:bug/mysql-connections-always-use-utc-time

Conversation

@thomaswasle
Copy link
Copy Markdown
Contributor

In pool_manager.rs:43, the MySQL connection URL has no timezone parameter. The sqlx MySQL driver defaults to setting time_zone='UTC' on every connection, so NOW() always returns UTC regardless of the server or user's local timezone.

The fix is to add timezone=SYSTEM to the connection URL, which tells MySQL to use the server's configured system timezone instead of being forced to UTC.

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot bot commented Apr 14, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Analysis: The PR reapplies the timezone fix after the codebase refactoring. The original fix (adding timezone=SYSTEM to the MySQL connection URL) was lost when build_mysql_url was replaced with build_mysql_options using the MySqlConnectOptions builder pattern.

Change verified:

  • src-tauri/src/pool_manager.rs - Line 55-56: Adds .timezone("SYSTEM".to_string()) to the MySQL connection options builder

This correctly instructs the sqlx MySQL driver to use the server's configured system timezone instead of forcing UTC, which addresses the original bug described in the PR.


Reviewed by kimi-k2.5-0127 · 569,408 tokens

@thomaswasle thomaswasle force-pushed the bug/mysql-connections-always-use-utc-time branch from 17fae8b to b46305d Compare April 15, 2026 12:49
@thomaswasle
Copy link
Copy Markdown
Contributor Author

I updated my PR to fix a conflict after the main branch changed.

@debba
Copy link
Copy Markdown
Owner

debba commented Apr 15, 2026

That's great, thanks a lot for this, and sorry I was working on code refactoring in builtin drivers

@debba debba merged commit ba9340f into debba:main Apr 15, 2026
2 checks passed
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.

2 participants