Skip to content

Commit 732ee27

Browse files
author
Ralf Schlatterbeck
committed
Fix a peculiarity in sql generation.
Seems that we can leave out an attribute from the "from" clase and put it into a left outer join, but not the other way round (Postgres won't grok that). Note that the attribute is *always* present in the where clause... -> all tests pass again.
1 parent 0548734 commit 732ee27

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

roundup/backends/rdbms_common.py

Lines changed: 4 additions & 4 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: rdbms_common.py,v 1.180 2006-08-30 09:05:30 schlatterbeck Exp $
18+
#$Id: rdbms_common.py,v 1.181 2006-08-30 09:28:26 schlatterbeck Exp $
1919
''' Relational database (SQL) backend common code.
2020
2121
Basics:
@@ -2163,7 +2163,8 @@ def filter(self, search_matches, filterspec, sort=[], group=[]):
21632163
elif isinstance(propclass, Link):
21642164
if p.sort_type < 2:
21652165
if p.children:
2166-
frum.append('_%s as _%s' % (cn, ln))
2166+
if p.sort_type == 0:
2167+
frum.append('_%s as _%s' % (cn, ln))
21672168
where.append('_%s._%s=_%s.id'%(pln, k, ln))
21682169
if p.has_values:
21692170
if isinstance(v, type([])):
@@ -2194,8 +2195,7 @@ def filter(self, search_matches, filterspec, sort=[], group=[]):
21942195
lp = p.cls.labelprop()
21952196
oc = ac = '_%s._%s'%(pln, k)
21962197
if lp != 'id':
2197-
if p.tree_sort_done and (p.sort_type == 2 or not
2198-
p.children):
2198+
if p.tree_sort_done and p.sort_type > 0:
21992199
loj.append(
22002200
'LEFT OUTER JOIN _%s as _%s on _%s._%s=_%s.id'%(
22012201
cn, ln, pln, k, ln))

0 commit comments

Comments
 (0)