couchbase/couchbase-lite-ios — pull request #160 by robin (2013-10-14 05:15:36+00:00)
Title: wrong lastDbError causes [CBLView removeIndex] fails

In [CBLView removeIndex], _db.lastDbError is returned to the transaction.

[_db _inTransaction: ^CBLStatus {
if ([_db.fmdb executeUpdate: @"DELETE FROM maps WHERE view_id=?",
@(_viewID)]) {
[_db.fmdb executeUpdate: @"UPDATE views SET lastsequence=0 WHERE view_id=?",
@(_viewID)];
}
return _db.lastDbError;
}];

While _db.lastDbError does not return correct status, the transaction always fails.