ResultSet.union() terms compatibility check is too restrictive
Bug #381692 reported by
Celso Providelo
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
New
|
Undecided
|
Unassigned |
Bug Description
In order to setup a UNION ResultSet successfully the find_spec in both terms has to be identical and sometimes that's too restrictive. For instance:
{{{
result1 = self.store.
result2 = self.store.
result = result1.
}}}
For SQL and FuncExpr items, it seems that it would be safe enough to continue even if the they are not identical objects.
Related branches
To post a comment you must log in.
If you want the attached branch to be reviewed, please submit a merge proposal.
Taking a quick look at the diff, I have a few comments:
1. you probably only want to do this sort of check if is_expr1 is True.
2. it would be better to check that both expressions have the same variable factory (i.e. getattr(info1, "variable_factory", Variable) is the same as getattr(info2, "variable_factory", Variable)).
Special casing SQL and FuncExpr seems wrong.