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

cast_booleans does not work with prepared statements #883

Closed
jonathann92 opened this issue Aug 23, 2017 · 3 comments
Closed

cast_booleans does not work with prepared statements #883

jonathann92 opened this issue Aug 23, 2017 · 3 comments
Milestone

Comments

@jonathann92
Copy link

Hi, I initialized the mysql2 client with 'cast_booleans' = true
Then I use a prepared statement to query a table. The boolean returns as '\x01'. When I query with client.query('select boolValue from myTable') then the values will be true or false

@sodabrew
Copy link
Collaborator

What version of mysql2 gem are you using?

Just to check, make sure you use :cast_booleans => true in the connection hash (important that the key is a symbol, not a string).

@jonathann92
Copy link
Author

Hi thanks for replying quickly! I'm using mysql2 (0.4.9 x86-mingw32, 0.4.6 x86-mingw32). I tried using :cast_booleans instead of 'cast_booleans' = true and it still doesnt work for prepared statements

@sodabrew
Copy link
Collaborator

Specifically, :cast_booleans does not work with BIT(1) per tests in #903. Please let me know if you have other data types / column types that also don't work. Apologies for the long delay before I got the specs updated to verify this issue.

@sodabrew sodabrew added this to the 0.4.10 milestone Nov 14, 2017
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

No branches or pull requests

2 participants