|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-01-09 11:38 UTC] ml-php dot net at bettercom dot de
Description:
------------
The last changes php_pgsql_meta_data cause segfaults in client and
mod_php5
Reproduce code:
---------------
<?php
$dbconn = pg_connect("dbname=*** user=***") or die("Could not connect");
$meta = pg_meta_data($dbconn, 'a_table');
if (is_array($meta)) {
var_dump($meta);
}
?>
Actual result:
--------------
(gdb) bt
#0 0x28606b20 in php_pgsql_meta_data ()
from /usr/local/lib/php/20060613/pgsql.so
#1 0x2860c49b in zif_pg_meta_data ()
from /usr/local/lib/php/20060613/pgsql.so
#2 0x0818be08 in zend_do_fcall_common_helper_SPEC ()
#3 0x0817d639 in execute ()
#4 0x0815ffc2 in zend_execute_scripts ()
#5 0x0811e7b5 in php_execute_script ()
#6 0x081db5e7 in main ()
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 09:00:02 2025 UTC |
part of pgsql.c src = estrdup(table_name); tmp_name = php_strtok_r(src, ".", &tmp_name2); if (!*tmp_name2) { /* Default schema */ tmp_name2 = tmp_name; tmp_name = "public"; } in condition tmp_name2 is NULL if table_name without scheme nameIt works fine for me, see: teste=# SELECT table_schema, table_name FROM information_schema.tables WHERE table_schema = 'public'; table_schema | table_name --------------+------------ public | id var_dump(pg_meta_data($x, 'id')); array(1) { ["id"]=> array(6) { ["num"]=> int(1) ["type"]=> string(4) "int4" ["len"]=> int(4) ["not null"]=> bool(false) ["has default"]=> bool(false) ["array dims"]=> int(0) } }