ID: 45598 Comment by: phil dot nyc at gmail dot com Reported By: phil dot nyc at gmail dot com Status: Open Bug Type: ODBC related Operating System: Aix 5.3 64-bit PHP Version: 5.3CVS-2008-07-22 (snap) New Comment:
I would like to follow up with a more detailed report that I've been able to collect after spinning in circles on this problem for the last couple of days (have gone through various versions of php5 and php4 and compilers, and this is as close as I get) ========= SYSTEM SPECS ========= uname -a AIX unnamed12a 3 5 000AD01ED700 CC=xlc_r ./configure --enable-cli --with-ibm-db2=/db2/v91p/db2lawp/sqllib --enable-pcntl 1>1 2>2 make [EMAIL PROTECTED]: /usr/src/php5.3-200807211430>sapi/cli/php -v PHP 5.3.0-dev (cli) (built: Jul 22 2008 15:42:32) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2008 Zend Technologies ========= TEST SCRIPT ========= <?php function q($db, $sql) { print "$sql\n"; $a = odbc_exec($db, $sql); var_dump($a); var_dump(strlen(odbc_result($a, 1))); if(strlen(odbc_result($a, 1)) < 1000000) var_dump(odbc_result($a, 1)); else print "too big\n"; } function local() { $db2 = odbc_pconnect('prod81','db2lawp','password'); var_dump($db2); q($db2, 'select count(*) from dkactivity'); odbc_close($db2); } function remote() { $db2 = odbc_pconnect('dfk01','db2user','password'); var_dump($db2); q($db2, 'select count(*) from dfkdta10.bnncli'); odbc_close($db2); } print "===\n";local(); print "===\n";remote(); ?> ===== OUTPUT ===== [EMAIL PROTECTED]: /usr/src/php5.3-200807211430/sapi/cli>./php -f /usr/dfkp/webscripts/test/db2.php === resource(5) of type (odbc link persistent) select count(*) from dkactivity resource(6) of type (odbc result) int(4) string(4) "4473" === resource(8) of type (odbc link persistent) select count(*) from dfkdta10.bnncli with nc resource(9) of type (odbc result) Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 544696693 bytes) in /usr/dfkp/webscripts/test/db2.php on line 11 ========================================== CONFIRM REMOTE DB2 DOES INDEED WORK ========================================== $ uname -a AIX unnamed12a 3 5 000AD01ED700 $ who am i db2lawp pts/1 Jul 22 15:57 (toshiba200601) $ db2 connect to prod81 Database Connection Information Database server = DB2/AIX64 9.1.0 SQL authorization ID = DB2LAWP Local database alias = PROD81 $ db2 "select count(*) from dkactivity" 1 ----------- 4473 1 record(s) selected. $ db2 terminate DB20000I The TERMINATE command completed successfully. $ db2 connect to dfk01 user db2user Enter current password for db2user: Database Connection Information Database server = OS/400 5.4.0 SQL authorization ID = DB2USER Local database alias = DFK01 $ db2 "select count(*) from dfkdta10.bnncli" 00001 ----------- 3570 1 record(s) selected. $ db2 terminate DB20000I The TERMINATE command completed successfully. $ Previous Comments: ------------------------------------------------------------------------ [2008-07-22 20:12:01] phil dot nyc at gmail dot com Description: ------------ on Aix 5.3 64-bit, have db2 connect installed to connect to iSeries db2, and local aix db2. able to do so using the db2 command line client, but using php only able to query local aix db2. using php, able to connect to remote (iSeries) db2 but not able to execute query! Reproduce code: --------------- http://pastebin.com/f462c54ee Expected result: ---------------- resource(5) of type (odbc link persistent) select count(*) from dkactivity resource(6) of type (odbc result) int(4) string(4) "4473" === resource(8) of type (odbc link persistent) select count(*) from dfkdta10.bnncli with nc resource(9) of type (odbc result) int(4) string(4) "3570" Actual result: -------------- resource(5) of type (odbc link persistent) select count(*) from dkactivity resource(6) of type (odbc result) int(4) string(4) "4473" === resource(8) of type (odbc link persistent) select count(*) from dfkdta10.bnncli with nc resource(9) of type (odbc result) Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 544696693 bytes) in /usr/dfkp/webscripts/test/db2.php on line 11 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45598&edit=1