]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
7 years ago- 1.1.18 rel_1_1_18
Mike Bayer [Tue, 6 Mar 2018 19:04:26 +0000 (14:04 -0500)] 
- 1.1.18

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
(cherry picked from commit 7300469f71f161d47795dcf7415d5a22db8e2ef0)

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 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
(cherry picked from commit fde2f77fd1978d4162ab01bc05bb5c793bc733b2)

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

(cherry picked from commit 31d28179c29e987a6ed844f6b8abf5dc1574e594)

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

7 years ago- 1.1.17 rel_1_1_17
Mike Bayer [Thu, 22 Feb 2018 21:08:56 +0000 (16:08 -0500)] 
- 1.1.17

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
(cherry picked from commit 93881f7873048403b62cc3e179354712ba8e9282)

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 agoVersion 1.1.17 placeholder
Mike Bayer [Fri, 16 Feb 2018 22:36:45 +0000 (17:36 -0500)] 
Version 1.1.17 placeholder

7 years ago- 1.1.16 rel_1_1_16
Mike Bayer [Fri, 16 Feb 2018 21:55:40 +0000 (16:55 -0500)] 
- 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

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
(cherry picked from commit 2f03ec08b5a1c633133c0a38d82b05eb83708f69)

7 years agoFixed link to Flask-SQLAlchemy in documentation
Tim Shaffer [Wed, 17 Jan 2018 12:04:16 +0000 (07:04 -0500)] 
Fixed link to Flask-SQLAlchemy in documentation

(cherry picked from commit 9feb900f3ec979725a9d3ee68f607f5b7606c061)

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
(cherry picked from commit 8607ae51fc5b74c181cdde6b89ade3ee30c12dad)

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
(cherry picked from commit 650b9eddae0eb198c8f8dc2d1e1e3c6ac53b18f3)

7 years agoMerge "Ensure weakref finalize_fairy operates upon the current connection" into rel_1_1
mike bayer [Fri, 9 Feb 2018 13:40:17 +0000 (08:40 -0500)] 
Merge "Ensure weakref finalize_fairy operates upon the current connection" into rel_1_1

7 years ago- fix formatting
Mike Bayer [Thu, 8 Feb 2018 21:46:56 +0000 (16:46 -0500)] 
- fix formatting

Change-Id: Ic919048462520de8de84174a5e366d6c85316e87
(cherry picked from commit ea3fd424957620ae6a93b5e65d6a4bc7b4048ab7)

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
(cherry picked from commit ab1f524c355c0bbac68485a60cb99e7a9d0f944a)

7 years ago- ensure it's clear that all DDLEvents can be associated
Mike Bayer [Fri, 2 Feb 2018 20:46:30 +0000 (15:46 -0500)] 
- ensure it's clear that all DDLEvents can be associated
using propagate=True, which is consulted within the scope
of Table.tometadata().  Fixes: #4179

Change-Id: I0cb0d8f6a894bb645cfc94b3d9083339039c9193
(cherry picked from commit 56ff3c5270b4393c1ae800756f3619583a0fb255)

7 years ago- don't scare off developers with the word "advanced" here
Mike Bayer [Wed, 31 Jan 2018 14:27:03 +0000 (09:27 -0500)] 
- don't scare off developers with the word "advanced" here

Change-Id: I72a0295634e228bacf6c92088e650183f91e4585
(cherry picked from commit 399988aaed401ea6fc69aa580b9b71c236a30f16)

7 years agoAdd note to FAQ that IN behavior is modernized in 1.2.
Mike Bayer [Thu, 25 Jan 2018 21:14:54 +0000 (16:14 -0500)] 
Add note to FAQ that IN behavior is modernized in 1.2.

Change-Id: Ibe05d8aaa8da90b52cd07f3bce89dcbd49b841c9

7 years agoAdd a new FAQ section explaining how to ensure parenthesis
Mike Bayer [Thu, 25 Jan 2018 21:11:29 +0000 (16:11 -0500)] 
Add a new FAQ section explaining how to ensure parenthesis
with op().

Not sure if this can be further improved at some point, such
as if a BinaryExpression automatically applied self_group()
when op() is called, however for the moment op() behaves consistently
as with all other operators without any ad-hoc effects.

Change-Id: Ia7f1ab43990450bd96757848b77a35e8fedeab63
References: #4174
(cherry picked from commit 1d435b9f49136f53aac4aa457f7744227be0b26a)

7 years agoFurther refine map_column verbiage
Mike Bayer [Thu, 25 Jan 2018 14:17:41 +0000 (09:17 -0500)] 
Further refine map_column verbiage

The verbiage here continues to be misleading as it implies that
a MapperProperty already exists for the Column when this is not
the case.

Change-Id: Iaa6990dc9693d47d50b15c4815c3c7f6f34d8577
(cherry picked from commit bc9cdd5de0781b93f9cf581f1c5e0d96179ad12e)

