Skip to content

Commit c0bc4fd

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent 7597c9b commit c0bc4fd

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Fixed:
66
- rdbms backend full text search failure after import (sf bug 980314)
77
- rdbms backends not filtering correctly on link=None
88
- fix anydbm journal import (sf bug 983166)
9+
- handle postgresql bug in SQL generation (sf bug 984591)
910

1011

1112
2004-06-24 0.7.5

doc/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ Emil Sit,
128128
Nathaniel Smith,
129129
Mitchell Surface,
130130
Mike Thompson,
131+
Martin Uzak,
131132
Darryl VanDorp,
132133
J Vickroy.
133134

roundup/backends/rdbms_common.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.98.2.15 2004-07-03 22:49:40 richard Exp $
1+
# $Id: rdbms_common.py,v 1.98.2.16 2004-07-03 23:08:44 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -2076,7 +2076,7 @@ def filter(self, search_matches, filterspec, sort=(None,None),
20762076
timezone = self.db.getUserTimezone()
20772077

20782078
# vars to hold the components of the SQL statement
2079-
frum = ['_'+cn] # FROM clauses
2079+
frum = [] # FROM clauses
20802080
loj = [] # LEFT OUTER JOIN clauses
20812081
where = [] # WHERE clauses
20822082
args = [] # *any* positional arguments
@@ -2248,6 +2248,7 @@ def filter(self, search_matches, filterspec, sort=(None,None),
22482248
orderby.append(o)
22492249

22502250
# construct the SQL
2251+
frum.append('_'+cn)
22512252
frum = ','.join(frum)
22522253
if where:
22532254
where = ' where ' + (' and '.join(where))
@@ -2267,6 +2268,7 @@ def filter(self, search_matches, filterspec, sort=(None,None),
22672268
cols = ','.join(cols)
22682269
loj = ' '.join(loj)
22692270
sql = 'select %s from %s %s %s%s'%(cols, frum, loj, where, order)
2271+
print sql
22702272
args = tuple(args)
22712273
if __debug__:
22722274
print >>hyperdb.DEBUG, 'filter', (self, sql, args)

test/db_test_base.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: db_test_base.py,v 1.27.2.8 2004-06-29 05:53:37 richard Exp $
18+
# $Id: db_test_base.py,v 1.27.2.9 2004-07-03 23:08:44 richard Exp $
1919

2020
import unittest, os, shutil, errno, imp, sys, time, pprint
2121

@@ -835,15 +835,15 @@ def filteringSetup(self):
835835
iss = self.db.issue
836836
for issue in (
837837
{'title': 'issue one', 'status': '2', 'assignedto': '1',
838-
'foo': date.Interval('1:10'), 'priority': '1',
838+
'foo': date.Interval('1:10'), 'priority': '3',
839839
'deadline': date.Date('2003-01-01.00:00')},
840840
{'title': 'issue two', 'status': '1', 'assignedto': '2',
841841
'foo': date.Interval('1d'), 'priority': '3',
842842
'deadline': date.Date('2003-02-16.22:50')},
843843
{'title': 'issue three', 'status': '1', 'priority': '2',
844844
'nosy': ['1','2'], 'deadline': date.Date('2003-02-18')},
845845
{'title': 'non four', 'status': '3',
846-
'foo': date.Interval('0:10'), 'priority': '1',
846+
'foo': date.Interval('0:10'), 'priority': '2',
847847
'nosy': ['1'], 'deadline': date.Date('2004-03-08')}):
848848
self.db.issue.create(**issue)
849849
file_content = ''.join([chr(i) for i in range(255)])
@@ -880,6 +880,8 @@ def testFilteringLink(self):
880880
ae(filt(None, {'assignedto': None}, ('+','id'), (None,None)), ['3','4'])
881881
ae(filt(None, {'assignedto': ['-1', None]}, ('+','id'), (None,None)),
882882
['3','4'])
883+
ae(filt(None, {'assignedto': ['1', None]}, ('+','id'), (None,None)),
884+
['1', '3','4'])
883885

884886
def testFilteringRetired(self):
885887
ae, filt = self.filteringSetup()
@@ -890,6 +892,8 @@ def testFilteringMultilink(self):
890892
ae, filt = self.filteringSetup()
891893
ae(filt(None, {'nosy': '2'}, ('+','id'), (None,None)), ['3'])
892894
ae(filt(None, {'nosy': '-1'}, ('+','id'), (None,None)), ['1', '2'])
895+
ae(filt(None, {'nosy': ['1','2']}, ('+', 'status'),
896+
('-', 'activity')), ['4', '3'])
893897

894898
def testFilteringMany(self):
895899
ae, filt = self.filteringSetup()

0 commit comments

Comments
 (0)