Currently if an external user has bounds set on a cursor, and then the user performs a search near, there is an edge case where it is possible that the exact compare variable leads to a wrong value. The exact edge case comes as:
- Imagine a table with inserted keys aaa -> aaz
- Cursor has lower bounds as aay and upper bounds aaz
- Now the cursor will do a search near on aa
- The expected behaviour is that search near should return aay with exact = 1, denoting that the aay comes after aa. Instead the current behaviour returns back as aay with exact = 0.
The reproducer for the problem is here:
set_prefix_bound(self, cursor3, "aaz") cursor3.set_key("aa") self.session.breakpoint() self.assertEqual(cursor3.search_near(), 1) self.assertEqual(cursor3.get_key(), self.check_key("aaz"))