Skip to content

Commit a0cab8e

Browse files
author
Ralf Schlatterbeck
committed
More transitive-property work.
- Add some more tests that break the current SQL backend implementation for transitive properties. One of them looks like a Postgres bug to me -- I'm getting: """ProgrammingError: ERROR: relation "_user2" does not exist""" where _user2 is an alias for _user in the from clause (but _user2 is used in a left outer join). The other SQL backends are fine with the generated SQL. Hmm. One of the reasons for packing sort and search attributes into the same data structure was the optimized SQL: not creating a left outer join for attributes that are already in a normal join (from/where clause). I'll check if I can instead leave the attribute from the from-clause instead (or if I'm then getting errors from the other backends, Postgres seems fine with that).
1 parent 0b55c00 commit a0cab8e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

test/db_test_base.py

Lines changed: 13 additions & 1 deletion
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.77 2006-08-23 12:57:10 schlatterbeck Exp $
18+
# $Id: db_test_base.py,v 1.78 2006-08-30 08:50:44 schlatterbeck Exp $
1919

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

@@ -1122,6 +1122,8 @@ def testFilteringLinkSortGroup(self):
11221122
['4', '3'])
11231123
ae(filt(None, {'priority.order':'3'}, ('+','status'), ('+','priority')),
11241124
['4', '3'])
1125+
ae(filt(None, {'priority':['2','3']}, ('+','priority'), ('+','status')),
1126+
['1', '4', '2', '3'])
11251127
ae(filt(None, {}, ('+','priority'), ('+','status')),
11261128
['1', '4', '2', '3'])
11271129

@@ -1252,6 +1254,16 @@ def testFilteringTransitiveLinkSort(self):
12521254
('+','assignedto.supervisor.supervisor'),
12531255
('-','assignedto.supervisor'), ('+','assignedto'), ('+','status')]),
12541256
['4', '5', '7', '6', '8', '1', '2', '3'])
1257+
ae(filt(None, {'assignedto':['6','7','8','9','10']},
1258+
[('+','assignedto.supervisor.supervisor.supervisor'),
1259+
('+','assignedto.supervisor.supervisor'),
1260+
('-','assignedto.supervisor'), ('+','assignedto'), ('+','status')]),
1261+
['4', '5', '7', '6', '8', '1', '2', '3'])
1262+
ae(filt(None, {'assignedto':['6','7','8','9']},
1263+
[('+','assignedto.supervisor.supervisor.supervisor'),
1264+
('+','assignedto.supervisor.supervisor'),
1265+
('-','assignedto.supervisor'), ('+','assignedto'), ('+','status')]),
1266+
['4', '5', '1', '2', '3'])
12551267

12561268
def testFilteringTransitiveLinkSortNull(self):
12571269
"""Check sorting of NULL values"""

0 commit comments

Comments
 (0)