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

Jesus Cea jcea at jcea.es
Thu Sep 12 04:48:45 CEST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/09/13 21:12, xcorat wrote:
> Hi
> 
> I'm not sure where to find the problem. I'm saving pickled
> (cPickle) datetime keys in the database, and set the comparison
> function to load those keys and compare. When I call the set_range
> function, the right_key value the comparison function gets is
> **sometimes** truncated. Left key (the one I send) is always fine.
> The data in the database is fine too.
> 
> Ex. Left key 
> "datetime\ndatetime\np1\n(S'\\x07\\xdd\\x08\\x1f\\x17\\x1f\\x1f\\x0f\\x10\\x02'\ntRp2\n."
>
>  right key (truncated) 
> "cdatetime\ndatetime\np1\n(S'\\x07\\xdd\\t\\x04\\x1642\\x"
> 
> Do you know why? any fixes?

Could you possibly verify if the truncated data has any "\0" on it
(null byte)?. Could you post a testcase?.

- -- 
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/

iQCVAwUBUjErjZlgi5GaxT1NAQLwYgP/UCSwGlj6WtarxhX5taQCMLzWf7twvd6X
RGZoEgow2o9YiMWxYbFqDvnDuvgkzUnGqlCj4C0KBmbg059aOTe4VoEFGlJv8eSp
P3jng/xoFPmW1iAhIsZgEXdeH3+X/LQuEyXgayUnkA+JhZcaYp47Kz8Svm+osB9P
QH1Xm1JxGe4=
=zHvB
-----END PGP SIGNATURE-----


More information about the pybsddb mailing list