7 years agoRework synonym, synonym_for documentation
Mike Bayer [Wed, 24 Jan 2018 23:03:04 +0000 (18:03 -0500)] 
Rework synonym, synonym_for documentation

The map_column example was incorrect, and overall the purpose
of this parameter as well as that of synonym_for was not explained;
examples added along with more encouragement to use hybrids.

Change-Id: I20bd286f541f798daa81fa598c0f31db1f5aa6ed
(cherry picked from commit 8250a4248fceaa3f4fbaebea3ff6a7f626299659)

7 years ago- add missing 2018 update to conf.py
Mike Bayer [Mon, 15 Jan 2018 14:20:52 +0000 (09:20 -0500)] 
- add missing 2018 update to conf.py

Change-Id: Ie2d4ff9486375867ed6958b82cd2595bae43746d
(cherry picked from commit c3fe4b585bb6e3d238dc3283030f1f0c011cdc8d)

7 years agohappy new year
Mike Bayer [Fri, 12 Jan 2018 19:23:53 +0000 (14:23 -0500)] 
happy new year

Change-Id: I3ef36bfd0cb0ba62b3123c8cf92370a43156cf8f
(cherry picked from commit 699272e4dcb9aa71ebbc0d9487fb6de82d3abc2b)

7 years ago`ValuesBase.values` inconsistency fix
Aubrey Stark-Toller [Fri, 5 Jan 2018 20:06:23 +0000 (15:06 -0500)] 
`ValuesBase.values` inconsistency fix

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.

Change-Id: I9d3b40b5950df8f5bfdc8b1d22f9c3afb277f17f
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/412
Fixes: #4162
(cherry picked from commit ab2165e6d6e9b33f772e9eb3668b3e32175093c4)

7 years agoturn off pytest's latest plugin we didn't ask for, logging
Mike Bayer [Fri, 5 Jan 2018 20:31:10 +0000 (15:31 -0500)] 
turn off pytest's latest plugin we didn't ask for, logging

Change-Id: I24d57894c519366febbce268b04474182dfbb0a1
(cherry picked from commit 3316890ffa9a51471ca7618e4a13e45494e03198)

7 years agoCheck for object was expunged before restoring after pk switch + rollback
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.

Change-Id: I57e2888902015d67ee11857e44382818f1d2f8bc
Fixes: #4151
(cherry picked from commit 5811276bb7515af3418a6d20f5213d658e320121)

7 years agoAdd TRUNCATE to postgres autocommit regexp
Jacob Hayes [Fri, 15 Dec 2017 14:56:59 +0000 (09:56 -0500)] 
Add TRUNCATE to postgres autocommit regexp

Extends AUTOCOMMIT_REGEXP for the postgres dialect to include `TRUNCATE`.

Change-Id: I315e03674b89bb89aae669b8655481e4d890491e
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/407
(cherry picked from commit 756d5782870029f2d97b1aa171abd61dbf4cbcb4)

7 years agoAllow for the database to produce a UUID instance
Martijn Pieters [Wed, 22 Nov 2017 10:05:44 +0000 (10:05 +0000)] 
Allow for the database to produce a UUID instance

Some database adapters (specifically, pg8000) already produce a uuid.UUID()
instance for UUID columns. Account for this.

(cherry picked from commit e80a5adfd406e2392cfaad687e8b3f0ae9ed4e11)

7 years agoFix import in Inspector.reflecttable doc
Jacob Hayes [Thu, 9 Nov 2017 04:14:37 +0000 (22:14 -0600)] 
Fix import in Inspector.reflecttable doc

(cherry picked from commit e6b290df2774efbafaea8374b27f72eb712853e9)

7 years agoAdd tests for ARRAY propagate events re. MutableList
Mike Bayer [Mon, 4 Dec 2017 21:40:20 +0000 (16:40 -0500)] 
Add tests for ARRAY propagate events re. MutableList

Issue #4141 appears in version 1.2, however we are adding the
MutableList test for it to 1.1 as well.  The metadata test
does not apply as in 1.1 ARRAY is not a SchemaEventTarget.

Change-Id: If8c57615860883837f6cf72661e46180a77778c1
(cherry picked from commit 14bb6eae364f41b6acbce782ebf5f984b9364af9)

7 years agoFix a typo in basic_relationships.rst.
Randy Barlow [Wed, 15 Nov 2017 17:53:12 +0000 (12:53 -0500)] 
Fix a typo in basic_relationships.rst.

Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
(cherry picked from commit 096bace0da15c0fc903e55873518c7f47efbce19)

7 years agoMerge "add nullsfirst() / nullslast() to top-level imports" into rel_1_1
mike bayer [Fri, 17 Nov 2017 15:32:40 +0000 (10:32 -0500)] 
Merge "add nullsfirst() / nullslast() to top-level imports" into rel_1_1

