]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
7 years agoFix reference leak in compiled cache
Olivier Grisel [Wed, 25 Apr 2018 13:54:00 +0000 (09:54 -0400)] 
Fix reference leak in compiled cache

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.

Change-Id: Icfb0f38111a165780f6dd3e4e3382a03df79ce26
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/441

7 years agocherry-pick changelog update for 1.2.8
Mike Bayer [Fri, 20 Apr 2018 20:35:53 +0000 (16:35 -0400)] 
cherry-pick changelog update for 1.2.8

7 years agocherry-pick changelog from 1.2.7
Mike Bayer [Fri, 20 Apr 2018 20:35:53 +0000 (16:35 -0400)] 
cherry-pick changelog from 1.2.7

7 years agoRefactor "get" to allow for pluggable identity token schemes
Mike Bayer [Fri, 20 Apr 2018 15:44:09 +0000 (11:44 -0400)] 
Refactor "get" to allow for pluggable identity token schemes

Fixed regression in 1.2 within sharded query feature where the
new "identity_token" element was not being correctly considered within
the scope of a lazy load operation, when searching the identity map
for a related many-to-one element.   The new behavior will allow for
making use of the "id_chooser" in order to determine the best identity
key to retrieve from the identity map.  In order to achieve this, some
refactoring of 1.2's "identity_token" approach has made some slight changes
to the implementation of ``ShardedQuery`` which should be noted for other
derivations of this class.

Change-Id: I04fa60535deec2d0cdec89f602935dfebeb9eb9d
Fixes: #4228
7 years ago- more type cache warmup
Mike Bayer [Fri, 20 Apr 2018 18:34:52 +0000 (14:34 -0400)] 
- more type cache warmup

Change-Id: I1b4327d38b5a09b73298c99f37919ee9f48aad0b

7 years agobump variance for these sqlite-sensitive tests
Mike Bayer [Fri, 20 Apr 2018 17:53:18 +0000 (13:53 -0400)] 
bump variance for these sqlite-sensitive tests

Change-Id: I351c277afca7e53afc887c77a8b6dcaccf75d165

7 years agoDocument how to opt-out of NCHAR for cx_Oracle
Mike Bayer [Fri, 20 Apr 2018 17:31:45 +0000 (13:31 -0400)] 
Document how to opt-out of NCHAR for cx_Oracle

Unfortunately, we need to bind Python unicode values as
NCHAR as in the case where non-ascii characters are present,
it's necessary.  We can't know in all cases how this value is being
used, so in those cases where Oracle will not accept NCHAR the
user should explicitly cast a value down to String.

Change-Id: I1a70739033435a7bf5effe2fa810ab064cea9188
Fixes: #4242
7 years agoupdate callcounts for py36, get rid of old callcounts
Mike Bayer [Fri, 20 Apr 2018 16:42:07 +0000 (12:42 -0400)] 
update callcounts for py36, get rid of old callcounts

Change-Id: Ib732ffa57c6c398d77ae2d3e0ac9b5cc09b40b4b

7 years ago- add version 1.3.0b1
Mike Bayer [Thu, 19 Apr 2018 22:21:13 +0000 (18:21 -0400)] 
- add version 1.3.0b1

Change-Id: If993c37ead1497b246816663bb65038630822676

7 years agoMerge "Ensure select_from_entity adapter is used in adjust_for_single_inheritance"
mike bayer [Thu, 19 Apr 2018 22:20:22 +0000 (18:20 -0400)] 
Merge "Ensure select_from_entity adapter is used in adjust_for_single_inheritance"

7 years agoEnsure select_from_entity adapter is used in adjust_for_single_inheritance
Mike Bayer [Thu, 19 Apr 2018 21:07:32 +0000 (17:07 -0400)] 
Ensure select_from_entity adapter is used in adjust_for_single_inheritance

Fixed issue in single-inheritance loading where the use of an aliased
entity against a single-inheritance subclass in conjunction with the
:meth:`.Query.select_from` method would cause the SQL to be rendered with
the unaliased table mixed in to the query, causing a cartesian product.  In
particular this was affecting the new "selectin" loader when used against a
single-inheritance subclass.

Change-Id: Ic2cbe94a5269c101b1f98da9a466180dd4452783
Fixes: #4241
7 years agoMerge "Render and reflect MySQL WITH PARSER index options"
mike bayer [Tue, 17 Apr 2018 23:46:28 +0000 (19:46 -0400)] 
Merge "Render and reflect MySQL WITH PARSER index options"

7 years agoRender and reflect MySQL WITH PARSER index options
Mike Bayer [Tue, 17 Apr 2018 17:22:13 +0000 (13:22 -0400)] 
Render and reflect MySQL WITH PARSER index options

Support added for the "WITH PARSER" syntax of CREATE FULLTEXT INDEX
in MySQL, using the ``mysql_with_parser`` keyword argument.  Reflection
is also supported, which accommodates MySQL's special comment format
for reporting on this option as well.  Additionally, the "FULLTEXT" and
"SPATIAL" index prefixes are now reflected back into the ``mysql_prefix``
index option.

