]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Invoke column_expression() for subsequent SELECTs in CompoundSelect
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 29 Jul 2019 18:49:22 +0000 (14:49 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 29 Jul 2019 18:53:19 +0000 (14:53 -0400)
commit50bd166381f8633bfd84c2f299857dc4f21d2b5d
treebcb4dab32c7c596ece1f4e3ac0f2d2adbc913852
parenta2418eb6933a2632fce76fb8023bbf62a570d496
Invoke column_expression() for subsequent SELECTs in CompoundSelect

Fixed bug where :meth:`.TypeEngine.column_expression` method would not be
applied to subsequent SELECT statements inside of a UNION or other
:class:`.CompoundSelect`, even though the SELECT statements are rendered at
the topmost level of the statement.   New logic now differentiates between
rendering the column expression, which is needed for all SELECTs in the
list, vs. gathering the returned data type for the result row, which is
needed only for the first SELECT.

Fixes: #4787
Change-Id: Iceb63e430e76d2365649aa25ead09c4e2a062e10
(cherry picked from commit 2ce8a04e726daecbf060684dcee7559634506700)
doc/build/changelog/unreleased_13/4787.rst [new file with mode: 0644]
lib/sqlalchemy/sql/compiler.py
test/sql/test_type_expressions.py