Bug 50690 - apr dbd oracle driver does not work under AIX/ppc and Solaris/sparc
Summary: apr dbd oracle driver does not work under AIX/ppc and Solaris/sparc
Status: RESOLVED FIXED
Alias: None
Product: APR
Classification: Unclassified
Component: APR-util (show other bugs)
Version: 1.3.9
Hardware: Other AIX
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords: FixedInTrunk, PatchAvailable
Depends on:
Blocks:
 
Reported: 2011-01-30 05:33 UTC by Stefan Ruppert
Modified: 2011-04-08 07:54 UTC (History)
0 users



Attachments
changed OCIAttrGet(OCI_ATTR_STMT_TYPE) output parameter from int to apr_int16_t. (713 bytes, patch)
2011-01-30 05:33 UTC, Stefan Ruppert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Ruppert 2011-01-30 05:33:43 UTC
Created attachment 26577 [details]
changed OCIAttrGet(OCI_ATTR_STMT_TYPE) output parameter from int to apr_int16_t.

The apr dbd oracle driver works fine under Linux/x86, Solaris/x86 and Windows x86. However under AIX/ppc and Solaris/sparc the check connection select fails. Oracle returns the error "ORA-24374: define not done before fetch or execute and fetch".

This bug is caused by an inproper use of OCIAttrGet(OCI_ATTR_STMT_TYPE). The out parameter for the statement type should be an 16-bit integer, but its currently just an int (normally 32-bit). Under x86 systems the correct type is returned and the following if() statement is executed:

if (stmt->type == OCI_STMT_SELECT) {
    ret = outputParams(sql, stmt);
}

But under ppc or sparc (big-endian) the returned statement type is wrong and therefore outputParams() is not called which will result in the ORA-24374 when trying to fetch the result of the SELECT.

The attached patch uses an apr_int16_t variable to retrieve the statement type and it works find under AIX.
Comment 1 Nick Kew 2011-01-30 07:53:19 UTC
Fixed in trunk in r1065258 .
Will leave time for someone to scream if necessary before backporting!
Comment 2 Jeff Trawick 2011-04-08 07:54:02 UTC
fixed in apr-util 1.3.x branch, soon to have a new release