Change-Id: I0209291978125d8cee1bb5ed386d4f66578697a0
Fixes: #4219
7 years agoFix - Order of records is not guaranteed
Pat Buxton [Mon, 16 Apr 2018 14:06:13 +0000 (10:06 -0400)] 
Fix - Order of records is not guaranteed

 * Causes intermittent failure against Greenplum cluster
 * Tested using Greenplum dialact:
     https://github.com/PlaidCloud/sqlalchemy-greenplum

Change-Id: I6387e98f17a3667612fdaaadb27a08f79ec46398
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/440

7 years agoReflect Oracle NUMBER(NULL, 0) as INTEGER
Kent Bower [Wed, 11 Apr 2018 21:21:26 +0000 (17:21 -0400)] 
Reflect Oracle NUMBER(NULL, 0) as INTEGER

The Oracle NUMBER datatype is reflected as INTEGER if the precision is NULL
and the scale is zero, as this is how INTEGER values come back when
reflected from Oracle's tables.  Pull request courtesy Kent Bower.

Change-Id: I4627febd46cab7085299c0a5700ee0f0bdca513c
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/437

7 years agoMerge "Correct join for FKs with schema in SQL Server"
mike bayer [Wed, 11 Apr 2018 19:28:13 +0000 (15:28 -0400)] 
Merge "Correct join for FKs with schema in SQL Server"

7 years agoCorrect join for FKs with schema in SQL Server
Mike Bayer [Wed, 11 Apr 2018 13:29:00 +0000 (09:29 -0400)] 
Correct join for FKs with schema in SQL Server

Fixed 1.2 regression caused by :ticket:`4060` where the query used to
reflect SQL Server cross-schema foreign keys was limiting the criteria
incorrectly.

Additionally, added some rework of the inter-schema reflection tests
so that MySQL, MSSQL can be included, breaking out some of the
Postgresql-specific behaviors into separate requirements.

Fixes: #4234
Change-Id: I20c8e70707075f1767b79127c2c27d4b313c6515

7 years agoUpdate argument name for distinct() to match docs
Michael Williamson [Wed, 11 Apr 2018 15:21:20 +0000 (11:21 -0400)] 
Update argument name for distinct() to match docs

A tiny change so that the docs are more consistent. At the moment, the same argument is given two different names.

Change-Id: Ic487006887d048700f260b2ae4a05d9a380412c1
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/439

7 years agoRaise informative exception for non-sortable PK
Mike Bayer [Fri, 6 Apr 2018 15:39:15 +0000 (11:39 -0400)] 
Raise informative exception for non-sortable PK

An informative exception is re-raised when a primary key value is not
sortable in Python during an ORM flush under Python 3, such as an ``Enum``
that has no ``__lt__()`` method; normally Python 3 raises a ``TypeError``
in this case.   The flush process sorts persistent objects by primary key
in Python so the values must be sortable.

Change-Id: Ia186968982dcd1234b82f2e701fefa2a1668a7e4
Fixes: #4232
7 years agoMerge "Ensure all visit_sequence accepts **kw args"
mike bayer [Thu, 5 Apr 2018 01:06:35 +0000 (21:06 -0400)] 
Merge "Ensure all visit_sequence accepts **kw args"

7 years agoEnsure all visit_sequence accepts **kw args
Mike Bayer [Wed, 4 Apr 2018 17:36:28 +0000 (13:36 -0400)] 
Ensure all visit_sequence accepts **kw args

Fixed issue where the compilation of an INSERT statement with the
"literal_binds" option that also uses an explicit sequence and "inline"
generation, as on Postgresql and Oracle, would fail to accommodate the
extra keyword argument within the sequence processing routine.

Change-Id: Ibdab7d340aea7429a210c9535ccf1a3e85f074fb
Fixes: #4231
7 years agoUse base __ne__ implementation for range types w/ None
Mike Bayer [Tue, 3 Apr 2018 19:35:00 +0000 (15:35 -0400)] 
Use base __ne__ implementation for range types w/ None

Fixed bug where the special "not equals" operator for the Postgresql
"range" datatypes such as DATERANGE would fail to render "IS NOT NULL" when
compared to the Python ``None`` value.

Also break up range tests into backend round trip and straight
compilation suites.

Change-Id: Ibaee132b1ea7dac8b799495a27f98f82a7d9c028
Fixes: #4229
7 years agoAdd postgresl.REGCLASS type for casting table names to OIDs and vice versa
Sebastian Bank [Mon, 2 Apr 2018 15:25:08 +0000 (11:25 -0400)] 
Add postgresl.REGCLASS type for casting table names to OIDs and vice versa

Fixes: #4160
Change-Id: Id0bdbad1be3a0950dc8f35895ee13d9264244722
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/435

