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

Make MYSQL_TYPE_DATETIME packet length to 11 #29

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

metacortex
Copy link

According to doc, valid length values are 0, 4, 7, 11.
https://dev.mysql.com/doc/internals/en/binary-protocol-value.html

Sometimes DateTime type param is truncated to '' by the following param.

(Before)
170310  4:15:46	 1899 Connect	root@localhost on jericho
		 1899 Prepare	SELECT posts.* FROM posts WHERE posted_at BETWEEN ? AND ? LIMIT 5
		 1899 Execute	SELECT posts.* FROM posts WHERE posted_at BETWEEN '' AND '2017-03-03 15:59:59' LIMIT 5

(After)
170310  4:15:56	 1900 Connect	root@localhost on jericho
		 1900 Prepare	SELECT posts.* FROM posts WHERE posted_at BETWEEN ? AND ? LIMIT 5
		 1900 Execute	SELECT posts.* FROM posts WHERE posted_at BETWEEN '2017-03-02 16:00:00' AND '2017-03-03 15:59:59' LIMIT 5

mysql Ver 14.14 Distrib 5.6.34, for osx10.12 (x86_64) using EditLine wrapper

Crystal 0.21.1 (2017-03-07) LLVM 3.9.1

@metacortex
Copy link
Author

In my MacBook, running spec in the docker image MySQL:5.7 has passed successfully.

@bcardiff
Copy link
Member

@metacortex the PR has twice v.millisecond*1000/65536, may you clean the history of this and a spec that would fail before the change but passes after it?

@metacortex
Copy link
Author

@bcardiff Fixed it. Thanks

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