This discussion is archived
2 Replies Latest reply: Sep 13, 2013 11:23 AM by 31f346d2-a10f-4dfc-a1df-fab56c62fef4 RSS

Receiving truncated keys to bt_compare function in python BTREE.

31f346d2-a10f-4dfc-a1df-fab56c62fef4 Newbie
Currently Being Moderated

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"

 

The data is truncated even when it is a string representing an integer.

 

 

Do you know why? any fixes?

 

thank you,

Sachi.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points