comparison roundup/backends/rdbms_common.py @ 6403:9957d8d10783

Tests and bug-fix for issue2551119 .. and some other failing tests I came up with when trying to reproduce the problem of the issue.
author Ralf Schlatterbeck <rsc@runtux.com>
date Mon, 10 May 2021 16:19:37 +0200
parents 619807d9a2df
children 7b1b6dffc7ed
comparison
equal deleted inserted replaced
6402:619807d9a2df 6403:9957d8d10783
2583 if 'search' in p.need_for: 2583 if 'search' in p.need_for:
2584 mlfilt = 1 2584 mlfilt = 1
2585 tn = propclass.table_name 2585 tn = propclass.table_name
2586 nid = propclass.nodeid_name 2586 nid = propclass.nodeid_name
2587 lid = propclass.linkid_name 2587 lid = propclass.linkid_name
2588 frum.append(tn)
2589 if p.children or p.need_child_retired:
2590 frum.append('_%s as _%s' % (cn, ln))
2591 where.append('%s.%s=_%s.id'%(tn, lid, ln))
2592 if p.need_child_retired:
2593 where.append('_%s.__retired__=0'%(ln))
2594 # Note: need the where-clause if p has
2595 # children that compute additional restrictions
2596 if (not p.has_values
2597 or (not isinstance(v, type([])) and v != '-1')
2598 or p.children):
2599 where.append('_%s.id=%s.%s'%(pln, tn, nid))
2588 if v in ('-1', ['-1'], []): 2600 if v in ('-1', ['-1'], []):
2589 # only match rows that have count(linkid)=0 in the 2601 # only match rows that have count(linkid)=0 in the
2590 # corresponding multilink table) 2602 # corresponding multilink table)
2591 where.append(self._subselect(p)) 2603 where.append(self._subselect(p))
2592 else: 2604 else:
2593 frum.append(tn)
2594
2595 if p.children or p.need_child_retired:
2596 frum.append('_%s as _%s' % (cn, ln))
2597 where.append('%s.%s=_%s.id'%(tn, lid, ln))
2598 if p.need_child_retired:
2599 where.append('_%s.__retired__=0'%(ln))
2600
2601 if not p.has_values or not isinstance(v, type([])):
2602 where.append('_%s.id=%s.%s'%(pln, tn, nid))
2603 if p.has_values: 2605 if p.has_values:
2604 if isinstance(v, type([])): 2606 if isinstance(v, type([])):
2605 # The where-clause above is conditionally 2607 # The where-clause above is conditionally
2606 # created in _filter_multilink_expression 2608 # created in _filter_multilink_expression
2607 w, arg = self._filter_multilink_expression(p, v) 2609 w, arg = self._filter_multilink_expression(p, v)

Roundup Issue Tracker: http://roundup-tracker.org/