Released: May 28, 2018
[bug] [orm] Fixed regression in 1.2.7 caused by #4228, which itself was fixing
a 1.2-level regression, where the
query_clscallable passed to a
Sessionwas assumed to be a subclass of
class method availability, as opposed to an arbitrary callable. In
particular, the dogpile caching example illustrates
function and not a
[bug] [engine] Fixed connection pool issue whereby if a disconnection error were raised
during the connection pool's "reset on return" sequence in conjunction with
an explicit transaction opened against the enclosing
object (such as from calling
Session.close()without a rollback or
commit, or calling
Connection.close()without first closing a
transaction declared with
Connection.begin()), a double-checkin would
result, which could then lead towards concurrent checkouts of the same
connection. The double-checkin condition is now prevented overall by an
assertion, as well as the specific double-checkin scenario has been
[bug] [oracle] The Oracle BINARY_FLOAT and BINARY_DOUBLE datatypes now participate within
cx_Oracle.setinputsizes(), passing along NATIVE_FLOAT, so as to support the
NaN value. Additionally,
Float, since these are floating point datatypes, not
decimal. These datatypes were already defaulting the
Float.asdecimalflag to False in line with what
[bug] [oracle] Added reflection capabilities for the
[bug] [ext] The horizontal sharding extension now makes use of the identity token
added to ORM identity keys as part of #4137, when an object
refresh or column-based deferred load or unexpiration operation occurs.
Since we know the "shard" that the object originated from, we make
use of this value when refreshing, thereby avoiding queries against
other shards that don't match this object's identity in any case.
[bug] [sql] Fixed issue where the "ambiguous literal" error message used when
interpreting literal values as SQL expression values would encounter a
tuple value, and fail to format the message properly. Pull request courtesy
[bug] [mssql] Fixed a 1.2 regression caused by #4061 where the SQL Server
"BIT" type would be considered to be "native boolean". The goal here
was to avoid creating a CHECK constraint on the column, however the bigger
issue is that the BIT value does not behave like a true/false constant
and cannot be interpreted as a standalone expression, e.g.
". The SQL Server dialect now goes back to being
non-native boolean, but with an extra flag that still avoids creating
the CHECK constraint.
[bug] [oracle] Altered the Oracle dialect such that when an
Integertype is in
use, the cx_Oracle.NUMERIC type is set up for setinputsizes(). In
SQLAlchemy 1.1 and earlier, cx_Oracle.NUMERIC was passed for all numeric
types unconditionally, and in 1.2 this was removed to allow for better
numeric precision. However, for integers, some database/client setups
will fail to coerce boolean values True/False into integers which introduces
regressive behavior when using SQLAlchemy 1.2. Overall, the setinputsizes
logic seems like it will need a lot more flexibility going forward so this
is a start for that.
[bug] [engine] Fixed a reference leak issue where the values of the parameter dictionary
used in a statement execution would remain referenced by the "compiled
cache", as a result of storing the key view used by Python 3 dictionary
keys(). Pull request courtesy Olivier Grisel.
[bug] [orm] Fixed a long-standing regression that occurred in version
1.0, which prevented the use of a custom
that alters the _params of a
Queryobject for a
lazy load, since the lazy loader itself would overwrite those
parameters. This applies to the "temporal range" example
on the wiki. Note however that the
Query.populate_existing()method is now required in
order to rewrite the mapper options associated with an object
already loaded in the identity map.
As part of this change, a custom defined
MapperOptionwill now cause lazy loaders related to
the target object to use a non-baked query by default unless
MapperOption._generate_cache_key()method is implemented.
In particular, this repairs one regression which occurred when
using the dogpile.cache "advanced" example, which was not
returning cached results and instead emitting SQL due to an
incompatibility with the baked query loader; with the change,
RelationshipCacheoption included for many releases
in the dogpile example will disable the "baked" query altogether.
Note that the dogpile example is also modernized to avoid both
of these issues as part of issue #4258.
[bug] [ext] Fixed a race condition which could occur if automap
AutomapBase.prepare()were used within a multi-threaded context
against other threads which may call
result of use of other mappers. The unfinished mapping work of automap
is particularly sensitive to being pulled in by a
configure_mappers()step leading to errors.
[bug] [orm] Fixed bug where the new
method would not interact with a subquery-eager loader correctly,
in that the "post criteria" would not be applied to embedded
subquery eager loaders. This is related to #4128 in that
the post criteria feature is now used by the lazy loader.
[bug] [tests] Fixed a bug in the test suite where if an external dialect returned
server_version_info, the exclusion logic would raise an
[bug] [orm] Updated the dogpile.caching example to include new structures that
accommodate for the "baked" query system, which is used by default within
lazy loaders and some eager relationship loaders. The dogpile.caching
"relationship_caching" and "advanced" examples were also broken due to
#4256. The issue here is also worked-around by the fix in