7 years agoFix bindparam type param fixes #4220
Mike Bayer [Sun, 1 Apr 2018 14:33:40 +0000 (10:33 -0400)] 
Fix bindparam type param fixes #4220

Change-Id: I0f40bc3145d4cab1a12d2174b9f0f60b4ce736f5

7 years agocherry-pick changelog update for 1.2.7
Mike Bayer [Fri, 30 Mar 2018 20:29:53 +0000 (16:29 -0400)] 
cherry-pick changelog update for 1.2.7

7 years agocherry-pick changelog from 1.2.6
Mike Bayer [Fri, 30 Mar 2018 20:29:53 +0000 (16:29 -0400)] 
cherry-pick changelog from 1.2.6

7 years agoMerge "Add support for declarative partitioning in PostgreSQL 10"
mike bayer [Fri, 30 Mar 2018 20:22:43 +0000 (16:22 -0400)] 
Merge "Add support for declarative partitioning in PostgreSQL 10"

7 years agoMerge "Filter non-integer characters from pyodbc SQL Server version"
mike bayer [Fri, 30 Mar 2018 16:55:58 +0000 (12:55 -0400)] 
Merge "Filter non-integer characters from pyodbc SQL Server version"

7 years agoAdd support for declarative partitioning in PostgreSQL 10
Vsevolod Solovyov [Thu, 15 Mar 2018 13:00:47 +0000 (09:00 -0400)] 
Add support for declarative partitioning in PostgreSQL 10

Added support for "PARTITION BY" in Postgresql table definitions,
using "postgresql_partition_by".  Pull request courtesy
Vsevolod Solovyov.

Change-Id: Id74d6882d7193fae1e5fd44b6e12d6852866fcc4
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/430

7 years agoFilter non-integer characters from pyodbc SQL Server version
Mike Bayer [Fri, 30 Mar 2018 15:22:30 +0000 (11:22 -0400)] 
Filter non-integer characters from pyodbc SQL Server version

Adjusted the SQL Server version detection for pyodbc to only allow for
numeric tokens, filtering out non-integers, since the dialect does tuple-
numeric comparisons with this value.  This is normally true for all known
SQL Server / pyodbc drivers in any case.

Change-Id: I4ab18a07e19231091b5e877ba1fccd5eda72a992
Fixes: #4227
7 years agoInvalidate on failed connect handler
Mike Bayer [Wed, 28 Mar 2018 15:58:47 +0000 (11:58 -0400)] 
Invalidate on failed connect handler

Fixed bug in connection pool where a connection could be present in the
pool without all of its "connect" event handlers called, if a previous
"connect" handler threw an exception; note that the dialects themselves
have connect handlers that emit SQL, such as those which set transaction
isolation, which can fail if the database is in a non-available state, but
still allows a connection.  The connection is now invalidated first if any
of the connect handlers fail.

Change-Id: I61d6f4827a98ab8455f1c3e1c55d046eeccec09a
Fixes: #4225
7 years agoLink to the ExpireRelationshipOnFKChange recipe for deletes
Mike Bayer [Mon, 26 Mar 2018 22:10:16 +0000 (18:10 -0400)] 
Link to the ExpireRelationshipOnFKChange recipe for deletes

The recipe now supports interception of delete() and a
corresponding update of related objects.

Change-Id: I2aa3bfdd477ceccff6cfb3e66ed73311705010c7

7 years agoMerge "Don't warn for mixin-based __table_args__, __mapper_args__ declared_attr"
mike bayer [Wed, 21 Mar 2018 18:15:46 +0000 (14:15 -0400)] 
Merge "Don't warn for mixin-based __table_args__, __mapper_args__ declared_attr"

7 years agoDon't warn for mixin-based __table_args__, __mapper_args__ declared_attr
Mike Bayer [Wed, 21 Mar 2018 13:59:46 +0000 (09:59 -0400)] 
Don't warn for mixin-based __table_args__, __mapper_args__ declared_attr

Removed a warning that would be emitted when calling upon
``__table_args__``, ``__mapper_args__`` as named with a ``@declared_attr``
method, when called from a non-mapped declarative mixin.  Calling these
directly is documented as the approach to use when one is overidding one
of these methods on a mapped class.  The warning still emits for regular
attribute names.

Change-Id: Iae7ed0bd625a2c163c910aa777cef4779128580a
Fixes: #4221
7 years agoMerge "Track if we're rendering within the CTE recursively"
mike bayer [Fri, 16 Mar 2018 20:38:02 +0000 (16:38 -0400)] 
Merge "Track if we're rendering within the CTE recursively"

7 years agoTrack if we're rendering within the CTE recursively
Mike Bayer [Wed, 14 Mar 2018 15:04:43 +0000 (11:04 -0400)] 
Track if we're rendering within the CTE recursively

Fixed a regression that occurred from the previous fix to :ticket:`4204` in
version 1.2.5, where a CTE that refers to itself after the
:meth:`.CTE.alias` method has been called would not refer to iself
correctly.

