diff options
author | Keith Bostic <keith@wiredtiger.com> | 2012-07-27 09:47:33 +0000 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2012-07-27 09:47:33 +0000 |
commit | e9c1d127840bc3ace5cd690821a0aba66b1b8579 (patch) | |
tree | c2febfd330267302cfeb81cbd3acea7d3ef86565 | |
parent | 1f1aa5fb7b1bf476d0e545f0ec39998492c59838 (diff) | |
download | mongo-e9c1d127840bc3ace5cd690821a0aba66b1b8579.tar.gz |
Test that you can't update checkpoint cursors.
-rw-r--r-- | test/suite/test_checkpoint01.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/suite/test_checkpoint01.py b/test/suite/test_checkpoint01.py index 1c4268a701c..89b15e7c07e 100644 --- a/test/suite/test_checkpoint01.py +++ b/test/suite/test_checkpoint01.py @@ -251,3 +251,23 @@ class test_checkpoint_target(wttest.WiredTigerTestCase): self.check(self.uri + '1', 'UPDATE') self.check(self.uri + '2', 'UPDATE') self.check(self.uri + '3', 'ORIGINAL') + +# Check that you can't write checkpoint cursors. +class test_checkpoint_cursor_update(wttest.WiredTigerTestCase): + scenarios = [ + ('file', dict(uri='file:checkpoint',fmt='r')), + ('file', dict(uri='file:checkpoint',fmt='S')), + ('table', dict(uri='table:checkpoint',fmt='r')), + ('table', dict(uri='table:checkpoint',fmt='S')) + ] + + def test_checkpoint_cursor_update(self): + simplePopulate(self, self.uri, 'key_format=' + self.fmt, 100) + self.session.checkpoint("name=ckpt") + cursor = self.session.open_cursor(self.uri, None, "checkpoint=ckpt") + cursor.set_key(keyPopulate(self.fmt, 10)) + cursor.set_value("XXX") + self.assertRaises(wiredtiger.WiredTigerError, lambda: cursor.insert()) + self.assertRaises(wiredtiger.WiredTigerError, lambda: cursor.remove()) + self.assertRaises(wiredtiger.WiredTigerError, lambda: cursor.update()) + cursor.close() |