Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the MongoDB CPAN distribution.

Maintainer(s)' notes

Please don't report bugs here. Please use the MongoDB Perl driver issue tracker instead.

Report information
The Basics
Id: 65094
Status: resolved
Priority: 0/
Queue: MongoDB

People
Owner: Nobody in particular
Requestors: bitcard [...] ew.ewheeler.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.41
Fixed in: 0.40



Subject: Regression updating values and trying to re-read them later.
We use MongoDB to abstract a key-value implementation called a "NameCache". Extract the attached archive and run ./NameCache-MongoDB.pl. It works great in <= 0.40, and dies hard in 0.41. What changed? This is what our NameCache code, the smallest snip I can make to reproduce the problem: $nc->set('xxx', 'zzz'); $nc->set('rrr', 'zzz'); # Right here, the key "xxx" should hold the value "zzz", but for version 0.41 it returns undef! Fatal( 'get(xxx): should be zzz!' , $nc->get('xxx')) if ($nc->get('xxx') ne 'zzz'); It could be a bug in our code, but I know this worked in 0.40 and stopped working in 0.41. Any help you can offer on what changed from 0.40 to 0.41 would be greatly appreciated! Thank you! -Eric
Subject: MongoDB-0.41-debug.tar.gz
Download MongoDB-0.41-debug.tar.gz
application/x-gzip 13.5k

Message body not shown because it is not plain text.

From: bitcard [...] ew.ewheeler.org
Additional details: I'm using the Debian Squeeze installed backend, version 1.4.4-5. I tried the 10gen/ apt source from the MongoDB page for both 'mongodb-stable' and 'mongodb-unstable', so I do not believe this is a backend issue.
Okay, fixed in master (https://github.com/mongodb/mongo-perl-driver). Thanks for the report! If you're interested in why this happened: The "if int($var) eq $var" check you're doing adds an int flag to $var. The driver's logic changed slightly in 0.41 to catch more ints (as it should). However, there was a bug in the logic, as you discovered, that was made it too aggressive about turning things into ints (so 'xxx' and 'rrr' were both being saved as 0).