Bug 772293

Summary: Add php53-odbc64 package in RHEL5
Product: Red Hat Enterprise Linux 5 Reporter: Karel Volný <kvolny>
Component: php53-odbc64Assignee: Joe Orton <jorton>
Status: CLOSED ERRATA QA Contact: Filip Holec <fholec>
Severity: high Docs Contact:
Priority: high    
Version: 5.8CC: azelinka, bgollahe, ddumas, dkutalek, fholec, gasmith, jentrena, jorton, lmiksik, psplicha, tgl
Target Milestone: rcKeywords: FutureFeature, Reopened
Target Release: 5.9   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: php53-odbc64-5.3.3-2.el5 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
: 808119 (view as bug list) Environment:
Last Closed: 2013-01-08 07:03:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 743405, 754028, 808119, 811996    

Description Karel Volný 2012-01-06 17:32:29 UTC
Description of problem:
php-odbc does not work with the new unixODBC64 and postgresql-odbc64

Version-Release number of selected component (if applicable):
php-odbc-5.1.6-27.el5_5.3

How reproducible:
always

Steps to Reproduce:
1. run the test /CoreOS/postgresql-odbc64/Sanity/php-postgres-odbc
  
Actual results:
test fails

Expected results:
test passes

Additional info:
the relevant error message is:

