static int _sql_socket_destructor(rlm_sql_oracle_conn_t *conn)
{
if (conn->ctx) OCILogoff(conn->ctx, conn->error);
- if (conn->query) OCIHandleFree((dvoid *)conn->query, OCI_HTYPE_STMT);
if (conn->error) OCIHandleFree((dvoid *)conn->error, OCI_HTYPE_ERROR);
if (conn->env) OCIHandleFree((dvoid *)conn->env, OCI_HTYPE_ENV);
return RLM_SQL_ERROR;
}
- /*
- * Allocate handles for select and update queries
- */
- if (OCIHandleAlloc((dvoid *)conn->env, (dvoid **)&conn->query, OCI_HTYPE_STMT, 0, NULL)) {
- ERROR("rlm_sql_oracle: Couldn't init Oracle query handles: %s",
- (sql_prints_error(errbuff, sizeof(errbuff), handle, config) == 0) ? errbuff : "unknown");
-
- return RLM_SQL_ERROR;
- }
-
/*
* Login to the oracle server
*/
return RLM_SQL_RECONNECT;
}
- if (OCIStmtPrepare(conn->query, conn->error, oracle_query, strlen(query),
- OCI_NTV_SYNTAX, OCI_DEFAULT)) {
+ if (OCIStmtPrepare2(conn->ctx, &conn->query, conn->error, oracle_query, strlen(query),
+ NULL, 0, OCI_NTV_SYNTAX, OCI_DEFAULT)) {
ERROR("rlm_sql_oracle: prepare failed in sql_query");
return RLM_SQL_ERROR;
memcpy(&oracle_query, &query, sizeof(oracle_query));
- if (OCIStmtPrepare(conn->query, conn->error, oracle_query, strlen(query), OCI_NTV_SYNTAX,
- OCI_DEFAULT)) {
+ if (OCIStmtPrepare2(conn->ctx, &conn->query, conn->error, oracle_query, strlen(query),
+ NULL, 0, OCI_NTV_SYNTAX, OCI_DEFAULT)) {
ERROR("rlm_sql_oracle: prepare failed in sql_select_query");
return RLM_SQL_ERROR;