Doc #61969 [Opn->Csd]: emulate prepares default on needs to be clearly documented

From: Date: Tue, 16 Mar 2021 13:00:16 +0000
Subject: Doc #61969 [Opn->Csd]: emulate prepares default on needs to be clearly documented
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18638@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61969&edit=1

 ID:                 61969
 Updated by:         cmb@php.net
 Reported by:        crmalibu at gmail dot com
 Summary:            emulate prepares default on needs to be clearly
                     documented
-Status:             Open
+Status:             Closed
 Type:               Documentation Problem
 Package:            PDO related
 PHP Version:        5.4.2
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

This has already been fixed.  The docs now properly state:

| PDO_MYSQL uses emulated prepares by default.


Previous Comments:
------------------------------------------------------------------------
[2013-01-03 07:02:25] philip@php.net

Interesting, I stumbled upon this topic today and will be documenting it. 
And nice MYSQL_ATTR_DIRECT_QUERY tip, I'll steal that... :)

------------------------------------------------------------------------
[2012-05-21 15:23:08] jpauli@php.net

I'd like to add that PDO::MYSQL_ATTR_DIRECT_QUERY does exactly the same thing as
PDO::ATTR_EMULATE_PREPARES, they are just synonyms.
This can be quickly seen in source code : http://lxr.php.net/xref/PHP_5_4/ext/pdo_mysql/mysql_driver.c#390

Also, note that PDO::getAttribute() wont show you PDO::ATTR_EMULATE_PREPARES as it has not been
implemented in the get() handler for pdo_mysql driver, referer here : http://lxr.php.net/xref/PHP_5_4/ext/pdo_mysql/mysql_driver.c#417
However, PDO::MYSQL_ATTR_DIRECT_QUERY has been

------------------------------------------------------------------------
[2012-05-07 17:50:41] crmalibu at gmail dot com

Description:
------------
On this page http://php.net/manual/en/ref.pdo-mysql.php I
quote

"PDO_MYSQL will take advantage of native prepared statement support present in MySQL 4.1 and
higher. If you're using an older version of the mysql client libraries, PDO will emulate them
for you."

I think the default setting of PDO::ATTR_EMULATE_PREPARES being on conflicts with my quote. It
should say that its capable of taking advantage, but the default is to emulate.

semi related bug report on the setting https://bugs.php.net/bug.php?id=54638

Test script:
---------------
none

Expected result:
----------------
none

Actual result:
--------------
none


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=61969&edit=1


Thread (5 messages)

« previous php.doc.bugs (#18638) next »