Change-Id: Iaa63d65ad2b90c8693f9953fbb32dbb10c73a037
Fixes: #4204
7 years agoIgnore non-primary mappers within mutable instrumentation
Mike Bayer [Mon, 12 Mar 2018 16:50:52 +0000 (12:50 -0400)] 
Ignore non-primary mappers within mutable instrumentation

Fixed bug where using :meth:`.Mutable.associate_with` or
:meth:`.Mutable.as_mutable` in conjunction with a class that has non-
primary mappers set up with alternatively-named attributes would produce an
attribute error.  Since non-primary mappers are not used for persistence,
the mutable extension now excludes non-primary mappers from its
instrumentation steps.

Change-Id: I2630d9f771a171aece03181ccf9159885f68f25e
Fixes: #4215
7 years agoMerge "Raise cx_Oracle minimum version to 5.2"
mike bayer [Thu, 8 Mar 2018 17:36:38 +0000 (12:36 -0500)] 
Merge "Raise cx_Oracle minimum version to 5.2"

7 years agoMake it much more clear that concrete mapping is limited
Mike Bayer [Wed, 7 Mar 2018 23:05:07 +0000 (18:05 -0500)] 
Make it much more clear that concrete mapping is limited

Change-Id: Icb2ea787b0defbf5f1244b144759c1e8acff3f0f

7 years agoRaise cx_Oracle minimum version to 5.2
Mike Bayer [Wed, 7 Mar 2018 21:27:26 +0000 (16:27 -0500)] 
Raise cx_Oracle minimum version to 5.2

The minimum cx_Oracle version supported is 5.2 (June 2015).  Previously,
the dialect asserted against version 5.0 but as of 1.2.2 we are using some
symbols that did not appear until 5.2.

Change-Id: I6fa4238f1722789924f4a6473fdce6f524333825
Fixes: #4211
7 years agoAdd notes regarding flat=True
Mike Bayer [Wed, 7 Mar 2018 21:03:07 +0000 (16:03 -0500)] 
Add notes regarding flat=True

Start documenting that flat=True and aliased=True don't work
with selectable particularly when selectable is an aliased select
already.  References #4212

Change-Id: I6e576165f06387350ae97e43ad979e575a4912b9
(cherry picked from commit 39d7dfa08accf6cce6d53b0807603bf43d580791)

7 years agocherry-pick changelog update for 1.1.19
Mike Bayer [Tue, 6 Mar 2018 19:10:39 +0000 (14:10 -0500)] 
cherry-pick changelog update for 1.1.19

7 years agocherry-pick changelog from 1.1.18
Mike Bayer [Tue, 6 Mar 2018 19:10:39 +0000 (14:10 -0500)] 
cherry-pick changelog from 1.1.18

7 years agocherry-pick changelog update for 1.2.6
Mike Bayer [Tue, 6 Mar 2018 18:58:22 +0000 (13:58 -0500)] 
cherry-pick changelog update for 1.2.6

7 years agocherry-pick changelog from 1.2.5
Mike Bayer [Tue, 6 Mar 2018 18:58:22 +0000 (13:58 -0500)] 
cherry-pick changelog from 1.2.5

7 years ago- add missing versions for #4208
Mike Bayer [Tue, 6 Mar 2018 18:18:30 +0000 (13:18 -0500)] 
- add missing versions for #4208

Change-Id: I307b4b81e472cb6473d201fece26753878dd38f1

7 years agoMerge "Add Query.enable_single_entity()"
mike bayer [Tue, 6 Mar 2018 17:50:04 +0000 (12:50 -0500)] 
Merge "Add Query.enable_single_entity()"

7 years agoMerge "Clone _cte_alias instead of assigning "self""
mike bayer [Tue, 6 Mar 2018 17:49:22 +0000 (12:49 -0500)] 
Merge "Clone _cte_alias instead of assigning "self""

7 years agoAdd Query.enable_single_entity()
Eric Atkin [Wed, 28 Feb 2018 21:00:38 +0000 (16:00 -0500)] 
Add Query.enable_single_entity()

Added new feature :meth:`.Query.only_return_tuples`.  Causes the
:class:`.Query` object to return keyed tuple objects unconditionally even
if the query is against a single entity.   Pull request courtesy Eric
Atkin.

Change-Id: Ib0b7f5f78431aa68082e5b200ed577daa4222336
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/425

7 years agoClone _cte_alias instead of assigning "self"
Mike Bayer [Tue, 6 Mar 2018 02:36:18 +0000 (21:36 -0500)] 
Clone _cte_alias instead of assigning "self"

Fixed bug in :class:.`CTE` construct along the same lines as that of
:ticket:`4204` where a :class:`.CTE` that was aliased would not copy itself
correctly during a "clone" operation as is frequent within the ORM as well
as when using the :meth:`.ClauseElement.params` method.