7 years agoAdd license to Wheel metadata
Jeff Widman [Wed, 15 Nov 2017 23:10:25 +0000 (18:10 -0500)] 
Add license to Wheel metadata

https://wheel.readthedocs.io/en/stable/index.html#including-the-license-in-the-generated-wheel-file

Change-Id: Icf91b96ba534c8f835ad287e7840ac2a9d2ac502
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/397
(cherry picked from commit bcbff960a17654004a08401546d8c2d990ee9894)

7 years agoadd nullsfirst() / nullslast() to top-level imports
Lele Gaifax [Wed, 15 Nov 2017 23:11:05 +0000 (18:11 -0500)] 
add nullsfirst() / nullslast() to top-level imports

Change-Id: Ieefcc4c30c1c17f43f2908d961e00815bae862bb
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/378
(cherry picked from commit d507ea00a9523cf5dc00a7c663ed4a44d1fdddcf)

7 years agoPropagate kwargs for mysql concat, match
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

Change-Id: Iaf54ac18949cc6a54f50678125f010b4f12c5673
Fixes: #4136
(cherry picked from commit 4f054550b768985f1c3393e46e0fc26bfefeeaf6)

7 years ago- fix loop logic that was leaving out 10K items from
Mike Bayer [Thu, 9 Nov 2017 16:38:22 +0000 (11:38 -0500)] 
- fix loop logic that was leaving out 10K items from
example suites, fixes #4132

Change-Id: Icf07f33fc99a880d6165d300579ef5d2c366f6f5
(cherry picked from commit 6448903b5287801aaefbf82b5fa108403d743e8f)

7 years agoVersion 1.1.16 placeholder
Mike Bayer [Fri, 3 Nov 2017 21:07:06 +0000 (17:07 -0400)] 
Version 1.1.16 placeholder

Change-Id: Ia563c801f5f467084c49fc367f31b2385e0777bb

7 years ago- 1.1.15 rel_1_1_15
Mike Bayer [Fri, 3 Nov 2017 20:47:02 +0000 (16:47 -0400)] 
- 1.1.15

7 years agoFix as many RST parse warnings as possible.
Mike Bayer [Fri, 3 Nov 2017 18:45:18 +0000 (14:45 -0400)] 
Fix as many RST parse warnings as possible.

Still a few I can't get.   Also 0.9 is EOL so hide the
unreleased notes.

Change-Id: If0e44d4a0b3e78e211f32d5c33b51b1a007c9c69
(cherry picked from commit 75bdcd096f12012bf45cffebd597c33b501c2ef2)

7 years agoAdd doc note for contains_eager() w/ subclasses.
Mike Bayer [Thu, 2 Nov 2017 17:53:34 +0000 (13:53 -0400)] 
Add doc note for contains_eager() w/ subclasses.

Change-Id: I9634136e1855a081c25b04bb6ae8248f0f94be1c
Fixes: #4130
(cherry picked from commit 152522b3f28de290d9ea2903fa2c414b8579515a)

7 years agoAccommodate tuples for ColumnDefault.__repr__
Nicolas CANIART [Tue, 31 Oct 2017 15:34:10 +0000 (11:34 -0400)] 
Accommodate tuples for ColumnDefault.__repr__

Fixed bug where ``__repr__`` of :class:`.ColumnDefault` would fail
if the argument were a tuple.  Pull request courtesy Nicolas Caniart.

Change-Id: I08aa2448ef91054c43d6068ac54cedbdf7a83d64
Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/1
Fixes: #4126
(cherry picked from commit 5acc9b149a4f7c44b8e7fbe926c0c5de8f13b2c4)

7 years ago- add notes that @comparator and @expression don't go together.
Mike Bayer [Tue, 31 Oct 2017 00:02:21 +0000 (20:02 -0400)] 
- add notes that @comparator and @expression don't go together.

Change-Id: I3fb366f8b49454453e4b6dada565c24c5ccb975e
(cherry picked from commit 8965f3021539f3132311d6277aab475d6c44ebbe)

7 years agoFilter attributes we don't map during a load_scalar_attributes
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.

Change-Id: I407b07a3a3e2c374da19fc86ed44b987d595dcfa
Fixes: #4124
(cherry picked from commit fd4289c5829d6498495ac59fe1dccb23b4975281)

7 years agofix typo
wodim [Fri, 5 May 2017 20:40:16 +0000 (22:40 +0200)] 
fix typo

(cherry picked from commit 3380390b7a4160df56c409e078ab53de7c6590a1)

7 years agoFix typo: multidimentional --> multidimensional
Jeff Widman [Fri, 20 Oct 2017 22:24:15 +0000 (15:24 -0700)] 
Fix typo: multidimentional --> multidimensional

