LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   64 bit odbc driver problem beetween RHEL and AS400 iseries - huge memory php/pdo (https://www.linuxquestions.org/questions/red-hat-31/64-bit-odbc-driver-problem-beetween-rhel-and-as400-iseries-huge-memory-php-pdo-4175454060/)

sk9990_1 03-14-2013 09:24 AM

64 bit odbc driver problem beetween RHEL and AS400 iseries - huge memory php/pdo
 
Hello,

I currently have some problems to set up an intranet with an odbc link beetween an AS400 (iseries V6R1) and a RHEL6.2 I use the iseriesAccess7.1 odbc driver 64bits, unixODBC2.3.1 and php5.4 with unixODBC support.

My link seems to be good because I can connect to my DataBase using the isql command (which is part of unixODBC) and execute some SQL queries but it's impossible to read records in the database using a php script.
When I try to launch a little script on my intranet I get the following error :

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 493921239296 bytes) in /home/www/imypdo/imypdo.php on line 122

that's more than 450 Gb !! and nothing in /var/log/messages and in /etc/httpd/logs/error_log

A simple sql query (with only 1 row in the select) will return some strange characters (see below) and as soon as I select 1 or 2 more rows the memory size error occurs.

[0] => Array ( [ADHMAR] => AAAAAAA a@YÿŒ4–X 0!ÿŒ4làÿŒ4làÿŒ4! )

I'm almost sure it's a 64bit driver related problem because I already have another RHEL linked with this iseries but with the 32 bit driver and it works perfectly.
What is weird is that isql command is working and ther is nothing in the log files...

if it really is a 64 bit driver problem, how can I prove it to IBM ?

any help will be appreciated

thanks

ThorMan 01-27-2014 04:03 AM

Work Around
 
In the 64bit version the odbc crashs when one of the return fields are NULL. So the work around is to replace all the null fields when retriving the query.

example :

select ifnull(tluser,'') as USER from database.table


All times are GMT -5. The time now is 08:16 AM.