PHP Warning:  odbc_connect(): SQL error: [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_DBC failed, SQL state IM005 in SQLConnect in /mnt/testarea/tests/postgresql-odbc64/php-postgres-odbc/test.php on line 3
ODBC ERROR CODE: IM005
ODBC ERROR MESSAGE: [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_DBC failed


if you change the settings in odbcinst.ini to point to old ODBC libs, the test works && if you use the same configuration (utilizing the new ODBC64 and postgresql-odbc64) via isql instead of php it works

Comment 1 Karel Volný 2012-01-09 11:09:32 UTC
jsut a note, the same test (very similar php code, different backend settings, of course) passes with mysql-connector-odbc64 and php-odbc:

-- tps-rhts log Po led  9 06:04:33 EST 2012
test -x runtest.sh || chmod a+x runtest.sh
./runtest.sh

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

mysql-connector-odbc64-5.1.8-1.el5.ppc
:: [   PASS   ] :: Checking for the presence of mysql-connector-odbc64 rpm
mysql-server-5.0.77-4.el5_6.6.ppc64
mysql-server-5.0.77-4.el5_6.6.ppc
:: [   PASS   ] :: Checking for the presence of mysql-server rpm
php-cli-5.1.6-27.el5_5.3.ppc
:: [   PASS   ] :: Checking for the presence of php-cli rpm
php-odbc-5.1.6-27.el5_5.3.ppc
:: [   PASS   ] :: Checking for the presence of php-odbc rpm
unixODBC64-libs-2.2.14-3.el5.ppc
:: [   PASS   ] :: Checking for the presence of unixODBC64-libs rpm
:: [   PASS   ] :: Creating tmp directory
/tmp/tmp.nBJFTZ5914 /mnt/testarea/tests/mysql-connector-odbc64/Sanity/php-mysql-odbc
:: [   PASS   ] :: Running 'pushd /tmp/tmp.nBJFTZ5914'
:: [   PASS   ] :: Setting up odbc.ini
:: [06:04:36] :: [ INFO    ] :: ODBC driver library: /usr/lib/libmyodbc5.so
:: [06:04:36] :: [ INFO    ] :: ODBC setup library: /usr/lib/libodbcmyS64.so
:: [   PASS   ] :: Setting up odbcinst.ini
mysqld je zastaven
Spouštím MySQL:                                            [  OK  ]

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Selecting users from mysql via odbc
localhost root  Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y     0 0 0 0 
ppcp-5s-m1.ss.eng.bos.redhat.com root  Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y     0 0 0 0 
127.0.0.1 root  Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y     0 0 0 0 
localhost   N N N N N N N N N N N N N N N N N N N N N N N N N N     0 0 0 0 
ppcp-5s-m1.ss.eng.bos.redhat.com   N N N N N N N N N N N N N N N N N N N N N N N N N N     0 0 0 0 
:: [   PASS   ] :: File 'test.out' should not contain 'ERROR'
:: [   PASS   ] :: File 'test.out' should contain 'root'
:: [   PASS   ] :: File 'test.out' should contain 'localhost'

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

mysqld (pid 6186) běží...
Ukončuji MySQL:                                            [  OK  ]
/mnt/testarea/tests/mysql-connector-odbc64/Sanity/php-mysql-odbc
:: [   PASS   ] :: Running 'popd'
:: [   PASS   ] :: Removing tmp directory

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: TEST PROTOCOL
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   LOG    ] :: Test run ID   : nSP5849
:: [   LOG    ] :: Package       : mysql-connector-odbc64
:: [   LOG    ] :: Installed:    : mysql-connector-odbc64-5.1.8-1.el5.ppc
:: [   LOG    ] :: Test started  : 2012-01-09 06:04:33 EST
:: [   LOG    ] :: Test finished : 2012-01-09 06:04:43 EST
:: [   LOG    ] :: Test name     : /CoreOS/mysql-connector-odbc64/Sanity/php-mysql-odbc
:: [   LOG    ] :: Distro:       : Red Hat Enterprise Linux Server release 5.7 (Tikanga)
:: [   LOG    ] :: Hostname      : ppcp-5s-m1.ss.eng.bos.redhat.com
:: [   LOG    ] :: Architecture  : ppc64

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test description
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

PURPOSE of /CoreOS/mysql-connector-odbc64/Sanity/php-mysql-odbc
Description: simple test connecting to mysql from php via odbc connector
Author: Karel Volny <kvolny>


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Setup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Checking for the presence of mysql-connector-odbc64 rpm
:: [   PASS   ] :: Checking for the presence of mysql-server rpm
:: [   PASS   ] :: Checking for the presence of php-cli rpm
:: [   PASS   ] :: Checking for the presence of php-odbc rpm
:: [   PASS   ] :: Checking for the presence of unixODBC64-libs rpm
:: [   PASS   ] :: Creating tmp directory
:: [   PASS   ] :: Running 'pushd /tmp/tmp.nBJFTZ5914'
:: [   PASS   ] :: Setting up odbc.ini
:: [   INFO   ] :: ODBC driver library: /usr/lib/libmyodbc5.so
:: [   INFO   ] :: ODBC setup library: /usr/lib/libodbcmyS64.so
:: [   PASS   ] :: Setting up odbcinst.ini
:: [   LOG    ] :: Duration: 5s
:: [   LOG    ] :: Assertions: 9 good, 0 bad
:: [   PASS   ] :: RESULT: Setup

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Test
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Selecting users from mysql via odbc
:: [   PASS   ] :: File 'test.out' should not contain 'ERROR'
:: [   PASS   ] :: File 'test.out' should contain 'root'
:: [   PASS   ] :: File 'test.out' should contain 'localhost'
:: [   LOG    ] :: Duration: 1s
:: [   LOG    ] :: Assertions: 4 good, 0 bad
:: [   PASS   ] :: RESULT: Test

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: [   LOG    ] :: Cleanup
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [   PASS   ] :: Running 'popd'
:: [   PASS   ] :: Removing tmp directory
:: [   LOG    ] :: Duration: 2s
:: [   LOG    ] :: Assertions: 2 good, 0 bad
:: [   PASS   ] :: RESULT: Cleanup
:: [06:04:44] ::  JOURNAL XML: /tmp/beakerlib-nSP5849/journal.xml
:: [06:04:44] ::  JOURNAL TXT: /tmp/beakerlib-nSP5849/journal.txt

Comment 5 Tom Lane 2012-01-09 15:44:51 UTC
The soname *is* different in unixODBC64.  I suspect what really happened here is that php is still linking to the old unixODBC libs, but Karel told it to dynamically load the new postgresql-odbc64 driver, and the failure is a result of unixODBC-to-driver ABI incompatibility.  If so, this is pilot error, plain and simple.

As for the question of why we didn't provide parallel builds of every last unixODBC-using package in RHEL that would work with unixODBC64, the answer should be obvious: it would be a maintenance nightmare.  The unixODBC64 packages are only meant to support users whose own applications need the newer version and who are willing to rebuild those apps against unixODBC64.  We're not going to expand the charter further than that at this late date in RHEL5's lifecycle.

Comment 6 Joe Orton 2012-01-09 16:06:45 UTC
Thanks, Tom, that makes sense.   Marking this closed.

Comment 7 Karel Volný 2012-01-10 10:22:07 UTC
(In reply to comment #5)
> The soname *is* different in unixODBC64.  I suspect what really happened here
> is that php is still linking to the old unixODBC libs,

hm, makes sense ... php-odbc doesn't require "unixODBC", the old package, so I haven't suspected there may be something wrong in this way

> but Karel told it to dynamically load the new postgresql-odbc64 driver,

exactly

> and the failure is a result of unixODBC-to-driver ABI incompatibility.  If so,
> this is pilot error, plain and simple.

still, shouldn't be there some version check?

- I mean, this works the other way round, when I've messed the library names and tried to use the old driver with new unixODBC, I got some error message about version incompatibility, which led me to fix the config, no irrelevant error messages and crashes (with crashes I refer to the bug #772595 which is probably the same case)

Comment 8 Karel Volný 2012-01-10 10:46:57 UTC
(In reply to comment #7)
> - I mean, this works the other way round, when I've messed the library names
> and tried to use the old driver with new unixODBC, I got some error message
> about version incompatibility

oh my memory - maybe that was rather lib/lib64 issue than old/new which gave me clear error message ...

Comment 9 Julio Entrena Perez 2012-02-28 16:34:42 UTC
> As for the question of why we didn't provide parallel builds of every last
> unixODBC-using package in RHEL that would work with unixODBC64, the answer
> should be obvious: it would be a maintenance nightmare.  The unixODBC64
> packages are only meant to support users whose own applications need the newer
> version and who are willing to rebuild those apps against unixODBC64.  We're
> not going to expand the charter further than that at this late date in RHEL5's
> lifecycle.

The RHEL5 lifecycle has been extended so we're not "at this late date" anymore.

Since we don't support using OCI8 with PHP, ODBC is the only supported way of accessing Oracle from PHP.
Since unixODBC is too old for Oracle Client and we don't build php-odbc64, there's currently no supported way of accessing Oracle from PHP in RHEL5.

Comment 31 errata-xmlrpc 2013-01-08 07:03:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2013-0011.html