|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-03-29 12:18 UTC] krakjoe@php.net
-Status: Open
+Status: Verified
[2016-03-29 12:18 UTC] krakjoe@php.net
[2016-03-29 13:06 UTC] downsider84 at hotmail dot com
[2017-10-24 08:31 UTC] kalle@php.net
-Package: PDO Core
+Package: PDO related
[2020-04-07 11:18 UTC] cmb@php.net
-Type: Bug
+Type: Documentation Problem
[2020-04-07 11:18 UTC] cmb@php.net
[2021-11-16 14:02 UTC] git@php.net
[2021-11-16 14:02 UTC] git@php.net
-Status: Verified
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 20:00:01 2025 UTC |
Description: ------------ The constants MYSQL_ATTR_USE_BUFFERED_QUERY and PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT have the same value, 1000. Setting MYSQL_ATTR_USE_BUFFERED_QUERY when using the pgsql driver causes a "deprecated" warning about PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT. This is non-obvious and potentially difficult to debug. Test script: --------------- ini_set("display_errors", 1); error_reporting(E_ALL); // change credentials as appropriate $dbName = "test"; $host = "locahost"; $username = "root"; $password = ""; $pdo = new \PDO("pgsql:$dbName=db;host=$host", $username, $password); $pdo->setAttribute(\PDO:MYSQL_ATTR_USE_BUFFERED_QUERY, true); Expected result: ---------------- Deprecated: PDO::setAttribute(): PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT is deprecated, use PDO::ATTR_EMULATE_PREPARES instead in [filename] on line [lineno]