[pybsddb] The BTREE comparison function get's truncated data

Jesus Cea jcea at jcea.es
Wed Sep 18 05:54:18 CEST 2013

Hash: SHA1

On 13/09/13 20:20, xcorat wrote:
> Well, it turned out that I hadn't called set_bt_comparison when
> creating the database. I did that, and now everything seem to work
> fine. It would have been nicer if it had either given me a warning
> or an error instead of giving bizarre data though.

Not sure what are you talking about. Berkeley DB databases doesn't
store any kind of information about the comparison function used. If
you change comparison functions midway, you are going to have a very
hard time.

Current Oracle docs say:

If the database already exists when DB->open() is called, the
information specified to DB->set_bt_compare() must be the same as that
historically used to create the database or corruption can occur.

No information is stored in the database about the comparison
function, so you can not "know" that you are not using the right one.
In fact, no information CAN be stored about this, can't be done. Think
about it.

- -- 
Jesús Cea Avión                         _/_/      _/_/_/        _/_/_/
jcea at jcea.es - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
Twitter: @jcea                        _/_/    _/_/          _/_/_/_/_/
jabber / xmpp:jcea at jabber.org  _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/


More information about the pybsddb mailing list