Re: PDO mysql - add feature to enforce single statements?
| From: | Peter Wolanin | Date: | Fri, 28 Nov 2014 19:16:13 +0000 |
| Subject: | Re: PDO mysql - add feature to enforce single statements? | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-79286@lists.php.net to get a copy of this message | ||
>>> > On Mon, Nov 10, 2014 at 12:02 PM, Johannes Schlüter <
>>> > johannes@schlueters.de> wrote:
>>> >
>>> >> On Thu, 2014-11-06 at 19:52 -0500, Peter Wolanin wrote:
>>> >> > Suggested solution: add a PDO attribute that could be set on a
>>> >> > connection or a driver option for PDO::prepare to enforce the limit
>>> >> > of
>>> >> > a single query being prepared or run.
>>> >>
>>> >> The issue is that disabling multi-query implicitly also disables
>>> >> support
>>> >> for stored procedures as the same flag configures handling of
>>> >> operations
>>> >> with multiple result sets. So this probably needs more thoughts
>>> >> especially in order to get "similar" behavior with different
>>> >> databases ... can you add a feature request in the bug tracker for
>>> >> this?
>>> >>
>>> >> johannes
>>> >>
I've just added another test to address the concern from Johannes that
setting this flag would interfere with stored procedures.
It's a partial copy of the existing
ext/pdo_mysql/tests/pdo_mysql_stmt_nextrowset.phpt which has an
expected fail.
The new test uses just native prepare (which does not fail) and runs
the same test for setting the new connection attribute to either false
or true creating a stored procedure that returns multiple result sets.
see: https://github.com/php/php-src/pull/896
Thanks,
Peter