Here's the script:
import wiredtiger, wttest class test_f(wttest.WiredTigerTestCase): def test_ok(self): uri = 'table:x' self.session.create(uri, 'key_format=r,value_format=S') cursor = self.session.open_cursor(uri, None, "append") cursor.set_value("value") cursor.insert() def test_fail(self): uri = 'lsm:x' self.session.create(uri, 'key_format=r,value_format=S') cursor = self.session.open_cursor(uri, None, "append") cursor.set_value("value") cursor.insert()
test_ok works, and test_fail doesn't work, which is all good.
The problem is that test_fail doesn't fail until __clsm_insert realizes there's no key:
(gdb) where
#0 __clsm_insert (cursor=0x803348740) at ../src/lsm/lsm_cursor.c:722
(gdb) n
725 WT_LSM_ENTER(clsm, cursor, session, insert);
(gdb)
726 WT_CURSOR_NEEDKEY(cursor);
(gdb)
738 err: WT_LSM_END(clsm, session);
(gdb)
740 return (ret);
Maybe I'm misunderstanding, but shouldn't we have failed in session.create?