wiredtiger/wiredtiger — Issue #157: session.truncate with cursors on different objects
Author: keithbostic
Created: 2012-02-01 17:13:11+00:00
State: open
Labels: Feature

Michael, it occurred to me session.truncate won't detect badly configured or chosen cursors:

1. a start cursor from one object and a stop cursor from another object,
2. a stop cursor that appears before the start cursor in the object,
3. a start or stop cursor without the key set

I don't think we can do anything about (2) (by the time we could return an error, the damage would already be done), but we could compare the cursor->uri fields to fix (1) and the WT_CURSTD_KEY_SET flag values to fix (3), before we start the truncation.

I don't think we're obligated to do this checking, but I thought it might be worthwhile to prevent pretty harsh behavior in the face of application error.

If you agree, I'm happy to hack in the code.