Skip to content

Commit

Permalink
Ensure that the row count for queries is reset to zero when the state…
Browse files Browse the repository at this point in the history
…ment is

executed (oracle/python-cx_Oracle#193).
  • Loading branch information
anthony-tuininga committed Jun 25, 2018
1 parent 8b9d88d commit efd622c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/dpiStmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,11 +605,13 @@ static int dpiStmt__execute(dpiStmt *stmt, uint32_t numIters,
}
}

// create query variables (if applicable)
if (stmt->statementType == DPI_STMT_TYPE_SELECT &&
!(mode & DPI_MODE_EXEC_PARSE_ONLY) &&
dpiStmt__createQueryVars(stmt, error) < 0)
return DPI_FAILURE;
// create query variables (if applicable) and reset row count to zero
if (stmt->statementType == DPI_STMT_TYPE_SELECT) {
stmt->rowCount = 0;
if (!(mode & DPI_MODE_EXEC_PARSE_ONLY) &&
dpiStmt__createQueryVars(stmt, error) < 0)
return DPI_FAILURE;
}

return DPI_SUCCESS;
}
Expand Down

0 comments on commit efd622c

Please sign in to comment.