| 1 | StatementIterator::StatementIterator(Statement* stmt, bool bound) : |
| 2 | node::ObjectWrap(), |
| 3 | stmt(stmt), |
| 4 | handle(stmt->handle), |
| 5 | db_state(stmt->db->GetState()), |
| 6 | bound(bound), |
| 7 | safe_ints(stmt->safe_ints), |
| 8 | mode(stmt->mode), |
| 9 | alive(true), |
| 10 | logged(!db_state->has_logger) { |
| 11 | assert(stmt != NULL); |
| 12 | assert(handle != NULL); |
| 13 | assert(stmt->bound == bound); |
| 14 | assert(stmt->alive == true); |
| 15 | assert(stmt->locked == false); |
| 16 | assert(db_state->iterators < USHRT_MAX); |
| 17 | stmt->locked = true; |
| 18 | db_state->iterators += 1; |
| 19 | } |
| 20 | |
| 21 | // The ~Statement destructor currently covers any state this object creates. |
| 22 | // Additionally, we actually DON'T want to revert stmt->locked or db_state |