Change-Id: Id68d72dd244dedfc7bd6116c9a5123c51a55ea20
Fixes: #4210
7 years agoDon't include AliasedClass when pickling options
Mike Bayer [Mon, 5 Mar 2018 19:48:00 +0000 (14:48 -0500)] 
Don't include AliasedClass when pickling options

Fixed 1.2 regression where a mapper option that contains an
:class:`.AliasedClass` object, as is typical when using the
:meth:`.QueryableAttribute.of_type` method, could not be pickled.   1.1's
behavior was to omit the aliased class objects from the path, so this
behavior is restored.

Change-Id: I4b36a422b7c0e6a6da7ee3ba3ab282c13917a31f
Fixes: #4209
7 years agoMerge "Only replace first occurrence for COLLATE/ARRAY syntax"
mike bayer [Mon, 5 Mar 2018 23:03:53 +0000 (18:03 -0500)] 
Merge "Only replace first occurrence for COLLATE/ARRAY syntax"

7 years agofix version type in doc
Asif Saifuddin Auvi [Mon, 5 Mar 2018 18:08:47 +0000 (00:08 +0600)] 
fix version type in doc

7 years agoOnly replace first occurrence for COLLATE/ARRAY syntax
Mike Bayer [Mon, 5 Mar 2018 16:33:30 +0000 (11:33 -0500)] 
Only replace first occurrence for COLLATE/ARRAY syntax

Fixed bug in Postgresql COLLATE / ARRAY adjustment first introduced
in :ticket:`4006` where new behaviors in Python 3.7 regular expressions
caused the fix to fail.

Change-Id: Ied3893d7cac210befa0277b55b3b895b0ba1f0d2
Fixes: #4208
7 years agoAdd python 3.7 environment
Mike Bayer [Mon, 5 Mar 2018 14:43:26 +0000 (09:43 -0500)] 
Add python 3.7 environment

Change-Id: I4ed7bd6ffd1c8c9b5169cf21709ec19801580126

7 years agoGet MySQL version info from @@version
Mike Bayer [Fri, 2 Mar 2018 20:08:08 +0000 (15:08 -0500)] 
Get MySQL version info from @@version

MySQL dialects now query the server version using ``SELECT @@version``
explicitly to the server to ensure we are getting the correct version
information back.   Proxy servers like MaxScale interfere with the value
that is passed to the DBAPI's connection.server_version value so this
is no longer reliable.

Change-Id: Iafd39be8c9bf1982d58b34cc997ae1016ad6c48c
Fixes: #4205
(cherry picked from commit 9ba77e8d3b682bff89fdab5e80271a96a52fe8c8)
(cherry picked from commit 5c1ebbc3706c810f936d9e252ee5d16800e561ea)

7 years agoSetup master as 1.3
Mike Bayer [Fri, 2 Mar 2018 19:41:03 +0000 (14:41 -0500)] 
Setup master as 1.3

Change-Id: I1e8240d19f891cb6575f10d93524b551d74864ea

7 years ago- add some seealsos for the transient object that loads use case
Mike Bayer [Fri, 2 Mar 2018 16:58:52 +0000 (11:58 -0500)] 
- add some seealsos for the transient object that loads use case

Change-Id: Ibfa79a3721f31806223906cccf4547673b3d42f1
(cherry picked from commit 5de2e17b6e6686adf0a87038e90b001978187c0a)

7 years agoFix enable_relationship_loading() works fine w/ one-to-many
Mike Bayer [Fri, 2 Mar 2018 15:45:42 +0000 (10:45 -0500)] 
Fix enable_relationship_loading() works fine w/ one-to-many

Change-Id: I6efb62afa02be4d42482cfdbec739a5c6ab32bd7

7 years agoMerge "Check existing CTE for an alias name when rendering FROM clause"
mike bayer [Thu, 1 Mar 2018 17:38:45 +0000 (12:38 -0500)] 
Merge "Check existing CTE for an alias name when rendering FROM clause"

7 years agoCheck existing CTE for an alias name when rendering FROM clause
Mike Bayer [Thu, 1 Mar 2018 15:45:39 +0000 (10:45 -0500)] 
Check existing CTE for an alias name when rendering FROM clause

Fixed bug in CTE rendering where a :class:`.CTE` that was also turned into
an :class:`.Alias` would not render its "ctename AS aliasname" clause
appropriately if there were more than one reference to the CTE in a FROM
clause.

Change-Id: If8cff27a2f4faa5eceb59aa86398db6edb3b9e72
Fixes: #4204
7 years agoMerge "Merge existing query params in baked lazy load"
mike bayer [Wed, 28 Feb 2018 15:53:53 +0000 (10:53 -0500)] 
Merge "Merge existing query params in baked lazy load"

7 years agoMerge existing query params in baked lazy load
Mike Bayer [Mon, 26 Feb 2018 00:54:37 +0000 (19:54 -0500)] 
Merge existing query params in baked lazy load

