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

OCI8 binding prepared statements #3722

Closed
matesko opened this issue Nov 8, 2019 · 3 comments
Closed

OCI8 binding prepared statements #3722

matesko opened this issue Nov 8, 2019 · 3 comments

Comments

@matesko
Copy link

matesko commented Nov 8, 2019

BC Break Report

Q A
BC Break yes
Version 2.10

Summary

After update to 2.10 variable binding not working as before. Various errors are thrown, for example ORA-01036 on select statements, and ORA-01008 on update statements

Previous behaviour

Working with no issues

Current behavior

query example:

update rates
set
    rate_fixing = :rate
where
    to_char(rate_date, 'DD.MM.YYYY') = :d
    and currency = :cur

execution code:

         $r = $q->execute(
                    [
                        ':rate'     => round($t['rate'], 6),
                        ':d' => $t['date'],
                        ':cur'   => $t['currency'],
                    ]
                );
request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\DBALException: "An exception occurred while executing 'update rates set     rate_fixing = :rate where     to_char(rate_date, 'DD.MM.YYYY') = :d and currency = :cur' with params [6.69515, "11.09.2019", "USD"]:  Notice: Undefined index: :rate" at G:\apache_root\s4\dan\vendor\doctrine\dbal\lib\Doctrine\DBAL\DBALException.php line 169 {"exception":"[object] (Doctrine\\DBAL\\DBALException(code: 0): An exception occurred while executing 'update rates\r\nset\r\n    rate_fixing = :rate\r\nwhere\r\n    to_char(rate_date, 'DD.MM.YYYY') = :d\r\n    and currency = :cur' with params [6.69515, \"11.09.2019\", \"USD\"]:\n\nNotice: Undefined index: :rate at G:\\apache_root\\s4\\dan\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\DBALException.php:169, ErrorException(code: 0): Notice: Undefined index: :rate at G:\\apache_root\\s4\\dan\\vendor\\doctrine\\dbal\\lib\\Doctrine\\DBAL\\Driver\\OCI8\\OCI8Statement.php:281)"} []

How to reproduce

@matesko
Copy link
Author

matesko commented Nov 8, 2019

The culprit is commit 7bafa27 (PHPStan Level 7 )

lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
line 277
$column = $this->_paramMap[$column] ?? $column;

?? $column

was removed

@morozov
Copy link
Member

morozov commented Dec 21, 2019

Fixed by #3738.

@morozov morozov closed this as completed Dec 21, 2019
@github-actions
Copy link

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 Jul 30, 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