| 257 | } |
| 258 | |
| 259 | void SqliteTransaction::Begin() { |
| 260 | // This shouldn't allocate memory or perform I/O. All it does is |
| 261 | // execute OP_AutoCommit(0, 0) a.k.a. BEGIN DEFERRED which flips |
| 262 | // the sqlite3::autoCommit bit. |
| 263 | if (sqlite3_step(db_->begin_) != SQLITE_DONE) { |
| 264 | // It shouldn't be possible for this to fail since we already |
| 265 | // performed the reentrancy check. |
| 266 | LOG(FATAL) << "BEGIN failed: " << sqlite3_errmsg(db_->db_); |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | Status SqliteTransaction::Commit() { |
| 271 | int rc = sqlite3_step(db_->commit_); |
no outgoing calls
no test coverage detected