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

Cannot read from/write to MySQL BIT fields #3118

Closed
davidcochrum opened this issue May 20, 2016 · 1 comment
Closed

Cannot read from/write to MySQL BIT fields #3118

davidcochrum opened this issue May 20, 2016 · 1 comment
Labels
Db

Comments

@davidcochrum
Copy link
Contributor

@davidcochrum davidcochrum commented May 20, 2016

We use BIT(1) columns in a number of tables for booleans. When attempting to write to one of those fields (using haveInDatabase()):

[PDOException] SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'active' at row 1

When attempting to verify a record exists matching the boolean value (using seeInDatabase()):

No matching records found for criteria {"active":0} in table ...

Obviously this is a bit of a conundrum and I don't know of any sweeping, reliable solution.

@DavertMik
Copy link
Member

@DavertMik DavertMik commented May 21, 2016

Obviously this is a bit of a conundrum and I don't know of any sweeping, reliable solution.

Yes, Codeception is not an ORM so we are not trying to support all RBMS 100%. It's not a core feature. However, I encourage you to contribute. There is a Db module and Mysql Driver in Codeception\Lib\Driver\Mysql for it. Please check it out, maybe you will get an idea how to fix it.

Send a pull request then.

@DavertMik DavertMik added the Db label May 21, 2016
davidcochrum added a commit to davidcochrum/Codeception that referenced this issue May 23, 2016
davidcochrum added a commit to davidcochrum/Codeception that referenced this issue May 23, 2016
@Naktibalda Naktibalda closed this May 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.