php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77066 PDO_INFORMIX generate a empty column name for expressions
Submitted: 2018-10-26 08:36 UTC Modified: 2018-10-26 09:37 UTC
From: as at nsi dot de Assigned:
Status: Open Package: PDO_INFORMIX (PECL)
PHP Version: 7.0.32 OS: All
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-10-26 08:36 UTC] as at nsi dot de
Description:
------------
When I write a Statement:

select 'a', tabname, 'b' from systables;

I execute the the statement with ..->query() and fetch with PDO::FETCH_ASSOC,
then the first and the third column has as name '' and the third column overwrites the first in the resulting row-array.


Test script:
---------------
<?PHP
        $db = new PDO("informix:host=<hostname>; service=<port>; database=sysmaster; server=<INFORMIXSERVER>; protocol=onsoctcp; EnableScrollableCursors=1", "informix", "<userpassword>");

        $stmt = $db->query("select 'a', tabname, 'b' from systables");
        $i = 1;

        while ($row = $stmt->fetch(PDO::FETCH_ASSOC) )
        {
                print_r($row);
                if ( $i++ > 4 ) break;
        }
?>


Expected result:
----------------
The expression columns must be named unique by example expr1, expr2, ... expr<n>.

Actual result:
--------------
Array
(
    [] => b
    [TABNAME] => systables
)
Array
(
    [] => b
    [TABNAME] => syscolumns
)
Array
(
    [] => b
    [TABNAME] => sysindices
)
Array
(
    [] => b
    [TABNAME] => systabauth
)
Array
(
    [] => b
    [TABNAME] => syscolauth
)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-10-26 09:37 UTC] cmb@php.net
-Package: PDO related +Package: PDO_INFORMIX
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 09:01:30 2024 UTC