Patches: Browse | Submit New | Admin

[#12645] Patch Bucket.find so it allows empty result sets.

Date:
2007-07-27 20:52
Priority:
3
Submitted By:
Justin Greer (ezran)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Patch Bucket.find so it allows empty result sets.

Detailed description
If you call Bucket.find with a :prefix that doesn't exist on S3, instead of returning the expected empty array, it will
return all objects in the bucket!

This is because it will do a 'reload!' any time the object cache is empty -- but when it does the reload, it no longer
has the options hash, so it reloads all items for the bucket.

I've added a new flag to track whether the objects have been loaded, which fixes the problem.  I'm not quite sure how
to write tests for this, though...

Add A Comment: Notepad

Please login


Followup

Message
Date: 2007-07-27 21:22
Sender: Justin Greer

Of course, I didn't get the right version of the patch
uploaded before.  Here's a corrected version.

Attached Files:

Name Description Download
patch_empty_find.txt Patch so Bucket.find allows empty result sets. Download
patch_empty_find.txt (corrected) Patch so Bucket.find allows empty result sets. Download

Changes:

Field Old Value Date By
File Added2298: patch_empty_find.txt2007-07-27 21:22ezran
File Added2297: patch_empty_find.txt2007-07-27 20:52ezran