From e7d37b1a05657b62ff79b6879e8a68977be9f0f3 Mon Sep 17 00:00:00 2001 From: gholt Date: Thu, 3 May 2012 00:25:31 +0000 Subject: [PATCH] Fixed inconsistent end_marker The listing of containers was inclusive whereas the listing of objects was exclusive. I searched and searched and only found end_marker usage with listings of objects so I changed the listings of containers to match that. Change-Id: Ia8eb66a7ceaef28c698e2d4e19dd5dfd9197a911 --- swift/common/db.py | 2 +- test/unit/common/test_db.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/swift/common/db.py b/swift/common/db.py index 32f5d104d9..c738fff51d 100644 --- a/swift/common/db.py +++ b/swift/common/db.py @@ -1572,7 +1572,7 @@ class AccountBroker(DatabaseBroker): WHERE deleted = 0 AND """ query_args = [] if end_marker: - query += ' name <= ? AND' + query += ' name < ? AND' query_args.append(end_marker) if marker and marker >= prefix: query += ' name > ? AND' diff --git a/test/unit/common/test_db.py b/test/unit/common/test_db.py index f14097d8b1..d6b141c466 100644 --- a/test/unit/common/test_db.py +++ b/test/unit/common/test_db.py @@ -1814,9 +1814,9 @@ class TestAccountBroker(unittest.TestCase): self.assertEquals(listing[-1][0], '0/0099') listing = broker.list_containers_iter(100, '', '0/0050', None, '') - self.assertEquals(len(listing), 51) + self.assertEquals(len(listing), 50) self.assertEquals(listing[0][0], '0/0000') - self.assertEquals(listing[-1][0], '0/0050') + self.assertEquals(listing[-1][0], '0/0049') listing = broker.list_containers_iter(100, '0/0099', None, None, '') self.assertEquals(len(listing), 100)