1.3.5
Released: June 17, 2019
-
[bug] [mysql] Fixed bug where MySQL ON DUPLICATE KEY UPDATE would not accommodate setting
a column to the value NULL. Pull request courtesy Lukáš Banič.References: #4715
-
[bug] [orm] Fixed a series of related bugs regarding joined table inheritance more than
two levels deep, in conjunction with modification to primary key values,
where those primary key columns are also linked together in a foreign key
relationship as is typical for joined table inheritance. The intermediary
table in a three-level inheritance hierarchy will now get its UPDATE if
only the primary key value has changed and passive_updates=False (e.g.
foreign key constraints not being enforced), whereas before it would be
skipped; similarly, with passive_updates=True (e.g. ON UPDATE CASCADE in
effect), the third-level table will not receive an UPDATE statement as was
the case earlier which would fail since CASCADE already modified it. In a
related issue, a relationship linked to a three-level inheritance hierarchy
on the primary key of an intermediary table of a joined-inheritance
hierarchy will also correctly have its foreign key column updated when the
parent object's primary key is modified, even if that parent object is a
subclass of the linked parent class, whereas before these classes would
not be counted.References: #4723
-
[bug] [orm] Fixed bug where the
Mapper.all_orm_descriptors
accessor would
return an entry for theMapper
itself under the declarative
__mapper___
key, when this is not a descriptor. The.is_attribute
flag that's present on allInspectionAttr
objects is now
consulted, which has also been modified to beTrue
for an association
proxy, as it was erroneously set to False for this object.References: #4729
-
[bug] [orm] Fixed regression in
Query.join()
where thealiased=True
flag
would not properly apply clause adaptation to filter criteria, if a
previous join were made to the same entity. This is because the adapters
were placed in the wrong order. The order has been reversed so that the
adapter for the most recentaliased=True
call takes precedence as was
the case in 1.2 and earlier. This broke the "elementtree" examples among
other things.References: #4704
-
[bug] [orm] [py3k] Replaced the Python compatbility routines for
getfullargspec()
with a
fully vendored version from Python 3.3. Originally, Python was emitting
deprecation warnings for this function in Python 3.8 alphas. While this
change was reverted, it was observed that Python 3 implementations for
getfullargspec()
are an order of magnitude slower as of the 3.4 series
where it was rewritten againstSignature
. While Python plans to
improve upon this situation, SQLAlchemy projects for now are using a simple
replacement to avoid any future issues.References: #4674
-
[bug] [orm] Reworked the attribute mechanics used by
AliasedClass
to no
longer rely upon calling__getattribute__
on the MRO of the wrapped
class, and to instead resolve the attribute normally on the wrapped class
using getattr(), and then unwrap/adapt that. This allows a greater range
of attribute styles on the mapped class including special__getattr__()
schemes; but it also makes the code simpler and more resilient in general.References: #4694
-
[postgresql] [usecase] Added support for column sorting flags when reflecting indexes for
PostgreSQL, including ASC, DESC, NULLSFIRST, NULLSLAST. Also adds this
facility to the reflection system in general which can be applied to other
dialects in future releases. Pull request courtesy Eli Collins.References: #4717
-
[bug] [postgresql] Fixed bug where PostgreSQL dialect could not correctly reflect an ENUM
datatype that has no members, returning a list withNone
for the
get_enums()
call and raising a TypeError when reflecting a column which
has such a datatype. The inspection now returns an empty list.References: #4701
-
[bug] [sql] Fixed a series of quoting issues which all stemmed from the concept of the
literal_column()
construct, which when being "proxied" through a
subquery to be referred towards by a label that matches its text, the label
would not have quoting rules applied to it, even if the string in the
Label
were set up as aquoted_name
construct. Not
applying quoting to the text of theLabel
is a bug because this
text is strictly a SQL identifier name and not a SQL expression, and the
string should not have quotes embedded into it already unlike the
literal_column()
which it may be applied towards. The existing
behavior of a non-labeledliteral_column()
being propagated as is on
the outside of a subquery is maintained in order to help with manual
quoting schemes, although it's not clear if valid SQL can be generated for
such a construct in any case.References: #4730