Bug #75271 [Opn->Fbk]: ODBC query result contains random memory blocks, source code
| From: | ab@php.net | Date: | Thu, 28 Sep 2017 08:53:13 +0000 |
| Subject: | Bug #75271 [Opn->Fbk]: ODBC query result contains random memory blocks, source code | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-211410@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75271&edit=1
ID: 75271
Updated by: ab@php.net
Reported by: charlie at csdv dot co
Summary: ODBC query result contains random memory blocks,
source code
-Status: Open
+Status: Feedback
Type: Bug
Package: PDO ODBC
Operating System: Windows, MacOS
PHP Version: 7.1.9
Block user comment: N
Private report: N
New Comment:
Thanks for the report. Please post also the table definition, the relevant data and the expected
result, too. Which particular driver is involved?
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2017-09-27 23:31:33] charlie at csdv dot co
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 this bug report at https://bugs.php.net/bug.php?id=75271&edit=1