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 c54f6d9 commit fee0c54
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 fee0c54

Please sign in to comment.