Doc #63781 [NEW]: Several discrepancies between PDO attribute behaviour and documentation

From: Date: Sat, 15 Dec 2012 23:37:08 +0000
Subject: Doc #63781 [NEW]: Several discrepancies between PDO attribute behaviour and documentation
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-9289@lists.php.net to get a copy of this message
From: tomas dot creemers+bugs dot php dot net at gmail dot com Operating system: Windows PHP version: 5.3.19 Package: PDO related Bug Type: Documentation Problem Bug description:Several discrepancies between PDO attribute behaviour and documentation Description: ------------ I have done some checking regarding the availability of PDO attributes and their value type and how these things are documented. The documentation for some attributes notes that the attribute in question is not always present. A user might assume that any attribute that doesn't carry such a note will always be present. This is not the case, which is confusing. Best would be to carefully document which attributes are always present (PDO core) and which are not. If this is not feasible, a warning at the top of the page saying that there is no guarantee for any attribute to exist can alert users to the problem. The type of all attribute's values is always documented, but often wrong. I have included the output of a script I've written to check the PDO constants (http://php.net/manual/en/pdo.constants.php) and PDO_Mysql constants (http://php.net/manual/en/ref.pdo-mysql.php#pdo-mysql.constants) in the "actual result" section. PHP Version => 5.3.19 PDO support => enabled PDO drivers => mysql PDO Driver for MySQL => enabled mysqlnd => enabled Version => mysqlnd 5.0.8-dev - 20102224 - $Id: 65fe78e70ce53d27a6cd578597722950e490b0d0 $ Compression => supported SSL => supported I believe problems #1, #2, #19 and #23 are indicating the documentation missed the "SSL_" part in the constant name. I.e. the documentation talks about PDO::MYSQL_ATTR_CIPHER but the constant is PDO::MYSQL_ATTR_SSL_CIPHER. Test script: --------------- http://pastebin.com/wYF1hmfN Actual result: -------------- #1 MYSQL_ATTR_CIPHER is in the documentation but not defined as a class constant. #2 MYSQL_ATTR_KEY is in the documentation but not defined as a class constant. #3 ATTR_TIMEOUT could not be retrieved but the documentation makes it appear it is always present. #4 ATTR_SERVER_VERSION has type string but is documented as integer. #5 ATTR_CLIENT_VERSION has type string but is documented as integer. #6 ATTR_SERVER_INFO has type string but is documented as integer. #7 ATTR_CONNECTION_STATUS has type string but is documented as integer. #8 ATTR_CURSOR_NAME could not be retrieved but the documentation makes it appear it is always present. #9 ATTR_CURSOR could not be retrieved but the documentation makes it appear it is always present. #10 ATTR_PERSISTENT has type boolean but is documented as integer. #11 ATTR_STATEMENT_CLASS has type array but is documented as integer. #12 ATTR_STRINGIFY_FETCHES could not be retrieved but the documentation makes it appear it is always present. #13 ATTR_MAX_COLUMN_LEN could not be retrieved but the documentation makes it appear it is always present. #14 ATTR_EMULATE_PREPARES could not be retrieved but the documentation makes it appear it is always present. #15 MYSQL_ATTR_LOCAL_INFILE could not be retrieved but the documentation makes it appear it is always present. #16 MYSQL_ATTR_INIT_COMMAND could not be retrieved but the documentation makes it appear it is always present. #17 MYSQL_ATTR_FOUND_ROWS could not be retrieved but the documentation makes it appear it is always present. #18 MYSQL_ATTR_IGNORE_SPACE could not be retrieved but the documentation makes it appear it is always present. #19 MYSQL_ATTR_SSL_KEY is defined as a class constant but is not in the documentation. #20 MYSQL_ATTR_SSL_CERT could not be retrieved but the documentation makes it appear it is always present. #21 MYSQL_ATTR_SSL_CA could not be retrieved but the documentation makes it appear it is always present. #22 MYSQL_ATTR_SSL_CAPATH could not be retrieved but the documentation makes it appear it is always present. #23 MYSQL_ATTR_SSL_CIPHER is defined as a class constant but is not in the documentation. -- Edit bug report at https://bugs.php.net/bug.php?id=63781&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63781&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63781&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63781&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63781&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=63781&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63781&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63781&r=needscript Try newer version: https://bugs.php.net/fix.php?id=63781&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=63781&r=support Expected behavior: https://bugs.php.net/fix.php?id=63781&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63781&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63781&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63781&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63781&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=63781&r=dst IIS Stability: https://bugs.php.net/fix.php?id=63781&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=63781&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63781&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63781&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63781&r=mysqlcfg

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