php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41241 Realization array type. SQL 2003, S091
Submitted: 2007-04-30 13:01 UTC Modified: 2017-10-24 03:05 UTC
Votes:5
Avg. Score:4.2 ± 1.0
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: develar at gmail dot com Assigned: yohgaki (profile)
Status: Assigned Package: PostgreSQL related
PHP Version: * OS: *
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: develar at gmail dot com
New email:
PHP Version: OS:

 

 [2007-04-30 13:01 UTC] develar at gmail dot com
Description:
------------
SQL 2003, S091.

Reproduce code:
---------------
PostgreSQL 8.2

select proargnames from pg_catalog.pg_proc order by proargnames limit 1

Expected result:
----------------
array (
  0 => 
  array (
    'proargnames' => '{"","","",id,uri,time_create,priority_base_time_create,title,time_modify,status,priority_base_title,type_name,leaf,version,author_name,author_surname,author_patronymic,privilege_edit,privilege_delete,privilege_grant}',
  ),
)

Actual result:
--------------
array (
  0 => 
  array (
    'proargnames' => '{"","","",id,uri,time_create,priority_base_time_create,title,time_modify,array (
  0 => 
  array (
    'proargnames' => 
    array (
      0 => '',
      1 => '',
      2 => '',
      3 => 'id',
      4 => 'uri',
      5 => 'time_create',
      6 => 'priority_base_time_create',
      7 => 'title',
      8 => 'time_modify',
      9 => 'status',
      10 => 'priority_base_title',
      11 => 'type_name',
      12 => 'leaf',
      13 => 'version',
      14 => 'author_name',
      15 => 'author_surname',
      16 => 'author_patronymic',
      17 => 'privilege_edit',
      18 => 'privilege_delete',
      19 => 'privilege_grant',
    ),
  ),
)}',
  ),
)

Patches

ojrfmeqj (last revision 2015-01-05 04:49 UTC by sample at email dot tst)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-30 13:06 UTC] develar at gmail dot com
"Actual result" and "Expected result" reverse, excuse me :).
 [2007-04-30 13:20 UTC] develar at gmail dot com
Pdo (pdo_pgsql) supports SQL 2003 T031 - BOOLEAN data type. If I select value of a field, it will be returned with type BOOL.

I ask, that also was supported SQL 2003 S091 - ARRAY data type. If I select proargnames with type text[], I expect, that PDO will return to me array, instead of string.
 [2007-04-30 14:31 UTC] develar at gmail dot com
<?php

$Pdo = new PDO('pgsql:host=localhost port=5432 dbname=postgres user=postgres password=password');
var_export($Pdo->query('select proargnames from pg_catalog.pg_proc order by proargnames limit 1')->fetchAll(PDO::FETCH_ASSOC));

?>

actual:

array (
  0 => 
  array (
    'proargnames' => '{"",x,n}',
  ),
)

expected:

proargnames is array, but not string

array (
  0 => 
  array (
    'proargnames' => 
    array (
      0 => '',
      1 => 'x',
      2 => 'n',
    ),
  ),
)
 [2007-04-30 16:03 UTC] tony2001@php.net
Reclassified as feature request.
 [2011-01-01 23:10 UTC] jani@php.net
-Package: Feature/Change Request +Package: PostgreSQL related
 [2012-03-31 05:35 UTC] yohgaki@php.net
-Assigned To: +Assigned To: yohgaki
 [2012-03-31 05:35 UTC] yohgaki@php.net
Changing return value may break applications. I may implement 

pg_array(mixed $var);

when $var is string, convert to array.
when $var is array, convert to string for query.
 [2013-06-29 03:54 UTC] yohgaki@php.net
-Status: Assigned +Status: Analyzed -Operating System: Windows XP SP2 +Operating System: * -PHP Version: 5.2.1 +PHP Version: *
 [2013-06-29 03:54 UTC] yohgaki@php.net
Multibyte support is mandatory to implement correctly.

This feature won't be implemented until PHP has default multibyte string 
functions.
 [2017-10-24 03:05 UTC] kalle@php.net
-Status: Analyzed +Status: Assigned
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 13:01:29 2024 UTC