Fixed bug in :meth:`.Insert.values` where using the "multi-values"
format in combination with :class:`.Column` objects as keys rather
than strings would fail. Pull request courtesy Aubrey Stark-Toller.
Mike Bayer [Wed, 10 Jan 2018 20:27:33 +0000 (15:27 -0500)]
Set up of_type variable for legacy loader option deserialize
Fixed regression where pickle format of a Load / _UnboundLoad object (e.g.
loader options) changed and ``__setstate__()`` was raising an
UnboundLocalError for an object received from the legacy format, even
though an attempt was made to do so. tests are now added to ensure this
works.
Mike Bayer [Wed, 10 Jan 2018 04:35:23 +0000 (23:35 -0500)]
Disable the singletonthreadpool test cleanup no gc
This test often fails on CI under load and reveals a small
race condition within SingleonThreadPool's "cleanup" system.
As this pool's "cleanup" system is pretty much never used in
any case since this pool is no longer used for SQLite file
databases, this race should have little impact, especially
since the occasional non-closed connection will get closed
out when it's GC'ed in any case.
Mike Bayer [Mon, 8 Jan 2018 21:05:23 +0000 (16:05 -0500)]
Re-enable setinputsizes for Oracle TIMESTAMP
Fixed regression where the removal of most setinputsizes
rules from cx_Oracle dialect impacted the TIMESTAMP
datatype's ability to retrieve fractional seconds.
Mike Bayer [Thu, 4 Jan 2018 21:58:55 +0000 (16:58 -0500)]
Don't try to iterate chopped path if it's None
Fixed regression caused by new lazyload caching scheme in :ticket:`3954`
where a query that makes use of loader options with of_type would cause
lazy loads of unrelated paths to fail with a TypeError.
Mike Bayer [Thu, 4 Jan 2018 19:09:32 +0000 (14:09 -0500)]
Check for object was expunged before restoring after pk switch + rollback
Fixed bug where an object that is expunged during a rollback of
a nested or subtransaction which also had its primary key mutated
would not be correctly removed from the session, causing subsequent
issues in using the session.
Mike Bayer [Thu, 4 Jan 2018 15:44:53 +0000 (10:44 -0500)]
Add rule to prevent "GROUP BY <expr>" in tests
Added a new exclusion rule group_by_complex_expression
which disables tests that use "GROUP BY <expr>", which seems
to be not viable for at least two third party dialects.
Mike Bayer [Tue, 2 Jan 2018 22:56:45 +0000 (17:56 -0500)]
Check for the endmost target when chaining contains()
Fixed regression in association proxy due to :ticket:`3769`
(allow for chained any() / has()) where contains() against
an association proxy chained in the form
(o2m relationship, associationproxy(m2o relationship, m2o relationship))
would raise an error regarding the re-application of contains()
on the final link of the chain.
Mike Bayer [Thu, 14 Dec 2017 15:20:50 +0000 (10:20 -0500)]
Add an identity_token to the identity key
For the purposes of assisting with sharded setups, add a new
member to the identity key that can be customized. this allows
sharding across databases where the primary key space is shared.
Mike Bayer [Fri, 15 Dec 2017 15:56:18 +0000 (10:56 -0500)]
Open up all cx_Oracle numeric tests, finish infinity support
Added some additional rules to fully handle ``Decimal('Infinity')``,
``Decimal('-Infinity')`` values with cx_Oracle numerics when using
``asdecimal=True``.
Allow remaining cx_Oracle numeric tests that were waiting
for the refactor to be finished and forgot to get enabled.
Mike Bayer [Thu, 14 Dec 2017 18:58:58 +0000 (13:58 -0500)]
Fully copy index expressions
Fixed bug where the :meth:`.Table.tometadata` method would not properly
accommodate :class:`.Index` objects that didn't consist of simple
column expressions, such as indexes against a :func:`.text` construct,
indexes that used SQL expressions or :attr:`.func`, etc. The routine
now copies expressions fully to a new :class:`.Index` object while
substituting all table-bound :class:`.Column` objects for those
of the target table.
Also refined the means by which tometadata() checks if an Index
or UniqueConstraint is generated by a column-level flag, by propagating
an attribute "_column_flag=True" to such indexes/constraints.
Mike Bayer [Wed, 6 Dec 2017 21:22:31 +0000 (16:22 -0500)]
Disable eager loads for exists()
The :meth:`.Query.exists` method will now disable eager loaders for when
the query is rendered. Previously, joined-eager load joins would be rendered
unnecessarily as well as subquery eager load queries would be needlessly
generated. The new behavior matches that of the :meth:`.Query.subquery`
method.
Mike Bayer [Wed, 6 Dec 2017 19:12:42 +0000 (14:12 -0500)]
Change visit name for ColumnElement
No SQLA built-in subclasses ColumnElement without specifying
an alternate visit_name, and user defined ColumnElement
subclasses should avoid being treated like ColumnClause,
e.g. where a Table is present.
inytar [Mon, 30 Oct 2017 16:01:49 +0000 (12:01 -0400)]
Allow delete where clause to refer multiple tables.
Implemented "DELETE..FROM" syntax for Postgresql, MySQL, MS SQL Server
(as well as within the unsupported Sybase dialect) in a manner similar
to how "UPDATE..FROM" works. A DELETE statement that refers to more than
one table will switch into "multi-table" mode and render the appropriate
"USING" or multi-table "FROM" clause as understood by the database.
Pull request courtesy Pieter Mulder.
Mike Bayer [Mon, 4 Dec 2017 22:51:21 +0000 (17:51 -0500)]
Add missing changelog note for #4109
No changelog note was written at all for #4109 despite
this feature being released as of 1.2.0b3 (based on merge
date of 10/10/2017 and 1.2.0b3 release date of 10/13/2017
Mike Bayer [Fri, 3 Nov 2017 15:11:48 +0000 (11:11 -0400)]
Intercept contains_eager() with of_type, set aliased / polymorphic
Fixed bug in :func:`.contains_eager` query option where making use of a
path that used :meth:`.PropComparator.of_type` to refer to a subclass
across more than one level of joins would also require that the "alias"
argument were provided with the same subtype in order to avoid adding
unwanted FROM clauses to the query; additionally, using
:func:`.contains_eager` across subclasses that use :func:`.aliased` objects
of subclasses as the :meth:`.PropComparator.of_type` argument will also
render correctly.
Mike Bayer [Mon, 4 Dec 2017 21:40:20 +0000 (16:40 -0500)]
Propagate attachment events for ARRAY
Fixed regression in :class:`.ARRAY` datatype caused by
:ticket:`3964`, which is essentially the same
issue as that of :ticket:`3832`, where column attachment events
for :class:`.ARRAY` would not be invoked. This breaks the use case
of using declarative mixins that declare a :class:`.Column` which
makes use of :meth:`.MutableList.as_mutable`.
Mike Bayer [Mon, 4 Dec 2017 16:56:14 +0000 (11:56 -0500)]
Allow url.password to be an object
The "password" attribute of the :class:`.url.URL` object can now be
any user-defined or user-subclassed string object that responds to the
Python ``str()`` builtin. The object passed will be maintained as the
datamember :attr:`.url.URL.password_original` and will be consulted
when the :attr:`.url.URL.password` attribute is read to produce the
string value.
Mike Bayer [Fri, 1 Dec 2017 18:22:23 +0000 (13:22 -0500)]
Fix regexp for expanding IN
Fixed bug in new "expanding bind parameter" feature whereby if multiple
params were used in one statement, the regular expression would not
match the parameter name correctly.
Mike Bayer [Mon, 13 Nov 2017 14:21:48 +0000 (09:21 -0500)]
Propagate kwargs for mysql concat, match
Fixed bug where the MySQL "concat" and "match" operators failed to
propagate kwargs to the left and right expressions, causing compiler
options such as "literal_binds" to fail.
Also adds non-interpreted **kw for visit_create_index, visit_typeclause
Mike Bayer [Sun, 12 Nov 2017 23:44:41 +0000 (18:44 -0500)]
Add baked.Result.with_post_criteria method
Added new method :meth:`.baked.Result.with_post_criteria` to baked
query system, allowing non-SQL-modifying transformations to take place
after the query has been pulled from the cache. Among other things,
this method can be used with :class:`.horizontal_shard.ShardedQuery`
to set the shard identifier. :class:`.horizontal_shard.ShardedQuery`
has also been modified such that its :meth:`.ShardedQuery.get` method
interacts correctly with that of :class:`.baked.Result`.
Mike Bayer [Sat, 28 Oct 2017 17:28:58 +0000 (13:28 -0400)]
Filter attributes we don't map during a load_scalar_attributes
Fixed bug where a descriptor that is elsewhere a mapped column
or relationship within a hierarchy based on :class:`.AbstractConcreteBase`
would be referred towards during a refresh operation, causing an error
as the attribute is not mapped as a mapper property.
A similar issue can arise for other attributes like the "type" column
added by :class:`.AbstractConcreteBase` if the class fails to include
"concrete=True" in its mapper, however the check here should also
prevent that scenario from causing a problem.
Mike Bayer [Wed, 25 Oct 2017 19:01:55 +0000 (15:01 -0400)]
Test for EXCLUDE constraint duplicated index
An EXCLUDE constraint makes an index just like a UNIQUE does;
get_indexes() will receive this. Test that this works out the
same way as it does for a UNIQUE.
Ben Shen [Fri, 20 Oct 2017 15:31:59 +0000 (11:31 -0400)]
Fix / consolidate for SQL Server BINARY, VARBINARY
Fixed bug where sqltypes.BINARY and sqltypes.VARBINARY datatypes
would not include correct bound-value handlers for pyodbc,
which allows the pyodbc.NullParam value to be passed that
helps with FreeTDS.
Mike Bayer [Tue, 24 Oct 2017 22:08:05 +0000 (18:08 -0400)]
Rework autoescape to be a simple boolean; escape the escape character
Reworked the new "autoescape" feature introduced in
:ref:`change_2694` in 1.2.0b2 to be fully automatic; the escape
character now defaults to a forwards slash ``"/"`` and
is applied to percent, underscore, as well as the escape
character itself, for fully automatic escaping. The
character can also be changed using the "escape" parameter.
Daniel Thorell [Fri, 20 Oct 2017 16:59:55 +0000 (12:59 -0400)]
Remove deprecation warnings mysql5 7 20
MySQL 5.7.20 now warns for use of the @tx_isolation variable; a version
check is now performed and uses @transaction_isolation instead
to prevent this warning.
Mike Bayer [Fri, 20 Oct 2017 18:34:16 +0000 (14:34 -0400)]
Resolve AliasedClass when determining owning class of association proxy
Fixed bug where the association proxy would inadvertently link itself
to an :class:`.AliasedClass` object if it were called first with
the :class:`.AliasedClass` as a parent, causing errors upon subsequent
usage.
Mike Bayer [Thu, 19 Oct 2017 01:17:00 +0000 (21:17 -0400)]
Don't commit failed transaction
The test here commits even though integrityerror
was raised due to the fixture. Postgresql seems to allow
this even though it's usually strict about this. remove
the requirement that a database needs to be able to
commit after an integrity error was raised.
Jan [Wed, 18 Oct 2017 01:23:19 +0000 (21:23 -0400)]
add order_by clause to make tests stable
I observed test runs that failed on 'test_bound_in_scalar' due to arbitrary ordering of the result set. The assertion not only tests for the elements to be present, but also for the correct ordering. Hence, the proposal to add an order_by clause to the select statements.