summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/elements.py
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2019-10-05 00:05:33 +0000
committerGerrit Code Review <gerrit@bbpush.zzzcomputing.com>2019-10-05 00:05:33 +0000
commitc6abd4766abb0396c9bf532d81d16226b970a35a (patch)
tree5ac87ae9557926cceacc2a58ece4b43053a6798f /lib/sqlalchemy/sql/elements.py
parentb73c191903d5f23b02188474f6a8a1b877988a40 (diff)
parent485216dea6d7a5814d200b4f14b8a363ed0f8caa (diff)
downloadsqlalchemy-c6abd4766abb0396c9bf532d81d16226b970a35a.tar.gz
Merge "Deprecate textual column matching in Row"
Diffstat (limited to 'lib/sqlalchemy/sql/elements.py')
-rw-r--r--lib/sqlalchemy/sql/elements.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index 3045cb84e..8ee157b6f 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -4278,7 +4278,13 @@ class ColumnClause(roles.LabeledColumnExprRole, Immutable, ColumnElement):
label = quoted_name(label, t.name.quote)
# ensure the label name doesn't conflict with that
- # of an existing column
+ # of an existing column. note that this implies that any
+ # Column must **not** set up its _label before its parent table
+ # has all of its other Column objects set up. There are several
+ # tables in the test suite which will fail otherwise; example:
+ # table "owner" has columns "name" and "owner_name". Therefore
+ # column owner.name cannot use the label "owner_name", it has
+ # to be "owner_name_1".
if label in t.c:
_label = label
counter = 1
@@ -4339,7 +4345,6 @@ class ColumnClause(roles.LabeledColumnExprRole, Immutable, ColumnElement):
c._proxies = [self]
if selectable._is_clone_of is not None:
c._is_clone_of = selectable._is_clone_of.columns.get(c.key)
-
return c.key, c