Fixed a long-standing regression that occurred in version
1.0, which prevented the use of a custom :class:`.MapperOption`
that alters the _params of a :class:`.Query` object 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
:meth:`.Query.populate_existing` method is now required in
order to rewrite the mapper options associated with an object
already loaded in the identity map.  Also, a custom defined
:class:`.MapperOption` will now cause lazy loaders related to
the target object to use a non-baked query by default unless
the :meth:`.MapperOption._generate_cache_key` method is implemented.

Fixed bug where the new :meth:`.baked.Result.with_post_criteria`
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 :ticket:`4128` in that
the post criteria feature is now used by the lazy loader.

Change-Id: I899808734458e25a023142c2c5bb37cbed869479
Fixes: #4128
7 years agoMerge remote-tracking branch 'origin/pr/421'
Mike Bayer [Tue, 27 Feb 2018 19:46:30 +0000 (14:46 -0500)] 
Merge remote-tracking branch 'origin/pr/421'

7 years agoMerge "Ensure we have states to load when doing poly post load"
mike bayer [Fri, 23 Feb 2018 20:14:46 +0000 (15:14 -0500)] 
Merge "Ensure we have states to load when doing poly post load"

7 years agoMerge "Allow bind processors to work with expanding IN"
mike bayer [Fri, 23 Feb 2018 19:21:44 +0000 (14:21 -0500)] 
Merge "Allow bind processors to work with expanding IN"

7 years agoEnsure we have states to load when doing poly post load
Mike Bayer [Fri, 23 Feb 2018 18:55:17 +0000 (13:55 -0500)] 
Ensure we have states to load when doing poly post load

Fixed bug in new "polymorphic selectin" loading when a selection of
polymorphic objects were to be partially loaded from a relationship
lazy loader, leading to an "empty IN" condition within the load that
raises an error for the "inline" form of "IN".

Change-Id: I721cf5fdf0b9fd2289067d5d2c6bc87fb2436f07
Fixes: #4199
7 years agoAllow bind processors to work with expanding IN
Mike Bayer [Fri, 23 Feb 2018 00:47:24 +0000 (19:47 -0500)] 
Allow bind processors to work with expanding IN

Fixed bug in new "expanding IN parameter" feature where the bind parameter
processors for values wasn't working at all, tests failed to cover this
pretty basic case which includes that ENUM values weren't working.

Change-Id: I8e2420d7229a3e253e43b5227ebb98f9fe0bd14a
Fixes: #4198
7 years agocherry-pick changelog update for 1.1.18
Mike Bayer [Thu, 22 Feb 2018 21:16:11 +0000 (16:16 -0500)] 
cherry-pick changelog update for 1.1.18

7 years agocherry-pick changelog from 1.1.17
Mike Bayer [Thu, 22 Feb 2018 21:16:11 +0000 (16:16 -0500)] 
cherry-pick changelog from 1.1.17

7 years agoVersion 1.2.5 placeholder
Mike Bayer [Thu, 22 Feb 2018 21:05:34 +0000 (16:05 -0500)] 
Version 1.2.5 placeholder

7 years ago- 1.2.4 rel_1_2_4
Mike Bayer [Thu, 22 Feb 2018 20:57:22 +0000 (15:57 -0500)] 
- 1.2.4

7 years agoQuote cte alias if needed
Eric Atkin [Thu, 22 Feb 2018 19:16:14 +0000 (14:16 -0500)] 
Quote cte alias if needed

Fixed bug where CTE expressions would not have their name or alias name
quoted when the given name is case sensitive or otherwise requires quoting.
Pull request courtesy Eric Atkin.

Fixes: #4197
Change-Id: Ib8573e82b9a1ca94b50c7c5d73ee98b79465d689
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/426

7 years agoMerge "Ensure mapping has no version_id_generator when checking missing version_id"
mike bayer [Thu, 22 Feb 2018 18:41:14 +0000 (13:41 -0500)] 
Merge "Ensure mapping has no version_id_generator when checking missing version_id"

7 years agoEnsure mapping has no version_id_generator when checking missing version_id
Mike Bayer [Wed, 21 Feb 2018 16:16:09 +0000 (11:16 -0500)] 
Ensure mapping has no version_id_generator when checking missing version_id

Fixed 1.2 regression in ORM versioning feature where a mapping against a
:func:`.select` or :func:`.alias` that also used a versioning column
against the underlying table would fail due to the check added as part of
:ticket:`3673`.

See also #4194 and #4195 for related issues found regarding
mapped selects and versioning.

Change-Id: Ifabe9a5c8c1bfa72db5029faa7a5dbf71f0a7ca0
Fixes: #4193
7 years agoMerge "Default to using current mapped class as owner if none found"
mike bayer [Tue, 20 Feb 2018 22:52:11 +0000 (17:52 -0500)] 
Merge "Default to using current mapped class as owner if none found"

