Skip to content

Commit

Permalink
Only SELECT statements can be used for subscriptions, so verify that the
Browse files Browse the repository at this point in the history
statement type is in fact a SELECT statement in order to avoid the error
"ORA-3137: malformed TTC packet from client rejected".
  • Loading branch information
anthony-tuininga committed Aug 13, 2019
1 parent 65912d6 commit f95846b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dpiSubscr.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,12 @@ static int dpiSubscr__populateQueryChangeMessage(dpiSubscr *subscr,
static int dpiSubscr__prepareStmt(dpiSubscr *subscr, dpiStmt *stmt,
const char *sql, uint32_t sqlLength, dpiError *error)
{
// prepare statement for execution
// prepare statement for execution; only SELECT statements are supported
if (dpiStmt__prepare(stmt, sql, sqlLength, NULL, 0, error) < 0)
return DPI_FAILURE;
if (stmt->statementType != DPI_STMT_TYPE_SELECT)
return dpiError__set(error, "subscr prepare statement",
DPI_ERR_NOT_SUPPORTED);

// fetch array size is set to 1 in order to avoid over allocation since
// the query is not really going to be used for fetching rows, just for
Expand Down

0 comments on commit f95846b

Please sign in to comment.