Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dpiDeqOptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ int dpiDeqOptions_getMsgId(dpiDeqOptions *options, const char **value,
&rawValue, NULL, DPI_OCI_ATTR_DEQ_MSGID, "get attribute value",
&error) < 0)
return dpiGen__endPublicFn(options, DPI_FAILURE, &error);
dpiOci__rawPtr(options->env->handle, rawValue, (void**) value);
dpiOci__rawPtr(options->env->handle, rawValue, (char **)value);
dpiOci__rawSize(options->env->handle, rawValue, valueLength);
return dpiGen__endPublicFn(options, DPI_SUCCESS, &error);
}
Expand Down
4 changes: 3 additions & 1 deletion src/dpiImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ extern unsigned long dpiDebugLevel;
#define DPI_SQLT_BIN 23
#define DPI_SQLT_LBI 24
#define DPI_SQLT_UIN 68
#define DPI_SQLT_LVB 95
#define DPI_SQLT_AFC 96
#define DPI_SQLT_IBFLOAT 100
#define DPI_SQLT_IBDOUBLE 101
Expand Down Expand Up @@ -777,6 +778,7 @@ typedef union {
void **asInterval;
void **asLobLocator;
void **asString;
void **asOciraw;
void **asStmt;
void **asRowid;
int *asBoolean;
Expand Down Expand Up @@ -1516,7 +1518,7 @@ int dpiOci__passwordChange(dpiConn *conn, const char *userName,
int dpiOci__ping(dpiConn *conn, dpiError *error);
int dpiOci__rawAssignBytes(void *envHandle, const char *value,
uint32_t valueLength, void **handle, dpiError *error);
int dpiOci__rawPtr(void *envHandle, void *handle, void **ptr);
int dpiOci__rawPtr(void *envHandle, void *handle, char **ptr);
int dpiOci__rawResize(void *envHandle, void **handle, uint32_t newSize,
dpiError *error);
int dpiOci__rawSize(void *envHandle, void *handle, uint32_t *size);
Expand Down
4 changes: 2 additions & 2 deletions src/dpiMsgProps.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ int dpiMsgProps__extractMsgId(dpiMsgProps *props, void *ociRaw,
{
const char *rawPtr;

dpiOci__rawPtr(props->env->handle, ociRaw, (void**) &rawPtr);
dpiOci__rawPtr(props->env->handle, ociRaw, (char **)&rawPtr);
dpiOci__rawSize(props->env->handle, ociRaw, msgIdLength);
if (*msgIdLength > props->bufferLength) {
if (props->buffer) {
Expand Down Expand Up @@ -259,7 +259,7 @@ int dpiMsgProps_getOriginalMsgId(dpiMsgProps *props, const char **value,
&rawValue, NULL, DPI_OCI_ATTR_ORIGINAL_MSGID,
"get attribute value", &error) < 0)
return dpiGen__endPublicFn(props, DPI_FAILURE, &error);
dpiOci__rawPtr(props->env->handle, rawValue, (void**) value);
dpiOci__rawPtr(props->env->handle, rawValue, (char **)value);
dpiOci__rawSize(props->env->handle, rawValue, valueLength);
return dpiGen__endPublicFn(props, DPI_SUCCESS, &error);
}
Expand Down
27 changes: 27 additions & 0 deletions src/dpiObject.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ static void dpiObject__clearOracleValue(dpiObject *obj, dpiError *error,
dpiOci__stringResize(obj->env->handle, &buffer->asString, 0,
error);
break;
case DPI_ORACLE_TYPE_RAW:
if (buffer->asRaw)
dpiOci__rawResize(obj->env->handle, &buffer->asRaw, 0,
error);
break;
case DPI_ORACLE_TYPE_TIMESTAMP:
if (buffer->asTimestamp)
dpiOci__descriptorFree(buffer->asTimestamp,
Expand Down Expand Up @@ -243,6 +248,17 @@ static int dpiObject__fromOracleValue(dpiObject *obj, dpiError *error,
return DPI_SUCCESS;
}
break;
case DPI_ORACLE_TYPE_RAW:
if (nativeTypeNum == DPI_NATIVE_TYPE_BYTES) {
asBytes = &data->value.asBytes;
dpiOci__rawPtr(obj->env->handle, *value->asOciraw,
&asBytes->ptr);
dpiOci__rawSize(obj->env->handle, *value->asOciraw,
&asBytes->length);
asBytes->encoding = NULL;
return DPI_SUCCESS;
}
break;
case DPI_ORACLE_TYPE_NATIVE_INT:
if (nativeTypeNum == DPI_NATIVE_TYPE_INT64)
return dpiDataBuffer__fromOracleNumberAsInteger(&data->value,
Expand Down Expand Up @@ -385,6 +401,17 @@ static int dpiObject__toOracleValue(dpiObject *obj, dpiError *error,
return DPI_SUCCESS;
}
break;
case DPI_ORACLE_TYPE_RAW:
buffer->asRaw = NULL;
if (nativeTypeNum == DPI_NATIVE_TYPE_BYTES) {
bytes = &data->value.asBytes;
if (dpiOci__rawAssignBytes(obj->env->handle, bytes->ptr,
bytes->length, &buffer->asRaw, error) < 0)
return DPI_FAILURE;
*ociValue = buffer->asRaw;
return DPI_SUCCESS;
}
break;
case DPI_ORACLE_TYPE_NATIVE_INT:
case DPI_ORACLE_TYPE_NUMBER:
*ociValue = &buffer->asNumber;
Expand Down
2 changes: 1 addition & 1 deletion src/dpiOci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2445,7 +2445,7 @@ int dpiOci__rawAssignBytes(void *envHandle, const char *value,
// dpiOci__rawPtr() [INTERNAL]
// Wrapper for OCIRawPtr().
//-----------------------------------------------------------------------------
int dpiOci__rawPtr(void *envHandle, void *handle, void **ptr)
int dpiOci__rawPtr(void *envHandle, void *handle, char **ptr)
{
dpiError *error = NULL;

Expand Down
1 change: 1 addition & 0 deletions src/dpiOracleType.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ static dpiOracleTypeNum dpiOracleType__convertFromOracle(uint16_t typeCode,
case DPI_SQLT_ODT:
return DPI_ORACLE_TYPE_DATE;
case DPI_SQLT_BIN:
case DPI_SQLT_LVB:
return DPI_ORACLE_TYPE_RAW;
case DPI_SQLT_AFC:
if (charsetForm == DPI_SQLCS_NCHAR)
Expand Down
2 changes: 1 addition & 1 deletion src/dpiSubscr.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ static int dpiSubscr__populateMessage(dpiSubscr *subscr,
if (dpiOci__attrGet(descriptor, DPI_OCI_DTYPE_CHDES, &rawValue, NULL,
DPI_OCI_ATTR_CHDES_XID, "get transaction id", error) < 0)
return DPI_FAILURE;
dpiOci__rawPtr(subscr->env->handle, rawValue, (void**) &message->txId);
dpiOci__rawPtr(subscr->env->handle, rawValue, (char**) &message->txId);
dpiOci__rawSize(subscr->env->handle, rawValue, &message->txIdLength);

// populate event specific attributes
Expand Down