7 years agoDefault to using current mapped class as owner if none found
Mike Bayer [Tue, 20 Feb 2018 17:15:57 +0000 (12:15 -0500)] 
Default to using current mapped class as owner if none found

Repaired regression caused in 1.2.3 and 1.1.16 regarding association proxy
objects, revising the approach to :ticket:`4185` when calculating the
"owning class" of an association proxy to default to choosing the current
class if the proxy object is not directly associated with a mapped class,
such as a mixin.

Change-Id: I87d0ac09f695dc285bd4bbe0a547f1d5ce23e068
Fixes: #4185
7 years agoMerge "Implement remove() for _empty_collection"
mike bayer [Mon, 19 Feb 2018 23:19:01 +0000 (18:19 -0500)] 
Merge "Implement remove() for _empty_collection"

7 years agoRewrite the "deleting from collections" section
Mike Bayer [Mon, 19 Feb 2018 23:13:24 +0000 (18:13 -0500)] 
Rewrite the "deleting from collections" section

This section documents an aspect of the ORM that is
more generalized than just collections as well as more general
than just using session.delete(), even though session.delete()
with collections is the most common use case.   Try to expand
out the scope here to explain the situation from the perspective
of any kind of relationship, include example with delete cascade
with many-to-one as well.

Change-Id: Ifacb91f90951d1b0da6dbadc2d72273d79b756e2
Fixes: #4191
7 years agoImplement remove() for _empty_collection
Mike Bayer [Mon, 19 Feb 2018 21:59:42 +0000 (16:59 -0500)] 
Implement remove() for _empty_collection

Fixed regression caused in 1.2.3 due to fix from :ticket:`4181` where
the changes to the event system involving :class:`.Engine` and
:class:`.OptionEngine` did not accommodate for event removals, which
would raise an ``AttributeError`` when invoked at the class
level.

Change-Id: I1c9083829d74dd710716d28b0eaca4fa15e86313
Fixes: #4190
7 years agoVersion 1.2.4 placeholder
Mike Bayer [Fri, 16 Feb 2018 23:22:07 +0000 (18:22 -0500)] 
Version 1.2.4 placeholder

7 years ago- 1.2.3 rel_1_2_3
Mike Bayer [Fri, 16 Feb 2018 23:15:47 +0000 (18:15 -0500)] 
- 1.2.3

7 years agoRemove erroneous skip message
Mike Bayer [Fri, 16 Feb 2018 23:13:30 +0000 (18:13 -0500)] 
Remove erroneous skip message

The logic here seems to try to say something different when
__backend__ is True but it produces a nonsensical message,
since __only_on__ doesn't tell us about the implementation
we are actually running.

Change-Id: I14e20cadcba975f8efe8fdefa439c8b8c480b3ed

7 years ago- add missing forwards ports for bug fixes
Mike Bayer [Fri, 16 Feb 2018 22:52:23 +0000 (17:52 -0500)] 
- add missing forwards ports for bug fixes

Change-Id: If94964cb0294f7f082759ecce71771c35ea4a2bd

7 years agocherry-pick changelog update for 1.1.17
Mike Bayer [Fri, 16 Feb 2018 22:36:46 +0000 (17:36 -0500)] 
cherry-pick changelog update for 1.1.17

7 years agocherry-pick changelog from 1.1.16
Mike Bayer [Fri, 16 Feb 2018 22:36:45 +0000 (17:36 -0500)] 
cherry-pick changelog from 1.1.16

7 years agofix formatting
Mike Bayer [Fri, 16 Feb 2018 21:54:43 +0000 (16:54 -0500)] 
fix formatting

Change-Id: Ie4687c970508cf8bf183e342db6b89a8aca9d6f9
(cherry picked from commit 055821630bb43d6dccce36f814c55ba306eb9363)

7 years agoMerge "Test attributes for being non-mapped column properties more closely"
mike bayer [Fri, 16 Feb 2018 14:39:26 +0000 (09:39 -0500)] 
Merge "Test attributes for being non-mapped column properties more closely"

7 years agoTest attributes for being non-mapped column properties more closely
Mike Bayer [Thu, 15 Feb 2018 22:42:48 +0000 (17:42 -0500)] 
Test attributes for being non-mapped column properties more closely

Fixed bug in concrete inheritance mapping where user-defined
attributes such as hybrid properties that mirror the names
of mapped attributes from sibling classes would be overwritten by
the mapper as non-accessible at the instance level.  Also
ensured that user-bound descriptors are not implicitly invoked at the class
level during the mapper configuration stage.

Change-Id: I52b84a15c296b14efeaffb72941fc941d1d52c0d
Fixes: #4188
7 years agoAdd ssl "operation timed out" message for psycopg2
André Cruz [Thu, 15 Feb 2018 16:09:47 +0000 (11:09 -0500)] 
Add ssl "operation timed out" message for psycopg2

