diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2020-08-13 21:43:09 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2020-08-13 21:43:09 +0000 |
| commit | b1c3c40e54bafe686065827d5b8d92c35bc50648 (patch) | |
| tree | 8a38d06678f6e89aed04a9e9e285f0c4bd0815f6 /lib/sqlalchemy/orm | |
| parent | cd03b8f0cecbf72ecd6c99c4d3a6338c8278b40d (diff) | |
| parent | 9c0b7baa956a7309f0a95fc36322a759b293eba1 (diff) | |
| download | sqlalchemy-b1c3c40e54bafe686065827d5b8d92c35bc50648.tar.gz | |
Merge "Further fixes for ticket 5470"
Diffstat (limited to 'lib/sqlalchemy/orm')
| -rw-r--r-- | lib/sqlalchemy/orm/context.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/context.py b/lib/sqlalchemy/orm/context.py index a35b2f9fd..0868fb29b 100644 --- a/lib/sqlalchemy/orm/context.py +++ b/lib/sqlalchemy/orm/context.py @@ -923,7 +923,11 @@ class ORMSelectCompileState(ORMCompileState, SelectState): def _simple_statement(self): - if (self.distinct and not self.distinct_on) and self.order_by: + if ( + self.compile_options._use_legacy_query_style + and (self.distinct and not self.distinct_on) + and self.order_by + ): to_add = sql_util.expand_column_list_from_order_by( self.primary_columns, self.order_by ) |