(cherry picked from commit 975081a3a86ad350966c2ff275759bd3721f3089)

7 years agoResolve AliasedClass when determining owning class of association proxy
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.

Change-Id: I9161bab67766bb75d73ca54d712ad1cad6de40dc
Fixes: #4116
(cherry picked from commit f14a58dea4b825beb4baaef44389880927543cc4)

7 years agoRemove deprecation warnings mysql5 7 20
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.

For 1.1, also backport our_warn() test fixture fix from
9f0fb6c601 1.2 branch.

(cherry picked from commit 41cfe44b5e5806b3d3b13949e41dbb347bfa29e1)
Co-authored by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #4120
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/391
Change-Id: I4d2e04df760c5351a71dde8b32145cdc69fa6115

7 years agoMerge "Get MariaDB normalized version relative to "MariaDB" token" into rel_1_1
mike bayer [Mon, 23 Oct 2017 23:05:05 +0000 (19:05 -0400)] 
Merge "Get MariaDB normalized version relative to "MariaDB" token" into rel_1_1

7 years agoAdd changelog for ticket #4097
Mike Bayer [Mon, 23 Oct 2017 22:58:37 +0000 (18:58 -0400)] 
Add changelog for ticket #4097

A changelog was not added for #4097 even though this issue
was ticketed and backported to 1.1.

Change-Id: I1aeb5cb344c95ad86daa166e68eca7073eca0b87
Fixes: #4097
(cherry picked from commit 1c025e9795315283e548ad4f1a2b31d923104a38)

7 years agoGet MariaDB normalized version relative to "MariaDB" token
Mike Bayer [Fri, 20 Oct 2017 20:07:49 +0000 (16:07 -0400)] 
Get MariaDB normalized version relative to "MariaDB" token

Fixed regression from 1.2.0b3 where "MariaDB" version comparison can
fail for some particular MariaDB version strings under Python 3.

For 1.1, this was merged as part of #4097

Change-Id: Iedf49f40c1614ccedf63e0fa26719dd704da104d
Fixes: #4115
(cherry picked from commit 57f7788ec2ea0de56137c8ac6909948e2ae91489)

7 years agoAdd missing space in repr of the sessionmaker class
Paul Anton Letnes [Mon, 16 Oct 2017 10:32:38 +0000 (12:32 +0200)] 
Add missing space in repr of the sessionmaker class

The missing space was driving me nuts.

(cherry picked from commit b343dc5611f0ab280f9a324948775c38b65efd1c)

7 years ago- make a note in 1.1 migration notes for ref #4102
Mike Bayer [Thu, 12 Oct 2017 15:15:11 +0000 (11:15 -0400)] 
- make a note in 1.1 migration notes for ref #4102

Change-Id: If9edba3af476bc4303246e55d0ecb53009084342
(cherry picked from commit 9ffee8c94a2ed586b2d1abe404276a044078b8ca)

7 years agoMerge "Don't include SelectBase when searching for surface column elements" into...
mike bayer [Tue, 10 Oct 2017 18:12:18 +0000 (14:12 -0400)] 
Merge "Don't include SelectBase when searching for surface column elements" into rel_1_1

7 years ago - add a note how to generate pg10 IDENTITY for now
Mike Bayer [Mon, 9 Oct 2017 15:12:34 +0000 (11:12 -0400)] 
 - add a note how to generate pg10 IDENTITY for now

Change-Id: I22dbf6ba322904a80c6df46f6a31daa2fcc1f946
(cherry picked from commit 2b2cdee7994d4af8dbd3dab28a5588c02e974fc8)

7 years agoFix array_agg to accommodate ARRAY arguments
Mike Bayer [Fri, 6 Oct 2017 15:14:29 +0000 (11:14 -0400)] 
Fix array_agg to accommodate ARRAY arguments

Fixed bug in :func:`.array_agg` function where passing an argument
that is already of type :class:`.ARRAY`, such as a Postgresql
:obj:`.postgresql.array` construct, would produce a ``ValueError``, due
to the function attempting to nest the arrays.

Change-Id: Ibe5f6275d90e4868e6ef8a733de05acd44c05d78
Fixes: #4107
(cherry picked from commit 4bb8397ae3a9d65bd18eb1d7c951bf5121ea280a)

7 years agoDon't include SelectBase when searching for surface column elements
Mike Bayer [Thu, 5 Oct 2017 15:25:10 +0000 (11:25 -0400)] 
Don't include SelectBase when searching for surface column elements

Fixed bug where correlated select used against single-table inheritance
entity would fail to render correctly in the outer query, due to adjustment
for single inheritance discriminator criteria inappropriately re-applying
the criteria to the outer query.

Change-Id: I38df21f1392af1843e10119682fa0635d346e2a8
Fixes: #4103
(cherry picked from commit 1281e6e6c41ad3d7240fe50f4fecab4083b79975)

7 years agoImprove check for overlapping FK targets on sibling classes
Mike Bayer [Tue, 3 Oct 2017 00:50:56 +0000 (20:50 -0400)] 
Improve check for overlapping FK targets on sibling classes

Fixed bug where ORM relationship would warn against conflicting sync
targets (e.g. two relationships would both write to the same column) for
sibling classes in an inheritance hierarchy, where the two relationships
would never actually conflict during writes.

Change-Id: I9367a7978cadc59066e89fc4917d7eb6c78dedee
Fixes: #4078
(cherry picked from commit 8ba8dd23b7cbf9aa423b6aa965abc4d7174b84de)

7 years agoSupport pg10
Mike Bayer [Mon, 2 Oct 2017 15:50:05 +0000 (11:50 -0400)] 
Support pg10

One test appears to use some awkward calling style
with the current_date function that isn't working in pg10
anymore, this looks like an extremely
old test that can be removed

Also cherry-picks f846a789b78f977b4d7e8e16b412b07e77f2ab13 from master
to repair 'postgres'-deprecation warning test for multiple
calls within a single process

Change-Id: I5f8aee0f5ed423461be5a9060c812eb0acdc7df5
(cherry picked from commit 67ee56be69687a828d3998b2f6e2caccb3fe9072)

7 years agoTake schema name into account when querying sqlite_master
Mike Bayer [Thu, 28 Sep 2017 20:47:28 +0000 (16:47 -0400)] 
Take schema name into account when querying sqlite_master

Fixed bug where SQLite CHECK constraint reflection would fail
if the referenced table were in a remote schema, e.g. on SQLite a
remote database referred to by ATTACH.

Also add suite support for general CHECK constraint reflection.

Change-Id: I073a72cb47dc4f8c5683000d708768523759332f
Fixes: #4099
(cherry picked from commit 68b52c48b775f9a99d0bc3666ebe02c54e401303)

7 years agoSupport mariadb 10.2
Mike Bayer [Sat, 19 Aug 2017 22:39:08 +0000 (18:39 -0400)] 
Support mariadb 10.2

Fixed issue where CURRENT_TIMESTAMP would not reflect correctly
in the MariaDB 10.2 series due to a syntax change, where the function
is now represented as ``current_timestamp()``.

Fixes: #4096
MariaDB 10.2 now supports CHECK constraints (warning: use version 10.2.9
or greater due to upstream issues noted in :ticket:`4097`).  Reflection
now takes these CHECK constraints into account when they are present in
the ``SHOW CREATE TABLE`` output.

Fixes: #4098
Change-Id: I8666d61814e8145ca12cbecad94019b44af868e3
(cherry picked from commit 29b752f8b24909c9c715e1b2c5e01119d1f46aa7)

7 years agoRepair incorrectly merged mariadb logic
Mike Bayer [Thu, 28 Sep 2017 23:31:13 +0000 (19:31 -0400)] 
Repair incorrectly merged mariadb logic

The changeset in c88d4d0 takes advantage of a
mariadb function that got randomly committed as part
of the SQL server fixup in 2efd89d02941ab4267d6e2842963, not
part of rel_1_1.    The change here was not reviewed or tested
in gerrit and breaks the main branch.

Change-Id: I41746f890e6e82acfb12e78f174d00d7ba7d19d4
Fixes: #4097
7 years agoRemove unused .cascading from unit test for __table_cls__ feature
Mike Bayer [Thu, 28 Sep 2017 17:05:56 +0000 (13:05 -0400)] 
Remove unused .cascading from unit test for __table_cls__ feature

Two independent gerrits for 04bbad660bcbb7b920f3e75110a7b1187d9ddc38
and ec1700ba29f7f15859ee6576855a4d6675265640 produce a failure
when merged due to new warning.
will merge into rel_1_1 as well for completeness even though
warning is not there.

Change-Id: I1bd494d205107d8b2a30d475a22c61a59b70985b
(cherry picked from commit 21ff71b0eb032d8ffd125ba7532ca2d29a206fb9)

7 years agoWarn for mariadb 10.2 < 9
Mike Bayer [Thu, 28 Sep 2017 16:31:54 +0000 (12:31 -0400)] 
Warn for mariadb 10.2 < 9

There's a few CHECK constraint issues we managed
to get resolved as of MariaDB 10.2.8 then 10.2.9.   They
are pretty severe so warn users for these particular mariadb
versions.

Change-Id: Ie0899f94fda25960975ebee72f3044370f43eb7c
Fixes: #4097
(cherry picked from commit 21bf37f6e429276aa8cc60c1aa756e4bafa74b3e)

7 years agoMerge "Add full list of pyodbc error codes for MSSQL" into rel_1_1
mike bayer [Thu, 28 Sep 2017 16:07:29 +0000 (12:07 -0400)] 
Merge "Add full list of pyodbc error codes for MSSQL" into rel_1_1

7 years ago- add more dragons to session.begin() / autocommit docs
Mike Bayer [Thu, 28 Sep 2017 15:43:48 +0000 (11:43 -0400)] 
- add more dragons to session.begin() / autocommit docs

Change-Id: I9e326f353d396321565dfbf53b7a30f18d8c86e9
(cherry picked from commit 1ec7ba52e1c7e6d232223912f154e25252fb9b92)

7 years ago- tweak the handle_error docs a bit
Mike Bayer [Thu, 28 Sep 2017 13:59:16 +0000 (09:59 -0400)] 
- tweak the handle_error docs a bit

Change-Id: Iebe5b13b3a568f3aa0f3ab02a55e2a9cbb4545c7
(cherry picked from commit e1a923dc5ab70ed0d0a259614f9ecd6e2b78c216)

7 years agoAdd full list of pyodbc error codes for MSSQL
Mike Bayer [Thu, 28 Sep 2017 13:39:54 +0000 (09:39 -0400)] 
Add full list of pyodbc error codes for MSSQL

Moved the SQL server error codes out of connnectors/pyodbc.py
and into mssql/pyodbc.py.  Added complete list
of odbc-related disconnect codes.

Change-Id: Icd84a920dbfa1f188847f859654ff6f7a48170f1
Fixes: #4095
(cherry picked from commit 6a38697261e271b3600d8f1bbc56f663e5ee9890)

7 years agoMerge "Support method form of any_(), all_()" into rel_1_1
mike bayer [Wed, 27 Sep 2017 22:10:18 +0000 (18:10 -0400)] 
Merge "Support method form of any_(), all_()" into rel_1_1

7 years agoSupport method form of any_(), all_()
Mike Bayer [Wed, 27 Sep 2017 14:14:57 +0000 (10:14 -0400)] 
Support method form of any_(), all_()

Fixed bug where the recently added :meth:`.ColumnOperators.any_`
and :meth:`.ColumnOperators.all_` methods didn't work when called
as methods, as opposed to using the standalone functions
:func:`~.expression.any_` and :func:`~.expression.all_`.  Also
added documentation examples for these relatively unintuitive
SQL operators.

Change-Id: I3e56b463e9fd146a077b9970624f50cba27f9811
Fixes: #4093
(cherry picked from commit 944c662d8add498577d6359251d4b94cd84d4011)

7 years agoMerge "Accomodate for multidimensional array in rewriting for COLLATE" into rel_1_1
mike bayer [Wed, 27 Sep 2017 19:48:02 +0000 (15:48 -0400)] 
Merge "Accomodate for multidimensional array in rewriting for COLLATE" into rel_1_1

7 years agoAccomodate for multidimensional array in rewriting for COLLATE
Mike Bayer [Wed, 27 Sep 2017 13:48:17 +0000 (09:48 -0400)] 
Accomodate for multidimensional array in rewriting for COLLATE

Made further fixes to the :class:`.ARRAY` class in conjunction with
COLLATE, as the fix made in :ticket:`4006` failed to accommodate
for a multidimentional array.

Change-Id: If3e438f8ce94ebae2196671c88a4914f3b743e60
Fixes: #4006
(cherry picked from commit 6652f72352730df12adb93d462f309a7efe1ff1f)

7 years agoDocument and test __table_cls__
Mike Bayer [Tue, 26 Sep 2017 00:00:20 +0000 (20:00 -0400)] 
Document and test __table_cls__

A use case has been identified for __table_cls__, which was
added in 1.0 just for the purpose of test fixtures.   Add this to
public API and ensure the target use case (conditional table generation)
stays supported.

Change-Id: I87be5bcb72205cab89871fa586663bf147450995
Fixes: #4082
(cherry picked from commit 04bbad660bcbb7b920f3e75110a7b1187d9ddc38)

7 years agoFixed a typo in before_execute doc.
Michael Smirnov [Tue, 22 Aug 2017 13:49:54 +0000 (13:49 +0000)] 
Fixed a typo in before_execute doc.
events.py edited online with Bitbucket

(cherry picked from commit e0ddf30bf65f0cc90ae3c471bf9b3aae56cbc824)

7 years agouse the stack to get the insert statement in on conflict
Mike Bayer [Tue, 12 Sep 2017 16:57:40 +0000 (12:57 -0400)] 
use the stack to get the insert statement in on conflict

Fixed bug in Postgresql :meth:`.postgresql.dml.Insert.on_conflict_do_update`
which would prevent the insert statement from being used as a CTE,
e.g. via :meth:`.Insert.cte`, within another statement.

Change-Id: Ie20972a05e194290bc9d92819750845872949ecc
Fixes: #4074
(cherry picked from commit 70516536107a44230762206342c51239c5d85417)

7 years agoVersion 1.1.15 placeholder
Mike Bayer [Tue, 5 Sep 2017 17:06:29 +0000 (13:06 -0400)] 
Version 1.1.15 placeholder

Change-Id: I81fd38694b19ee9dadaf89276dd4fe9bd6f67c94

7 years ago- 1.1.14 rel_1_1_14
Mike Bayer [Tue, 5 Sep 2017 14:26:00 +0000 (10:26 -0400)] 
- 1.1.14

7 years ago- 1.1.14 placeholder
Mike Bayer [Tue, 5 Sep 2017 13:56:17 +0000 (09:56 -0400)] 
- 1.1.14 placeholder

Change-Id: I1648f7780cc0accdfe7650a62754b39c8e5552a8

7 years agoMerge "Guard against KeyError in session.merge after check for identity" into rel_1_1
mike bayer [Tue, 5 Sep 2017 13:46:05 +0000 (09:46 -0400)] 
Merge "Guard against KeyError in session.merge after check for identity" into rel_1_1

7 years agoMerge "Check for non-mapped property in synonym" into rel_1_1
mike bayer [Tue, 5 Sep 2017 13:43:52 +0000 (09:43 -0400)] 
Merge "Check for non-mapped property in synonym" into rel_1_1

7 years agoGuard against KeyError in session.merge after check for identity
Mike Bayer [Mon, 4 Sep 2017 16:11:19 +0000 (12:11 -0400)] 
Guard against KeyError in session.merge after check for identity

Fixed bug in :meth:`.Session.merge` following along similar lines as that
of :ticket:`4030`, where an internal check for a target object in
the identity map could lead to an error if it were to be garbage collected
immediately before the merge routine actually retrieves the object.

Change-Id: Ifecfb8b9d50c52d0ebd5a03e1bd69fe3abf1dc40
Fixes: #4069
(cherry picked from commit bfad032017fde2e519ad5eacc0011a71bf7a22a9)

7 years agoCheck for non-mapped property in synonym
Mike Bayer [Mon, 4 Sep 2017 20:21:14 +0000 (16:21 -0400)] 
Check for non-mapped property in synonym

An :class:`.InvalidRequestError` is raised when a :func:`.synonym`
is used against an attribute that is not against a :class:`.MapperProperty`,
such as an association proxy.  Previously, a recursion overflow would
occur trying to locate non-existent attributes.

Change-Id: If2ce38c429a69951df4c94b71b74edbd59d775e3
Fixes: #4067
(cherry picked from commit 130f31ca79c7b40b2cb8aa1a4af7049408074d12)

7 years agoAlways check that discarded state is the expected one
Mike Bayer [Mon, 4 Sep 2017 19:53:34 +0000 (15:53 -0400)] 
Always check that discarded state is the expected one

Fixed race condition in ORM identity map which would cause objects
to be inappropriately removed during a load operation, causing
duplicate object identities to occur, particularly under joined eager
loading which involves deduplication of objects.  The issue is specific
to garbage collection of weak references and is observed only under the
Pypy interpreter.

Change-Id: I9f6ae3fe5b078f26146af82b15d16f3a549a9032
Fixes: #4068
(cherry picked from commit 37c5ed2ed948250d7244d1e6e17da37a27c24698)

7 years agoAdd InternalError for mysqlclient disconnect
Mike Bayer [Fri, 1 Sep 2017 16:31:38 +0000 (12:31 -0400)] 
Add InternalError for mysqlclient disconnect

mysqlclient as of 1.3.11 changed the exception
class for a particular disconnect situation from
InterfaceError to InternalError; the disconnection
detection logic now accommodates this.

Change-Id: I294f90f794491fd363548719222d8e3008480615
Fixes: #4065
(cherry picked from commit 65680b2343ef421a62582e23e2b35293732933ad)

7 years agoinclude a note about the importance of type coerce for custom ops
Mike Bayer [Fri, 1 Sep 2017 14:52:16 +0000 (10:52 -0400)] 
include a note about the importance of type coerce for custom ops

Change-Id: Ia7dab65523d6a34fcc92ee785ffe03f7e2a33cfd
(cherry picked from commit 56845d8cc2678c0aefd889a7fc711150661cd8e8)

7 years agoConsider merge key with (None, ) as non-persistent
Mike Bayer [Thu, 31 Aug 2017 19:46:53 +0000 (15:46 -0400)] 
Consider merge key with (None, ) as non-persistent

Fixed bug in :meth:`.Session.merge` where objects in a collection that had
the primary key attribute set to ``None`` for a key that is  typically
autoincrementing would be considered to be a database-persisted key for
part of the internal deduplication process, causing only one object to
actually be inserted in the database.

Change-Id: I0a6e00043be0b2979cda33740e1be3b430ecf8c7
Fixes: #4056
7 years ago- pin on cx_Oracle 6.0.1 for the moment while we wait for
Mike Bayer [Thu, 31 Aug 2017 20:22:52 +0000 (16:22 -0400)] 
- pin on cx_Oracle 6.0.1 for the moment while we wait for
either https://github.com/oracle/python-cx_Oracle/issues/75
to be fixed or we can merge a workaround

Change-Id: Ia3927337fb48824e0fdc764ed3a9d4930ca7a9c6
(cherry picked from commit de73c6d1cd880b213f87723b6cf73fea20a7b9fb)

7 years agoAllow for multiple FOLLOWING/PRECEDING in a window range
Mike Bayer [Fri, 25 Aug 2017 13:41:18 +0000 (09:41 -0400)] 
Allow for multiple FOLLOWING/PRECEDING in a window range

Altered the range specification for window functions to allow
for two of the same PRECEDING or FOLLOWING keywords in a range
by allowing for the left side of the range to be positive
and for the right to be negative, e.g. (1, 3) is
"1 FOLLOWING AND 3 FOLLOWING".

Change-Id: I7d3a6c641151bb49219104968d18dac2266f3db8
Fixes: #4053
(cherry picked from commit 3a5bbe4cbe12d180fba2b942d0467b46be705bea)

7 years agoEnsure col is not None when retrieving quick populators
Mike Bayer [Wed, 23 Aug 2017 20:33:10 +0000 (16:33 -0400)] 
Ensure col is not None when retrieving quick populators

Fixed bug where an :func:`.undefer_group` option would not be recognized
if it extended from a relationship that was loading using joined eager
loading.

In particular we need to double check the column both in terms of
the given "adapter" as well as without applying the "adapter"
when searching for the column in the result.

As we now avoid redoing the row processor step we also
improve on callcounts in joined eager loading.

Change-Id: I0f48766f12f7299f4626ff41a00bf1f5bfca5f3b
Fixes: #4048
(cherry picked from commit eee9dfd4514801f0c67f71632fc722731171479b)

7 years ago- sanitize class names for junit reporting
Mike Bayer [Mon, 21 Aug 2017 21:13:12 +0000 (17:13 -0400)] 
- sanitize class names for junit reporting

Change-Id: I42821d8324208b708adc17a10b1a2758797cb9db
(cherry picked from commit a61ff195b5687b32828e1bc4d958c5cd87e94ff0)

7 years agoRestore original test names
Mike Bayer [Mon, 14 Aug 2017 13:32:08 +0000 (09:32 -0400)] 
Restore original test names

The change in de1f8f8345ecd6af0ec1177703465e9471cfe862
modified how test classes are named, breaking logic that
extracts the class name for the profiling suite.
Add a new variable _sa_orig_cls_name if we've modified the
name so that the profiling logic doesn't need to guess
the original class name.

Change-Id: Ica15a97408b9e0749a78c87f62749c15c1627009
(cherry picked from commit bb9d511e52ee5ab3621d8595328ee2400242461a)

7 years agoAllow multiple versions of single backend
Mike Bayer [Fri, 4 Aug 2017 19:43:16 +0000 (15:43 -0400)] 
Allow multiple versions of single backend

Improve screen output to illustrate which server version is
running for a particular database config, and additionally
allow full overriding for the backend-specific targets in
tox.ini via environment variables, so that CI can inject
multiple server urls for a particular database such as MySQL/MariaDB.

Change-Id: Ibf443bb9fb82e4563efd1bb66058fa9989aa2fda
(cherry picked from commit de1f8f8345ecd6af0ec1177703465e9471cfe862)

7 years ago- remove 3.4's
Mike Bayer [Wed, 23 Aug 2017 21:26:37 +0000 (17:26 -0400)] 
- remove 3.4's

Change-Id: Ib2089e812d16d7792d7b3d5bfe103abe19221a00

7 years ago- add posargs so we can run profile regenon individual tests
Mike Bayer [Wed, 23 Aug 2017 21:25:13 +0000 (17:25 -0400)] 
- add posargs so we can run profile regenon individual tests

Change-Id: I298e57a5fc920b2563e4f42367f821e0719c0be6

7 years ago- fix typos
Mike Bayer [Tue, 22 Aug 2017 22:15:59 +0000 (18:15 -0400)] 
- fix typos

Change-Id: Ibf8bc0e997ff989c7b0c16afad48a95414078052
(cherry picked from commit d8a80a35a0f117c7659c7a9c62e27994d3aadc01)

7 years ago- modernize the mysql connection timeout docs
Mike Bayer [Tue, 22 Aug 2017 20:50:19 +0000 (16:50 -0400)] 
- modernize the mysql connection timeout docs

Change-Id: Icb0474509539c1eb7536544749f2a48b4972078a
(cherry picked from commit 4ce46fb0a085c1cc739e21881cc25567e663f8dc)