Added "SSL SYSCALL error: Operation timed out" to the list
of messages that trigger a "disconnect" scenario for the
psycopg2 driver.  Pull request courtesy André Cruz.

Change-Id: Ie1a8fc97e74b6906ccacf53dad70fed973c42b7f
Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/3

7 years agoMerge remote-tracking branch 'origin/pr/416'
Mike Bayer [Wed, 14 Feb 2018 16:03:37 +0000 (11:03 -0500)] 
Merge remote-tracking branch 'origin/pr/416'

7 years agoFix typo in python example
Anton Vlasenko [Wed, 14 Feb 2018 10:31:36 +0000 (11:31 +0100)] 
Fix typo in python example

7 years agoAllow multiple plugin names
Mike Bayer [Tue, 13 Feb 2018 20:11:53 +0000 (15:11 -0500)] 
Allow multiple plugin names

The :class:`.URL` object now allows query keys to be specified multiple
times where their values will be joined into a list.  This is to support
the plugins feature documented at :class:`.CreateEnginePlugin` which
documents that "plugin" can be passed multiple times. Additionally, the
plugin names can be passed to :func:`.create_engine` outside of the URL
using the new :paramref:`.create_engine.plugins` parameter.

Change-Id: Ifc48ad120bd6c6204eda567492caf79832aeeaa5
Fixes: #4170
7 years agoMerge "Add dependency for parent_pre post updates to parent deletes"
mike bayer [Tue, 13 Feb 2018 03:22:44 +0000 (22:22 -0500)] 
Merge "Add dependency for parent_pre post updates to parent deletes"

7 years agoAdd dependency for parent_pre post updates to parent deletes
Mike Bayer [Mon, 12 Feb 2018 21:45:39 +0000 (16:45 -0500)] 
Add dependency for parent_pre post updates to parent deletes

Fixed issue in post_update feature where an UPDATE is emitted
when the parent object has been deleted but the dependent object
is not.   This issue has existed for a long time however
since 1.2 now asserts rows matched for post_update, this
was raising an error.

Change-Id: I31b1d22408e358962577435f0c4cb9a456ba0872
Fixes: #4187
7 years agoSearch through mapper superclass hierarchy for owner
Mike Bayer [Fri, 9 Feb 2018 21:12:31 +0000 (16:12 -0500)] 
Search through mapper superclass hierarchy for owner

Fixed regression caused by fix for issue :ticket:`4116` affecting versions
1.2.2 as well as 1.1.15, which had the effect of mis-calculation of the
"owning class" of an :class:`.AssociationProxy` as the ``NoneType`` class
in some declarative mixin/inheritance situations as well as if the
association proxy were accessed off of an un-mapped class.  The "figure out
the owner" logic has been replaced by an in-depth routine that searches
through the complete mapper hierarchy assigned to the class or subclass to
determine the correct (we hope) match; will not assign the owner if no
match is found.  An exception is now raised if the proxy is used
against an un-mapped instance.

Change-Id: I611b590df2babe077ce6c19bea89e84251d1a7f4
Fixes: #4185
7 years agoMerge "Add initiator argument to set_attribute"
mike bayer [Fri, 9 Feb 2018 13:41:33 +0000 (08:41 -0500)] 
Merge "Add initiator argument to set_attribute"

7 years agoAdd initiator argument to set_attribute
Mike Bayer [Thu, 8 Feb 2018 14:16:39 +0000 (09:16 -0500)] 
Add initiator argument to set_attribute

Added new argument :paramref:`.attributes.set_attribute.inititator`
to the :func:`.attributes.set_attribute` function, allowing an
event token received from a listener function to be propagated
to subsequent set events.

Change-Id: I6ede21e42153026ab46a1d2ec33aa3f999db98e2

7 years agoEnsure weakref finalize_fairy operates upon the current connection
Mike Bayer [Thu, 8 Feb 2018 19:52:29 +0000 (14:52 -0500)] 
Ensure weakref finalize_fairy operates upon the current connection

Fixed a fairly serious connection pool bug where a connection that is
acquired after being refreshed as a result of a user-defined
:class:`.DisconnectionError` or due to the 1.2-released "pre_ping" feature
would not be correctly reset if the connection were returned to the pool by
weakref cleanup (e.g. the front-facing object is garbage collected); the
weakref would still refer to the previously invalidated DBAPI connection
which would have the reset operation erroneously called upon it instead.
This would lead to stack traces in the logs and a connection being checked
into the pool without being reset, which can cause locking issues.

Change-Id: Iabd9f3a63a1d0207d0de0054a6ced3560818cf9c
Fixes: #4184
7 years ago- re-disable oracle tests here as we are getting lots
Mike Bayer [Thu, 8 Feb 2018 22:39:19 +0000 (17:39 -0500)] 
- re-disable oracle tests here as we are getting lots
of oracle timeouts on CI now

Change-Id: I021d304d6aaf6bfa223dd0e5bb6b0c20e9c8657f