Change join type from LOUTER to INNER for all joins in aliases. Similarly to promote_joins(), this method must ensure no join chains containing first an outer, then an inner join are generated. If we are demoting b->c join in chain a LOUTER b LOUTER c then we must
(self, aliases)
| 970 | ) |
| 971 | |
| 972 | def demote_joins(self, aliases): |
| 973 | """ |
| 974 | Change join type from LOUTER to INNER for all joins in aliases. |
| 975 | |
| 976 | Similarly to promote_joins(), this method must ensure no join chains |
| 977 | containing first an outer, then an inner join are generated. If we |
| 978 | are demoting b->c join in chain a LOUTER b LOUTER c then we must |
| 979 | demote a->b automatically, or otherwise the demotion of b->c doesn't |
| 980 | actually change anything in the query results. . |
| 981 | """ |
| 982 | aliases = list(aliases) |
| 983 | while aliases: |
| 984 | alias = aliases.pop(0) |
| 985 | if self.alias_map[alias].join_type == LOUTER: |
| 986 | self.alias_map[alias] = self.alias_map[alias].demote() |
| 987 | parent_alias = self.alias_map[alias].parent_alias |
| 988 | if self.alias_map[parent_alias].join_type == INNER: |
| 989 | aliases.append(parent_alias) |
| 990 | |
| 991 | def reset_refcounts(self, to_counts): |
| 992 | """ |
no test coverage detected