From cdd041ea60628b2f4fd7f7da562aa19bdb15c206 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 23 Jun 2021 08:50:48 -0400 Subject: consider "*" col as textual ordered Fixed old issue where a :func:`_sql.select()` made against the token "*", which then yielded exactly one column, would fail to correctly organize the ``cursor.description`` column name into the keys of the result object. Fixes: #6665 Change-Id: Ie8c00f62998972ad4a19a750d2642d00fde006f6 --- lib/sqlalchemy/sql/compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index f47ea8f33..8ae56fd54 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -2805,7 +2805,7 @@ class SQLCompiler(Compiled): return " AS " + alias_name_text def _add_to_result_map(self, keyname, name, objects, type_): - if keyname is None: + if keyname is None or keyname == "*": self._ordered_columns = False self._textual_ordered_columns = True if type_._is_tuple_type: -- cgit v1.2.1