(self, compiler)
| 632 | return result, params |
| 633 | |
| 634 | def _get_combinator_part_sql(self, compiler): |
| 635 | features = self.connection.features |
| 636 | # If the columns list is limited, then all combined queries |
| 637 | # must have the same columns list. Set the selects defined on |
| 638 | # the query on all combined queries, if not already set. |
| 639 | selected = self.query.selected |
| 640 | if selected is not None and compiler.query.selected is None: |
| 641 | compiler.query = compiler.query.clone() |
| 642 | compiler.query.set_values(selected) |
| 643 | part_sql, part_args = compiler.as_sql(with_col_aliases=True) |
| 644 | if compiler.query.combinator: |
| 645 | # Wrap in a subquery if wrapping in parentheses isn't |
| 646 | # supported. |
| 647 | if not features.supports_parentheses_in_compound: |
| 648 | part_sql = "SELECT * FROM ({})".format(part_sql) |
| 649 | # Add parentheses when combining with compound query if not |
| 650 | # already added for all compound queries. |
| 651 | elif ( |
| 652 | self.query.subquery |
| 653 | or not features.supports_slicing_ordering_in_compound |
| 654 | ): |
| 655 | part_sql = "({})".format(part_sql) |
| 656 | elif self.query.subquery and features.supports_slicing_ordering_in_compound: |
| 657 | part_sql = "({})".format(part_sql) |
| 658 | return part_sql, part_args |
| 659 | |
| 660 | def get_qualify_sql(self): |
| 661 | where_parts = [] |
no test coverage detected