php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75271 ODBC query result contains random memory blocks, source code
Submitted: 2017-09-27 23:31 UTC Modified: 2017-11-05 04:22 UTC
From: charlie at csdv dot co Assigned:
Status: No Feedback Package: PDO ODBC
PHP Version: 7.1.9 OS: Windows, MacOS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: charlie at csdv dot co
New email:
PHP Version: OS:

 

 [2017-09-27 23:31 UTC] 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);



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-28 08:53 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2017-09-28 08:53 UTC] ab@php.net
Thanks for the report. Please post also the table definition, the relevant data and the expected result, too. Which particular driver is involved?

Thanks.
 [2017-11-05 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Jun 07 22:03:40 2023 UTC