Duplicate Keys

Version 3.1 added support for duplicate keys. By default, duplicate keys are not permitted, so this (and later) versions behaves as previous versions. Duplicate key support is enabled on a per-root basis, using the btdups API function.

Finding a duplicate key (via bfndky) will leave the index at the first instance of the key. bnxtky may be used to walk through the set of duplicate keys. The bprvky function has been added to allow reverse key navigation.

To faciltate the management of duplicate keys, a number of BTree functions have been modified to operate against the current key, as selected by the bfndky, bnxtky or bprvky functions. These are: bupdky, bdelky, btupd, btdel and btrecs. Passing these functions a key pointer of NULL will invoke the desired operation against the currently selected key. See individual function descriptions for further details.