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

The IBM DB2 Statement driver suppresses errors triggered by db2_execute #2954

Closed
morozov opened this issue Dec 28, 2017 · 1 comment
Closed

Comments

@morozov
Copy link
Member

morozov commented Dec 28, 2017

db2_execute() can trigger different kinds of errors internally:

  1. A notice:
    $stmt = $conn->executeQuery('SELECT * FROM users WHERE user_name = ?', [[]]);
    Expected result:
    Notice: Array to string conversion in lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php on line 175
    
    Actual result: nothing. The error is suppressed.
  2. A catchable fatal error:
    $stmt = $conn->executeQuery('SELECT * FROM users WHERE user_name = ?', [new stdClass()]);
    Expected result:
    Catchable fatal error: Object of class stdClass could not be converted to string in lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php on line 175
    
    Actual result: nothing. The script silently exists.

Neither of the errors above seems to be needed/possible to handle on the DBAL level. The first one doesn't make db2_execute() return FALSE, the other cannot be caught using a try/catch block.

@github-actions
Copy link

github-actions bot commented Aug 3, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants