-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add support for BIT type and coerce scalar value to correct types when mysql_server_prepare=0 #53
Conversation
MySQL BIT type store max 64bits, but perl's UV can handle max 32bits. So Based on size it is stored to perl scalar as UV or string. This should fix bug: https://rt.cpan.org/Public/Bug/Display.html?id=88006
…ot used Currently without mysql_server_prepare all fetched scalars are returned as strings which totally ignores MySQL column types. With this patch returned string values are coerced to perl's UV/IV/NV/PV based on column type. So MySQL value of type INT will be returned as integer scalar, not string scalar like with mysql_server_prepare=1.
Looks like travis is broken as it skipped all tests with message:
|
Thanks for your pull request. It looks good! I think I broke Travis and AppVeyor tests myself when I removed creating I'll try look into that later today. Michiel Op zondag 18 september 2016 heeft pali [email protected] het
|
Looks like t/05dbcreate.t is broken, because in that test is call |
PR welcome :D On Mon, Sep 19, 2016 at 9:36 AM, pali [email protected] wrote:
|
Easy, PR is here: #54 Btw, BIT conversion code is updated and simplified. |
Many thanks! |
Your fix seems to fail on MySQL 5.7: |
That is probably windows-related... Is there any way to test some patch for that windows mysql 5.7 test suite? |
You can make a PR and it will run on AppVeyor. And I ran the test suite on my Mac with 5.7 and that produces the same Op maandag 19 september 2016 heeft pali [email protected] het
|
Now I see where could be problem... Error message is: Line 34 is: And there is:
Can you try to change |
Thanks! Of course that worked 👍 |
Without mysql_server_prepare=1 DBD::mysql returns stringified numbers (e.g. "1") for columns of INT type. Second patch fix this problem and coerce scalars to correct perl types.
Both patches adding support for MYSQL_TYPE_BIT. When value has max 32 bits then it is stored as perl unsigned integer. Otherwise as raw string. Address bug: https://rt.cpan.org/Public/Bug/Display.html?id=88006