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

PDO::ATTR_EMULATE_PREPARES to false does not work with BIT column #12197

Closed
pfz opened this issue Sep 3, 2016 · 2 comments
Closed

PDO::ATTR_EMULATE_PREPARES to false does not work with BIT column #12197

pfz opened this issue Sep 3, 2016 · 2 comments
Labels
stale Stale issue - automatically closed

Comments

@pfz
Copy link
Contributor

pfz commented Sep 3, 2016

We can't use BIT(1) column in a model (boolean) when PDO::ATTR_EMULATE_PREPARES=false is set for the db connection. Insert and update fail.

This script phalcon_orm_datatype_bug.php has been written to test this issue, when used with this options :

#phalcon_orm_datatype_bug.php
$options = [
    'use_bit' => **true**,
    'use_dynamic_update' => **false**,
    'cast_on_hydrate'    => **false**,
    'db' => [
        'options'  => [\PDO::ATTR_EMULATE_PREPARES => **false**],
...

When use_bit=true, it fails. When use_bit=false, I replace BIT(1) by TINYINT(1) then it works, but it is not casted as a boolean anymore.
Furthermore, lastInsertId() returns a string instead of an integer.

Configuration

  • Phalcon 3.0.2
  • Zephir 0.9.4a-dev-cbfe80715d
  • PHP 7.0.10-1~dotdeb+8.1 (cli) ( NTS )
  • MariaDB 10.1.16
@pfz
Copy link
Contributor Author

pfz commented Jun 4, 2017

Up. Has anyone the same problem ? Still on with 3.2.0a

@stale
Copy link

stale bot commented Apr 16, 2018

Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues

@stale stale bot added the stale Stale issue - automatically closed label Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale issue - automatically closed
Projects
None yet
Development

No branches or pull requests

2 participants