Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct mysql timestamp encoding for binary protocol #2797

Merged
merged 2 commits into from
Nov 23, 2023

Conversation

sunng87
Copy link
Member

@sunng87 sunng87 commented Nov 23, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

Fixes timestamp encoding for mysql binary protocol as described in #2796

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

Fixes #2796

@sunng87
Copy link
Member Author

sunng87 commented Nov 23, 2023

How mysql encodes date, datetime and timestamp data types: https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_binary_resultset.html

@MichaelScofield
Copy link
Collaborator

@sunng87 Just noticed the a test is failed. Looks like the timezone is not respected. Also wondering if the minimum reproducible codes in the issue can be added as a test case here, it seems helpful.

@sunng87 sunng87 force-pushed the fix/mysql-timestamp-binary branch from 48242ef to 92998ee Compare November 23, 2023 18:36
Copy link

codecov bot commented Nov 23, 2023

Codecov Report

Merging #2797 (92998ee) into develop (102e43a) will decrease coverage by 0.37%.
The diff coverage is 89.47%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2797      +/-   ##
===========================================
- Coverage    84.68%   84.31%   -0.37%     
===========================================
  Files          730      730              
  Lines       113711   113728      +17     
===========================================
- Hits         96291    95892     -399     
- Misses       17420    17836     +416     

@sunng87
Copy link
Member Author

sunng87 commented Nov 23, 2023

Just included reproducible test from my issue.

This patch also updates opensrv and mysql_commons to latest version.

@sunng87 sunng87 added this pull request to the merge queue Nov 23, 2023
Merged via the queue into GreptimeTeam:develop with commit 85eebcb Nov 23, 2023
12 checks passed
@sunng87 sunng87 deleted the fix/mysql-timestamp-binary branch November 23, 2023 19:09
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.

InvalidData while query data using mysql prepared statement
3 participants