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.
Fixed in trunk in r1065258 . Will leave time for someone to scream if necessary before backporting!
fixed in apr-util 1.3.x branch, soon to have a new release