-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[DBAL-920] Use PDO::PGSQL_ATTR_DISABLE_PREPARES by default #714
Conversation
Don't you think this is overly aggressive? |
how so? |
Well you are disabling all prepared statements on 5.6. |
Yes, that's the point. I believe that the most common scenario is to execute each query only once. Always preparing the queries server side is a waste of time and resources. |
Of course the change wouldn't be ok for a patch release, but worth considering for a major/minor. |
$this->_constructPdoDsn($params), | ||
$username, | ||
$password, | ||
$driverOptions | ||
); | ||
|
||
if (PHP_VERSION_ID >= 50600) { | ||
$pdo->setAttribute(\PDO::PGSQL_ATTR_DISABLE_PREPARES, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May still want to skip this block if $driverOptions
includes something for \PDO::PGSQL_ATTR_DISABLE_PREPARES
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point
@mbeccati I'm manually removing mbeccati/dbal@3c548dc: never merge master into a working branch (it causes hell when git bisecting afterwards), rebase instead. |
…E_PREPARES` is set when using pgsql on PHP 5.6+
As of c66c41e I'm having tests for this issue, but it seems that |
The second is marked as |
Couldn't care less about their SNAFU :-) |
I'll see what I can do about it (next week, currently at pgday 2014 ;) ) |
Manually merged :-) |
thanks :) |
…R_DISABLE_PREPARES` is set when using pgsql on PHP 5.6+
…en defined and not set to `true`
…th test specification
…ATTR_DISABLE_PREPARES) as per https://bugs.php.net/bug.php?id=68351
See http://www.doctrine-project.org/jira/browse/DBAL-920