Bug 1009909

Summary: Problem with php odbc for db2
Product: [Fedora] Fedora Reporter: christophe.conduche
Component: phpAssignee: Joe Orton <jorton>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 19CC: christophe.conduche, fedora, jorton, rcollet, rpm
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-22 17:04:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description christophe.conduche 2013-09-19 13:24:38 UTC
Description of problem:

odbc function in php (odbc_result, odbc_fetch_array) cause memory error.

Version-Release number of selected component (if applicable):
php5.5.3 fedora19 arch ppc64p7


How reproducible:
always

Steps to Reproduce:
1.
<?php

echo "TEST CONNEXION DB2 - ODBC <HR>";

$dsn    = "power7";
$user   = "xxx";
$passwd = "yyy";
$conn   = odbc_connect($dsn,$user,$passwd );

if (!$conn)
  {exit("Connection Failed: " . $conn);}
$sql="SELECT 1 FROM SYSIBM.SYSDUMMY1";
$rs=odbc_exec($conn,$sql);
if (!$rs)
  {exit("Error in SQL");}
$myarray = odbc_fetch_array($rs);
odbc_close($conn);
var_dump ($myarray);

echo "<HR>Fin de test";

?>

2.
3.

Actual results:
TEST CONNEXION DB2 - ODBC 

array(1) { ["00001"]=> string(365) "1���jx���jxlz��a���j����j�lz`" } 

Fin de test


Expected results:
TEST CONNEXION DB2 - ODBC

array(1) { ["00001"]=> string(1) "1" } 

Fin de test


Additional info:

 isql --version
unixODBC 2.3.1

isql works fine and give good result :

SQL> SELECT 1 FROM SYSIBM.SYSDUMMY1
+-----------+
| 00001     |
+-----------+
| 1         |
+-----------+
SQLRowCount returns -1
1 rows fetched
SQL>

Comment 1 Remi Collet 2013-10-14 11:14:48 UTC
I'm sorry, but I cannot reproduce this issue.

I can get a ppc64 computer running:
Fedora 19,
php-5.5.4-1.fc19
UnixODBC-2.3.1-6.fc19
mysql-connector-odbc-5.2.5-2.fc19

I don't have access to any DB2 database, and with MariaDB 5.5 the reproducer works as expected.

Comment 2 christophe.conduche 2013-10-14 13:26:53 UTC
It's the problem to be able to reproduce.

My particular configuration is a Power720 with "AS400" stuff on partition 1 and Fedora on partition 2. On Fedora the connection to a Mariadb base works like expected, but not the connexion to the DB2 database on the AS400.

A remote linux box, debian and intel based, can connect nicely to the same DB2 base on the AS400.

I guess that there is something related to the ppc64p7 optimization somewhere and incompatible datatype sizes in 2 modules, but which ones ???

I read about similar bugs in the old time of php-odbc with 64 bits implementation and connexion on Microsoft SQL Server.

Comment 3 christophe.conduche 2013-10-14 14:14:49 UTC
I started a discussion there too :

https://www.ibm.com/developerworks/community/forums/html/forum?id=11111111-0000-0000-0000-000000001052

Comment 4 christophe.conduche 2013-11-22 17:04:46 UTC
The release today of ibm-iaccess-1.1.0.1-1.0.ppc64.rpm fixed this issue.

The problem was in their ODBC driver for PPC64 not in PHP or unixodbc