Bug #75271 [NEW]: ODBC query result contains random memory blocks, source code
| From: | charlie at csdv dot co | Date: | Wed, 27 Sep 2017 23:31:36 +0000 |
| Subject: | Bug #75271 [NEW]: ODBC query result contains random memory blocks, source code | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-211403@lists.php.net to get a copy of this message | ||
From: charlie at csdv dot co
Operating system: Windows, MacOS
PHP version: 7.1.9
Package: PDO ODBC
Bug Type: Bug
Bug description:ODBC query result contains random memory blocks, source code
Description:
------------
Behavior exists in 5.5, 5.6, and 7.1.
When querying a database via PDO ODBC, some fields are returning
unexpected results which appear to be uninitialized memory, bits of the
source PHP file that ran the script, other PHP files that were included,
etc.
I've run this same query via Golang and other GUIs and the correct data
is returned.
Example output:
Array
(
[0] => Array
(
[body] => Lorem ipsum�/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
Since it's working as expected when querying via other languages/tools,
I'm thinking the issue is within PDO and not the driver. Any direction
on this issue would be much appreciated.
Test script:
---------------
$connection = new
PDO("odbc:Driver=driver;Server=hostname;Database=dbname;Uid=uid;Pwd=pwd;");
$result = $connection
->query("SELECT body FROM posts WHERE id = 123")
->fetchAll(PDO::FETCH_ASSOC);
print_r($result);
--
Edit bug report at https://bugs.php.net/bug.php?id=75271&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75271&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75271&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75271&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75271&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75271&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75271&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75271&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75271&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75271&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75271&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75271&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75271&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75271&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75271&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75271&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75271&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75271&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75271&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75271&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75271&r=mysqlcfg