Issue 3 in tokyo-python: Impossible to store binary key and values

2 views
Skip to first unread message

tokyo-...@googlecode.com

unread,
Jul 2, 2010, 5:01:48 PM7/2/10
to tokyo-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3 by hegel666: Impossible to store binary key and values
http://code.google.com/p/tokyo-python/issues/detail?id=3

What steps will reproduce the problem?
1. Run attached unit test

What version of the product are you using? On what operating system?
tokyo-python 0.6.0, tokyocabinet-1.4.45, debian 5.04 64bit

Please provide any additional information below.

tokyo-python uses tcbput2() family of functions instead of more versatile
tcbput() functions. tcbput2() accepts string keys and values and computes
their length using strlen() - as an effect it's impossible to store binary
data which may contain \0 byte. I didn't have this problem with
tokyocabinet-0.5.

Attachments:
test-binary.py 536 bytes

tokyo-...@googlecode.com

unread,
Jul 3, 2010, 4:07:36 AM7/3/10
to tokyo-...@googlegroups.com
Updates:
Status: Started
Labels: -Priority-Medium Priority-Critical

Comment #1 on issue 3 by lekmalek: Impossible to store binary key and values
http://code.google.com/p/tokyo-python/issues/detail?id=3

Well, now I feel dumb for not thinking about this.

Working on it, I'll get it fixed for 0.6.1 (I hope).

Thanks for the report

malek

tokyo-...@googlecode.com

unread,
Jul 6, 2010, 3:21:09 AM7/6/10
to tokyo-...@googlegroups.com

Comment #2 on issue 3 by lekmalek: Impossible to store binary key and values
http://code.google.com/p/tokyo-python/issues/detail?id=3

Hi,

This issue should be fixed in trunk. Could you, please, test and report?

Thanks for your help

malek

tokyo-...@googlecode.com

unread,
Jul 9, 2010, 6:04:50 AM7/9/10
to tokyo-...@googlegroups.com
Updates:
Owner: lekmalek

Comment #3 on issue 3 by lekmalek: Impossible to store binary key and values
http://code.google.com/p/tokyo-python/issues/detail?id=3

I intend to release 0.6.1 in a week and a half (when I'm back from
vacations).
Can I consider this fixed or do you have any other problem with null bytes?


thanks for your help

malek

tokyo-...@googlecode.com

unread,
Jul 10, 2010, 8:02:13 AM7/10/10
to tokyo-...@googlegroups.com

Comment #4 on issue 3 by hegel666: Impossible to store binary key and values
http://code.google.com/p/tokyo-python/issues/detail?id=3

Thx for fixing, that's a big batch of changes!

All works fine for me now, but since I use binary 64-bit integers as keys,
I'm concerned with revision 38 and "keys must be without null bytes"
policy. I can't find such limitation in tokyo spec - is there a reason for
banning null bytes in keys?


tokyo-...@googlecode.com

unread,
Jul 21, 2010, 7:16:48 AM7/21/10
to tokyo-...@googlegroups.com

Comment #5 on issue 3 by lekmalek: Impossible to store binary key and values
http://code.google.com/p/tokyo-python/issues/detail?id=3

My bad.

While testing with binary keys I discovered what I thought was a bug in
BDB.range(). Given that I was leaving for vacations, I took the
conservative approach of disabling null bytes in keys.
It turns out it was not a bug (and was not related to binary keys, anyway),
so r38 has been reverted in r44 and this issue should now be fixed (God! I
hope it is :-), I feel really dumb for overlooking it). Awaiting your
confirmation.

Again, thanks for your help and patience

malek

tokyo-...@googlecode.com

unread,
Jul 22, 2010, 2:42:38 AM7/22/10
to tokyo-...@googlegroups.com
Updates:
Status: Fixed

Comment #6 on issue 3 by lekmalek: Impossible to store binary key and values
http://code.google.com/p/tokyo-python/issues/detail?id=3

(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages