berkeley-db-1.xx
berkeley-db-1.xx copied to clipboard
duplicate key enablement
Hello,
To enable duplicate key in btree, one can call btree.open(flags=1)
after some tests we detected a coredump in bt_delete.c
You will find attached the patch: bt_delete.patch.txt
When some duplicated keys are searched, the first loop scans left to right, the second loop scans right to left.
In the case where the btree leef h->upper == t->psize
, i.e. when the free space is up to the right page limit, the first do while loop shall not be entered. Only the second loop is necessary to remove from right to left.
The test program uses a dbm module that could be in micropython-lib, if you need it i could provide it.
Thanks for the report! MicroPython doesn't currently support duplicate keys ("officially"), so looking into this would be of less priority. But please consider submitting a patch as a pull request here, and a testcase would be definitely needed to verify correctness of this change, so please post it to.