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

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


-----BEGIN PGP SIGNED MESSAGE-----
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:
<http://docs.oracle.com/cd/E17076_03/html/api_reference/C/dbset_bt_compare.html>

"""
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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQCVAwUBUjkj6plgi5GaxT1NAQJoHgP/eX4GmDP3Rrrjm96ns7XyYihUZd5r8Fb6
03n4IreMNkdfSF29Zha3qtgQWZ6HDy47n6CF6voNitCArP+5Jt1Xro7+UgoxK5iP
x6ZZZZ6/fOxkcN9DepMIAbXEsZRlDzLsv596EK4JZCPmsLdAmSpOlZejIU016/Kb
wSxoMIwy02c=
=xmID
-----END PGP SIGNATURE-----


More information about the pybsddb mailing list