Ticket #12 (new defect)
Opened 21 months ago
The <Marker> functionality is totally broken.
| Reported by: | awootton | Owned by: | awootton |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | component1 | Version: | |
| Keywords: | marker s3 find | Cc: |
Description
It's supposed to be a String, not an int. It is NOT the offset in an sql LIMIT statement. Our aws/s3 'driver' uses this feature to 'find' things and it just plain didn't work right. Anyway, here's my fix, which seems to work in mysql and sqlite3:
Index: /Users/alanwootton/Cruz/server2/test/parkplace/lib/parkplace/s3.rb =================================================================== --- /Users/alanwootton/Cruz/server2/test/parkplace/lib/parkplace/s3.rb (revision 33) +++ /Users/alanwootton/Cruz/server2/test/parkplace/lib/parkplace/s3.rb (working copy) @@ -51,14 +51,21 @@
if @input.has_key? 'torrent'
return torrent(bucket)
end
+ #let's be more like amazon and always have these 3 things + inputmax-keys? = 1000 unless inputmax-keys? + @input.marker = unless @input.marker + @input.prefix = unless @input.prefix +
opts = {:conditions => ['parent_id = ?', bucket.id], :order => "name"}
- limit = nil - if @input.prefix + + if ( @input.prefix && @input.prefix.length > 0 )
opts[:conditions].first << ' AND name LIKE ?' opts[:conditions] << "#{@input.prefix}%"
end
- if @input.marker - opts[:offset] = @input.marker.to_i + opts[:offset] = 0 + if ( @input.marker && @input.marker.length > 0 ) + opts[:conditions].first << ' AND name > ?' + opts[:conditions] << "#{@input.marker}%"
end if @inputmax-keys?
opts[:limit] = @inputmax-keys?.to_i
