Skip to content
Snippets Groups Projects
Commit 7b8e124f230c authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

fix solutions computation crash with some query using sub-queries (closes #37423)

parent 5a8ae1ed1c84
No related branches found
No related tags found
No related merge requests found
ChangeLog for RQL
=================
--
* fix solutions computation crash with some query using sub-queries (closes #37423)
2010-07-28 -- 0.26.4
* fix re-annotation pb: some stinfo keys were not properly reinitialized
which may cause pb later (at sql generation time for instance)
......
......@@ -377,8 +377,8 @@
alltypes.add(targettypes)
else:
alltypes = get_target_types()
constraints.var_has_types( var, [ str(t) for t in alltypes] )
domain = constraints.domains[var]
constraints.var_has_types( var, [str(t) for t in alltypes if t in domain] )
def visit(self, node, uid_func_mapping=None, kwargs=None, debug=False):
# FIXME: not thread safe
......@@ -509,5 +509,6 @@
samevar = True
else:
rhsvars.append(v.name)
lhsdomain = constraints.domains[lhsvar]
if rhsvars:
s2 = '=='.join(rhsvars)
......@@ -512,4 +513,6 @@
if rhsvars:
s2 = '=='.join(rhsvars)
# filter according to domain necessary for column aliases
rhsdomain = constraints.domains[rhsvars[0]]
res = []
for fromtype, totypes in rschema.associations():
......@@ -514,5 +517,8 @@
res = []
for fromtype, totypes in rschema.associations():
res.append( [ ( [lhsvar], [str(fromtype)]), (rhsvars, [ str(t) for t in totypes]) ] )
if not fromtype in lhsdomain:
continue
ptypes = [str(t) for t in totypes if t in rhsdomain]
res.append( [ ( [lhsvar], [str(fromtype)]), (rhsvars, ptypes) ] )
constraints.or_and( res )
else:
......@@ -517,6 +523,8 @@
constraints.or_and( res )
else:
constraints.var_has_types( lhsvar, [ str(subj) for subj in rschema.subjects()] )
ptypes = [str(subj) for subj in rschema.subjects()
if subj in lhsdomain]
constraints.var_has_types( lhsvar, ptypes )
if samevar:
res = []
for fromtype, totypes in rschema.associations():
......@@ -520,7 +528,7 @@
if samevar:
res = []
for fromtype, totypes in rschema.associations():
if not fromtype in totypes:
if not (fromtype in totypes and fromtype in lhsdomain):
continue
res.append(str(fromtype))
constraints.var_has_types( lhsvar, res )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment