]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
7 years agoFixed typo
Alex Grönholm [Mon, 25 Jun 2018 12:35:31 +0000 (15:35 +0300)] 
Fixed typo

The name of the strategy is `raise_on_sql` as indicated elsewhere in the documentation.

7 years agoCompare mappers more accurately in Load._chop_path
Mike Bayer [Mon, 25 Jun 2018 04:23:54 +0000 (00:23 -0400)] 
Compare mappers more accurately in Load._chop_path

Fixed bug in cache key generation for baked queries which could cause a
too-short cache key to be generated for the case of eager loads across
subclasses.  This could in turn cause the eagerload query to be cached in
place of a non-eagerload query, or vice versa, for a polymorhic "selectin"
load, or possibly for lazy loads or selectin loads as well.

Change-Id: I2a69349d3e38814e2c7e6012fc04fbc0e47658a4
Fixes: #4287
7 years agoMerge "render WITH clause after INSERT for INSERT..SELECT on Oracle, MySQL"
mike bayer [Sun, 24 Jun 2018 15:57:21 +0000 (11:57 -0400)] 
Merge "render WITH clause after INSERT for INSERT..SELECT on Oracle, MySQL"

7 years agoMerge remote-tracking branch 'origin/pr/454'
Mike Bayer [Wed, 20 Jun 2018 02:39:03 +0000 (22:39 -0400)] 
Merge remote-tracking branch 'origin/pr/454'

Change-Id: I88ef3f7b3151d213285b9d9164f14a1fe0582fcc

7 years agoRemove stale ON UPDATE/ON DELETE comment.
Andrew Gaul [Wed, 20 Jun 2018 00:29:34 +0000 (17:29 -0700)] 
Remove stale ON UPDATE/ON DELETE comment.

SQLite supports both of these features.

7 years agoMerge "Add oracle, mssql to profiling"
mike bayer [Mon, 18 Jun 2018 22:42:07 +0000 (18:42 -0400)] 
Merge "Add oracle, mssql to profiling"

7 years agoAdd oracle, mssql to profiling
Mike Bayer [Mon, 18 Jun 2018 21:42:29 +0000 (17:42 -0400)] 
Add oracle, mssql to profiling

As we are changing Oracle typing *again*, we should start tracking
if we trip over a big performance hit on the unicode stuff.

Change-Id: I72719cca4b9424171b32e1f2e58d655426e3bbba

7 years agorender WITH clause after INSERT for INSERT..SELECT on Oracle, MySQL
Mike Bayer [Fri, 15 Jun 2018 02:17:00 +0000 (22:17 -0400)] 
render WITH clause after INSERT for INSERT..SELECT on Oracle, MySQL

Fixed INSERT FROM SELECT with CTEs for the Oracle and MySQL dialects, where
the CTE was being placed above the entire statement as is typical with
other databases, however Oracle and MariaDB 10.2 wants the CTE underneath
the "INSERT" segment. Note that the Oracle and MySQL dialects don't yet
work when a CTE is applied to a subquery inside of an UPDATE or DELETE
statement, as the CTE is still applied to the top rather than inside the
subquery.

Also adds test suite support CTEs against backends.

Change-Id: I8ac337104d5c546dd4f0cd305632ffb56ac8bf90
Fixes: #4275
Fixes: #4230
7 years agoLookup index columns in parent table by key for copy
Mike Bayer [Fri, 15 Jun 2018 02:56:21 +0000 (22:56 -0400)] 
Lookup index columns in parent table by key for copy

Fixed regression in 1.2 due to :ticket:`4147` where a :class:`.Table` that
has had some of its indexed columns redefined with new ones, as would occur
when overriding columns during reflection or when using
:paramref:`.Table.extend_existing`, such that the :meth:`.Table.tometadata`
method would fail when attempting to copy those indexes as they still
referred to the replaced column.   The copy logic now accommodates for this
condition.

Change-Id: I521aa2c9f3baa0e84598bbdd6ffe4bf07b6e3ba8
Fixes: #4279
7 years agoUse INITERROR macro in utils.c
Andru1999 [Wed, 13 Jun 2018 18:53:59 +0000 (14:53 -0400)] 
Use INITERROR macro in utils.c

Remove py3k check where we initialize the module and
instead make this look like the same init sequence
as resultproxy.c, processors.c

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: Ia6352e50eaf760d95ab2bbf66d90c023c37f1193
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/429

7 years agoupdate client-side/server-side SQL default expression documentation
Mike Bayer [Wed, 13 Jun 2018 16:01:20 +0000 (12:01 -0400)] 
update client-side/server-side SQL default expression documentation

These docs were inaccurate and verbose, try to modernize them
with up to date information and add cues to allow the reader
to understand them quickly.

Change-Id: I997d9b8963d90c73f5960fe29d8f1b5005299da7

7 years agoImporting InspectionAttr twice, now once
hendawy [Wed, 27 Dec 2017 14:02:43 +0000 (14:02 +0000)] 
Importing InspectionAttr twice, now once

Change-Id: Ifc250d9361bf277d4269f8b58d40ce056b29dd83
(cherry picked from commit 07444e39e3b0cc9cde620e67bea27708ff0fc3bc)

7 years agoMerge "Iterate options per path for baked cache key"
mike bayer [Thu, 7 Jun 2018 14:18:22 +0000 (10:18 -0400)] 
Merge "Iterate options per path for baked cache key"

7 years agoIterate options per path for baked cache key
Mike Bayer [Wed, 6 Jun 2018 20:35:34 +0000 (16:35 -0400)] 
Iterate options per path for baked cache key

Fixed an issue that was both a performance regression in 1.2 as well as an
incorrect result regarding the "baked" lazy loader, involving the
generation of cache keys from the original :class:`.Query` object's loader
options.  If the loader options were built up in a "branched" style using
common base elements for multiple options, the same options would be
rendered into the cache key repeatedly, causing both a performance issue as
well as generating the wrong cache key.  This is fixed, along with a
performance improvement when such "branched" options are applied via
:meth:`.Query.options` to prevent the same option objects from being
applied repeatedly.

Change-Id: I955fe2f50186abd8e753ad490fd3eb8f017e26f9
Fixes: #4270
7 years agoMerge "Support undocumented non-entity sequence Query argument"
mike bayer [Wed, 6 Jun 2018 13:31:20 +0000 (09:31 -0400)] 
Merge "Support undocumented non-entity sequence Query argument"

7 years agoMerge "Add Query.lazy_load_from attribute for sharding"
mike bayer [Wed, 6 Jun 2018 13:29:28 +0000 (09:29 -0400)] 
Merge "Add Query.lazy_load_from attribute for sharding"

7 years agoAdd the kwargs to the Adapt method
Fokko Driesprong [Mon, 4 Jun 2018 19:37:18 +0000 (21:37 +0200)] 
Add the kwargs to the Adapt method

This will override the original signature of the method:
https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/sql/type_api.py#L522

7 years agoSmall docs style fixes in inheritance.rst
BR [Mon, 4 Jun 2018 16:33:39 +0000 (12:33 -0400)] 
Small docs style fixes in inheritance.rst

Change-Id: I01d217cf1a8a1a8791e3b44167dfc4d6a0c77cdb
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/445

7 years agoAdd Query.lazy_load_from attribute for sharding
Mike Bayer [Mon, 28 May 2018 17:03:14 +0000 (13:03 -0400)] 
Add Query.lazy_load_from attribute for sharding

Added new attribute :attr:`.Query.lazy_loaded_from` which is populated
with an :class:`.InstanceState` that is using this :class:`.Query` in
order to lazy load a relationship.  The rationale for this is that
it serves as a hint for the horizontal sharding feature to use, such that
the identity token of the state can be used as the default identity token
to use for the query within id_chooser().

Also repaired an issue in the :meth:`.Result.with_post_criteria`
method added in I899808734458e25a023142c2c5bb37cbed869479
for :ticket:`4128` where the "unbake subquery loaders" version was calling
the post crtieria functions given the :class:`.Result` as the argument
rather than applying them to the :class:`.Query`.

Change-Id: I3c0919ce7fd151b80fe2f9b5f99f60df31c2d73d
Fixes: #4243
7 years agoSupport undocumented non-entity sequence Query argument
Mike Bayer [Fri, 1 Jun 2018 21:54:11 +0000 (16:54 -0500)] 
Support undocumented non-entity sequence Query argument

Fixed regression caused by :ticket:`4256` (itself a regression fix for
:ticket:`4228`) which breaks an undocumented behavior which converted for a
non-sequence of entities passed directly to the :class:`.Query` constructor
into a single-element sequence.  While this behavior was never supported or
documented, it's already in use so has been added as a behavioral contract
to :class:`.Query`.

Change-Id: I97546f5ab5af29f37c86321f39d564f98a12daf5
Fixes: #4269
7 years agocherry-pick changelog update for 1.2.9
Mike Bayer [Mon, 28 May 2018 19:23:41 +0000 (15:23 -0400)] 
cherry-pick changelog update for 1.2.9

7 years agocherry-pick changelog from 1.2.8
Mike Bayer [Mon, 28 May 2018 19:23:41 +0000 (15:23 -0400)] 
cherry-pick changelog from 1.2.8

7 years agoMerge "Mutex on _CONFIGURE_MUTEX in automap.prepare()"
mike bayer [Mon, 28 May 2018 16:41:08 +0000 (12:41 -0400)] 
Merge "Mutex on _CONFIGURE_MUTEX in automap.prepare()"

7 years agoMutex on _CONFIGURE_MUTEX in automap.prepare()
Mike Bayer [Sun, 27 May 2018 17:45:20 +0000 (13:45 -0400)] 
Mutex on _CONFIGURE_MUTEX in automap.prepare()

Fixed a race condition which could occur if automap
:meth:`.AutomapBase.prepare` were used within a multi-threaded context
against other threads which  may call :func:`.configure_mappers` as a
result of use of other mappers.  The unfinished mapping work of automap
is particularly sensitive to being pulled in by a
:func:`.configure_mappers` step leading to errors.

Change-Id: I6d36df6639bf5cb8f137187dff68f386f5e84f88
Fixes: #4266
7 years agoTurn oracle BINARY_DOUBLE, BINARY_FLOAT, DOUBLE_PRECISION into floats
Mike Bayer [Wed, 23 May 2018 20:22:48 +0000 (16:22 -0400)] 
Turn oracle BINARY_DOUBLE, BINARY_FLOAT, DOUBLE_PRECISION into floats

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, :class:`.oracle.BINARY_FLOAT`,
:class:`.oracle.BINARY_DOUBLE` and :class:`.oracle.DOUBLE_PRECISION` now
subclass :class:`.Float`, since these are floating point datatypes, not
decimal.  These datatypes were already defaulting the
:paramref:`.Float.asdecimal` flag to False in line with what
:class:`.Float` already does.

Added reflection capabilities for the :class:`.oracle.BINARY_FLOAT`,
:class:`.oracle.BINARY_DOUBLE` datatypes.

Change-Id: Id99b912e83052654a17d07dc92b4dcb958cb7600
Fixes: #4264
7 years agocall setinputsizes() for integer types
Mike Bayer [Fri, 18 May 2018 16:51:40 +0000 (12:51 -0400)] 
call setinputsizes() for integer types

Altered the Oracle dialect such that when an :class:`.Integer` type 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.

Change-Id: Ida80cc2c2c37ffc0e05da4b5df2dadfab55a01f2
Fixes: #4259
7 years agoSkip for SQL Server on non-native boolean unconstrained
Mike Bayer [Thu, 17 May 2018 23:57:01 +0000 (19:57 -0400)] 
Skip for SQL Server on non-native boolean unconstrained

As SQL Server is now non-native boolean as of
I4765d2a2a00b0d14f50282603cc4d48d4739dac1 but uses the BIT
type, we need to constrain this test to continue to not
run against SQL Server.

Change-Id: I214faf2b788a0e8e10725622e3e71f3b70805533

7 years agoMerge "Update dogpile.cache example to be compatible with baked query."
mike bayer [Thu, 17 May 2018 21:25:48 +0000 (17:25 -0400)] 
Merge "Update dogpile.cache example to be compatible with baked query."

7 years agoMerge "Fix string formatting TypeError if tuple is passed"
mike bayer [Thu, 17 May 2018 21:24:55 +0000 (17:24 -0400)] 
Merge "Fix string formatting TypeError if tuple is passed"

7 years agoUpdate dogpile.cache example to be compatible with baked query.
Mike Bayer [Wed, 16 May 2018 20:31:40 +0000 (16:31 -0400)] 
Update dogpile.cache example to be compatible with baked query.

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
:ticket:`4256`.  The issue here is also worked-around by the fix in
:ticket:`4128`.

Note that this recipe requires
I3f86fcb12a6a9a89aa308b335e75c25969bcc30e in order for the
"advanced" example to work.

Change-Id: I9d35417f1d6c1906555583b8225d3da7f81736f7
Fixes: #4258
7 years agoFix string formatting TypeError if tuple is passed
Miguel Ventura [Mon, 14 May 2018 20:56:58 +0000 (16:56 -0400)] 
Fix string formatting TypeError if tuple is passed

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
Miguel Ventura.

Change-Id: I50d5d32d5f80ec79703a42d4b19b42c2f9701f24
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/442

7 years agoMerge "Prevent double-checkins and guard during reset-on-return invalidations"
mike bayer [Thu, 17 May 2018 03:20:13 +0000 (23:20 -0400)] 
Merge "Prevent double-checkins and guard during reset-on-return invalidations"

7 years agoMerge "Change query._identity_lookup into a normal instance method"
mike bayer [Thu, 17 May 2018 03:19:06 +0000 (23:19 -0400)] 
Merge "Change query._identity_lookup into a normal instance method"

7 years agoClarify dogpile.cache differences which occur via #4128.
Mike Bayer [Wed, 16 May 2018 19:47:50 +0000 (15:47 -0400)] 
Clarify dogpile.cache differences which occur via #4128.

The fix for :ticket:`4128` which failed to be included
in the 1.2.5 release also works around an issue in the dogpile.cache
"advanced" example, which will also be fixed independently.

Change-Id: I5eb0da9b93f13f05a8cbe4559e2ed177b1f91a52

7 years agoChange query._identity_lookup into a normal instance method
Mike Bayer [Wed, 16 May 2018 15:16:57 +0000 (11:16 -0400)] 
Change query._identity_lookup into a normal instance method

Fixed regression in 1.2.7 caused by :ticket:`4228`, which itself was fixing
a 1.2-level regression, where the ``query_cls`` callable passed to a
:class:`.Session` was assumed to be a subclass of :class:`.Query`  with
class method availability, as opposed to an arbitrary callable.    In
particular, the dogpile caching example illustrates ``query_cls`` as a
function and not a :class:`.Query` subclass.

Change-Id: I3f86fcb12a6a9a89aa308b335e75c25969bcc30e
Fixes: #4256
7 years agoCorrect from version 1.2.5 to 1.2.8 for #4128
Mike Bayer [Wed, 16 May 2018 19:16:25 +0000 (15:16 -0400)] 
Correct from version 1.2.5 to 1.2.8 for #4128

Change-Id: I3c9ec52a15e7cd083725d40f19078a783f1a4e23

7 years agoRestore missing changelog files for #4128
Mike Bayer [Mon, 26 Feb 2018 00:54:37 +0000 (19:54 -0500)] 
Restore missing changelog files for #4128

The fix merged in 4a31c30fa5ebd6af0e72937b21b2e5ee79e12631
failed to get backported to 1.2 and the changelog files
got blown away in the release process.  Restore the
changelog files to master before cherry-picking
the whole thing to 1.2.

Change-Id: I899808734458e25a023142c2c5bb37cbed869479
Fixes: #4128
7 years agoPrevent double-checkins and guard during reset-on-return invalidations
Mike Bayer [Tue, 15 May 2018 20:15:51 +0000 (16:15 -0400)] 
Prevent double-checkins and guard during reset-on-return invalidations

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 :class:`.Connection`
object (such as from calling :meth:`.Session.close` without a rollback or
commit, or calling :meth:`.Connection.close` without first closing a
transaction declared with :meth:`.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
fixed.

Change-Id: If5bb6941e36326846b14918c33ebfdd5604f642e
Fixes: #4252
7 years agoMerge "Use identity_token for refresh(), unexpire, undefer"
mike bayer [Sun, 13 May 2018 15:25:40 +0000 (11:25 -0400)] 
Merge "Use identity_token for refresh(), unexpire, undefer"

7 years agoMerge "Default server_version_info to (0, )"
mike bayer [Fri, 11 May 2018 17:33:24 +0000 (13:33 -0400)] 
Merge "Default server_version_info to (0, )"

7 years agoDefault server_version_info to (0, )
Mike Bayer [Fri, 11 May 2018 13:19:10 +0000 (09:19 -0400)] 
Default server_version_info to (0, )

Fixed a bug in the test suite where if an external dialect returned
``None`` for ``server_version_info``, the exclusion logic would raise an
``AttributeError``.

Change-Id: I9124d3ac5484941081127274e6eb71f392fb94f7
Fixes: #4249
7 years agoSQL Server is not native boolean; add new flag for CHECK constraint
Mike Bayer [Thu, 10 May 2018 15:39:06 +0000 (11:39 -0400)] 
SQL Server is not native boolean; add new flag for CHECK constraint

Fixed a 1.2 regression caused by :ticket:`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.
"WHERE <column>".   The SQL Server dialect now goes back to being
non-native boolean, but with an extra flag that still avoids creating
the CHECK constraint.

Change-Id: I4765d2a2a00b0d14f50282603cc4d48d4739dac1
Fixes: #4250
7 years ago- add a tl;dr to postgresql search_path section as it's long
Mike Bayer [Sun, 6 May 2018 13:02:02 +0000 (09:02 -0400)] 
- add a tl;dr to postgresql search_path section as it's long
and will be easier to read if we know where it's going first.

Change-Id: I2766cf4655451ed514d4dc95ac60406b9f4a8ddb

7 years ago- modernize versioning examples
Mike Bayer [Sat, 5 May 2018 21:42:57 +0000 (17:42 -0400)] 
- modernize versioning examples
- add new example versioned_rows_w_versionid

Change-Id: I592cd5eb7db50162b4c4ad6191813d9def2b6d7c

7 years agoUse identity_token for refresh(), unexpire, undefer
Mike Bayer [Thu, 3 May 2018 16:35:23 +0000 (12:35 -0400)] 
Use identity_token for refresh(), unexpire, undefer

The horizontal sharding extension now makes use of the identity token
added to ORM identity keys as part of :ticket:`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.

Change-Id: Ib91637a65d94ace7405998b8410d62944a83f2eb
Fixes: #4247
7 years ago- add sap-hana
Mike Bayer [Thu, 3 May 2018 13:59:36 +0000 (09:59 -0400)] 
- add sap-hana

Change-Id: Id3ddd78fceb31df40c5f00f8b21320b0da8488af
(cherry picked from commit 21b6ec97318e87ab1bf36acf469eb9deb9823e0e)

7 years agoRender FOR UPDATE on the inner subquery as well as the outer
Mike Bayer [Mon, 30 Apr 2018 15:31:48 +0000 (11:31 -0400)] 
Render FOR UPDATE on the inner subquery as well as the outer

The ORM now doubles the "FOR UPDATE" clause within the subquery that
renders in conjunction with joined eager loading in some cases, as it has
been observed that MySQL does not lock the rows from a subquery.   This
means the query renders with two FOR UPDATE clauses; note that on some
backends such as Oracle, FOR UPDATE clauses on subqueries are silently
ignored since they are unnecessary.  Additionally, in the case of the "OF"
clause used primarily with Postgresql, the FOR UPDATE is rendered only on
the inner subquery when this is used so that the selectable can be targeted
to the table within the SELECT statement.

Change-Id: Ie5520d08d82bf0afd9e1bd2d43a0b2a0db0de16d
Fixes: #4246
7 years ago- block cx_Oracle 6.3 due to https://github.com/oracle/python-cx_Oracle/issues/176
Mike Bayer [Tue, 1 May 2018 17:16:40 +0000 (13:16 -0400)] 
- block cx_Oracle 6.3 due to https://github.com/oracle/python-cx_Oracle/issues/176

Change-Id: If13288789f5f32eb3ffb18c774752bb68a9ffb2a

7 years ago- add space invaders example
Mike Bayer [Fri, 27 Apr 2018 19:05:21 +0000 (15:05 -0400)] 
- add space invaders example

Change-Id: I439b6012af8c2bd8f555744657b8091ac168242b

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