]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
7 years agoInclude UPDATE/DELETE extra_froms in correlation
Mike Bayer [Sat, 4 Aug 2018 17:45:07 +0000 (13:45 -0400)] 
Include UPDATE/DELETE extra_froms in correlation

Fixed bug where the multi-table support for UPDATE and DELETE statements
did not consider the additional FROM elements as targets for correlation,
when a correlated SELECT were also combined with the statement.  This
change now includes that a SELECT statement in the WHERE clause for such a
statement will try to auto-correlate back to these additional tables in the
parent UPDATE/DELETE or unconditionally correlate if
:meth:`.Select.correlate` is used.  Note that auto-correlation raises an
error if the SELECT statement would have no FROM clauses as a result, which
can now occur if the parent UPDATE/DELETE specifies the same tables in its
additional set of tables ; specify :meth:`.Select.correlate` explicitly to
resolve.

Change-Id: Ie11eaad7e49af3f59df11691b104d6359341bdae
Fixes: #4313
(cherry picked from commit abeea1d82db34232bbef01e98fa4d1de0f583eb6)

7 years agoBind Integers to int for cx_Oracle
Mike Bayer [Wed, 1 Aug 2018 18:12:49 +0000 (14:12 -0400)] 
Bind Integers to int for cx_Oracle

For cx_Oracle, Integer datatypes will now be bound to "int", per advice
from the cx_Oracle developers.  Previously, using cx_Oracle.NUMBER caused a
loss in precision within the cx_Oracle 6.x series.

Change-Id: I4c6b2cca490aff5b98b7ceff3414715202881c89
Fixes: #4309
(cherry picked from commit 75d48e65eaac9e97283bb14fdec54a143d9997f1)

7 years agoFix collections ABC access before Python 3.8
Nathaniel Knight [Wed, 1 Aug 2018 01:59:47 +0000 (21:59 -0400)] 
Fix collections ABC access before Python 3.8

Started importing "collections" from "collections.abc" under Python 3.3 and
greater for Python 3.8 compatibility.  Pull request courtesy Nathaniel
Knight.

In Python 3.3, the abstract base classes (Iterable, Mapping, etc.)
were moved from the `collections` module and put in the
`collections.abc` module. They remain in the `collections` module for
backwards compatibility, and will until Python 3.8.

This commit adds a variable (`collections_abc`) to the `util/compat`
module, which will be the `collections` module for Python < 3.3 and
before, or the `collections.abc` module for Python >= 3.3. It also
uses the new variable, getting rid of some deprecation warnings that
were seen when running under Python 3.7.

Change-Id: I2d1c0ef97c8ecac7af152cc56263422a40faa6bb
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/464
(cherry picked from commit a59c3b8f302a34ab037ec445b7452b1f353b91af)

7 years agoCorrect sharding tests for provisioned follower
Mike Bayer [Wed, 1 Aug 2018 16:27:22 +0000 (12:27 -0400)] 
Correct sharding tests for provisioned follower

The sharding tests created named sqlite databases that were
shared across test suites.  It is unknown why these suddenly
started failing and were not failing before.

Change-Id: If2044f914ddaea0db594aa18b9278e24e2c818ea
(cherry picked from commit 1c32206120b1a6555f8bb7a20a0c4c53ea2f52a8)

7 years agoDo some pep8 and other cruft removal around association proxy
Mike Bayer [Wed, 1 Aug 2018 16:13:33 +0000 (12:13 -0400)] 
Do some pep8 and other cruft removal around association proxy

Change-Id: I33130022a7e223318b65388620828d539f6dacfd
(cherry picked from commit 65469442ad30b97d5901347e0a5a64f3179f765d)

7 years agoAdd comma in migration-12
Neil Basu [Tue, 31 Jul 2018 21:27:18 +0000 (14:27 -0700)] 
Add comma in migration-12

(cherry picked from commit 09f21f1e21a2247eba3d9e9aaaa3c336ba98b9ea)

7 years agoReplace 'with' with 'which'
Kevin Horn [Fri, 27 Jul 2018 16:06:50 +0000 (11:06 -0500)] 
Replace 'with' with 'which'

(cherry picked from commit 8601e86f1179d93d5d072c8774bfae41caa8cf56)

7 years agoFix quoting schemas in _get_table_sql for the SQLite backend
Phillip Cloud [Mon, 16 Jul 2018 14:10:55 +0000 (10:10 -0400)] 
Fix quoting schemas in _get_table_sql for the SQLite backend

Fixed issue where the "schema" name used for a SQLite database within table
reflection would not quote the schema name correctly.  Pull request
courtesy Phillip Cloud.

Change-Id: I2770788c1f094a7743209250ec26b5ef5fb2d9e8
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/463
(cherry picked from commit 893eac06e511f3765c0c89bab76d7933d83ffccc)

7 years agoAdd `postgresql_psycopg2binary` install extra that installs `psycopg2-binary`
Alex Rothberg [Wed, 18 Jul 2018 14:40:52 +0000 (10:40 -0400)] 
Add `postgresql_psycopg2binary` install extra that installs `psycopg2-binary`

Fixes: #4306
Change-Id: I26edc1a4ac8a7f9f3f258bb03009ebfa4cc00e1a
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/465
(cherry picked from commit 5469dd1b8f19960a319464327bcd2425f31543bf)

7 years agoVersion 1.2.11 placeholder
Mike Bayer [Fri, 13 Jul 2018 23:03:48 +0000 (19:03 -0400)] 
Version 1.2.11 placeholder

7 years ago- 1.2.10 rel_1_2_10
Mike Bayer [Fri, 13 Jul 2018 22:59:06 +0000 (18:59 -0400)] 
- 1.2.10

7 years agoUse exprs for bundle __clause_element__
Mike Bayer [Fri, 13 Jul 2018 16:58:21 +0000 (12:58 -0400)] 
Use exprs for bundle __clause_element__

Fixed bug in :class:`.Bundle` construct where placing two columns of the
same name would be de-duplicated, when the :class:`.Bundle` were used as
part of the rendered SQL, such as in the ORDER BY or GROUP BY of the statement.

Change-Id: Ia528c9fbb399a6beb5ea7cdd3a8a83ad530f5831
Fixes: #4295
(cherry picked from commit 2fdf26020878edcbaa7792a869b3d45b715cc05a)

7 years agoCorrect the bug number for :ticket:`4288`, which was erroneously
Mike Bayer [Fri, 13 Jul 2018 16:44:50 +0000 (12:44 -0400)] 
Correct the bug number for :ticket:`4288`, which was erroneously
given as :ticket:`4228`.

Change-Id: I6525560c1bcf3f3d861d6254723f5facdba6adae
Fixes: #4288
(cherry picked from commit 2c44fc22a7e9a4ac69ed6ce9da5551eb2d7cc1a2)

7 years ago- fix typo
Mike Bayer [Fri, 13 Jul 2018 16:41:04 +0000 (12:41 -0400)] 
- fix typo

Change-Id: I78692e821e34afe654c1131cd3465e4a6dfe773f
(cherry picked from commit 16cca68de872901d6b3c279a8d62d698e0068969)

7 years agoDrop default-related structures after the Table is dropped.
Mike Bayer [Tue, 10 Jul 2018 13:41:21 +0000 (09:41 -0400)] 
Drop default-related structures after the Table is dropped.

Fixed bug where a :class:`.Sequence` would be dropped explicitly before any
:class:`.Table` that refers to it, which breaks in the case when the
sequence is also involved in a server-side default for that table, when
using :meth:`.MetaData.drop_all`.   The step which processes sequences
to be dropped via non server-side column default functions is now invoked
after the table itself is dropped.

Change-Id: I185f2cc76d2011ad4dd3ba9bde5d8aef0ec335ae
Fixes: #4300
(cherry picked from commit 532566ba1f28ff8a6afa6eacc10c59eb918501f6)

7 years agoDocument sticky behavior of loader options
Mike Bayer [Tue, 10 Jul 2018 17:30:05 +0000 (13:30 -0400)] 
Document sticky behavior of loader options

References #4301

Change-Id: If921e3b8369e2cd5312b5964a99bcf7731b3ecfc
(cherry picked from commit 3cc832992d6820a3cbc88d1b8aca958af8175a49)

7 years ago- add docs for PG REGCLASS
Mike Bayer [Mon, 9 Jul 2018 21:44:31 +0000 (17:44 -0400)] 
- add docs for PG REGCLASS
- remove __init__ docs for types without an init

Change-Id: I254ecb3763eaeb29aa71743c87ce2e021507fe28
(cherry picked from commit 941143858ba949c3a4a2dfcc5cd710ae6d4146e1)

7 years agoCheck tokens in chop path for inspectionattr before calling is_mapper
Mike Bayer [Sun, 8 Jul 2018 23:10:36 +0000 (19:10 -0400)] 
Check tokens in chop path for inspectionattr before calling is_mapper

Fixed regression in 1.2.9 due to :ticket:`4287` where using a
:class::`.Load` option in conjunction with a string wildcard would result
in a TypeError.

Change-Id: I2997ead0b8b9fa0edd009aa6f3161f4618fab97b
Fixes: #4298
(cherry picked from commit aec57258b3b33fe070ebb54f31f1627db07f072b)

7 years ago- add some context to the declarative section indicating this is not
Mike Bayer [Thu, 5 Jul 2018 04:05:42 +0000 (00:05 -0400)] 
- add some context to the declarative section indicating this is not
the introductory material for these topics

Change-Id: I358ba8c32520ce3950a727216bc019e33377e7b9
(cherry picked from commit 284009683d9e48e19cc09e740e7b928c2c02997c)

7 years agoblock cx_Oracle 6.4
Mike Bayer [Thu, 5 Jul 2018 03:33:16 +0000 (23:33 -0400)] 
block cx_Oracle 6.4

Prevents https://github.com/oracle/python-cx_Oracle/issues/199

Change-Id: I0f94bde38919a027f094ca016621c1364e845332
(cherry picked from commit 4f4d47fdf2a01ad5b76bac66a0ac93da0cab6c3c)

7 years ago- fix linking for the query.rst page
Mike Bayer [Wed, 4 Jul 2018 21:48:31 +0000 (17:48 -0400)] 
- fix linking for the query.rst page

Change-Id: I269fdd72e372e1bf4f0f85e9fc8e6938adc4f686
(cherry picked from commit b6fb6f6b60e87d00fcd702b92e883cf3c61d07c6)

7 years ago- add "leaks memory" to documented issues w/ mysqlconnector,
Mike Bayer [Sat, 30 Jun 2018 22:30:25 +0000 (18:30 -0400)] 
- add "leaks memory" to documented issues w/ mysqlconnector,
references #4296

Change-Id: I5b663d3444d3732a83a32443c128faffe62f11d9
(cherry picked from commit c7d364b385e6c4605c50d0ee9264dfac0bc84dde)

7 years agoVersion 1.2.10 placeholder
Mike Bayer [Fri, 29 Jun 2018 17:45:17 +0000 (13:45 -0400)] 
Version 1.2.10 placeholder

7 years ago- 1.2.9 rel_1_2_9
Mike Bayer [Fri, 29 Jun 2018 17:36:01 +0000 (13:36 -0400)] 
- 1.2.9

7 years agoMerge "Add unique_constraint_name to MSSQL FK reflection" into rel_1_2
mike bayer [Fri, 29 Jun 2018 16:26:38 +0000 (12:26 -0400)] 
Merge "Add unique_constraint_name to MSSQL FK reflection" into rel_1_2

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.

(cherry picked from commit 6daffe5406fcb4c4015229f0737a4c8218c66d76)

7 years agoAdd unique_constraint_name to MSSQL FK reflection
Sean Dunn [Fri, 29 Jun 2018 14:26:57 +0000 (10:26 -0400)] 
Add unique_constraint_name to MSSQL FK reflection

Fixed bug in MSSQL reflection where when two same-named tables in different
schemas had same-named primary key constraints, foreign key constraints
referring to one of the tables would have their columns doubled, causing
errors.   Pull request courtesy Sean Dunn.

Fixes: #4228
Change-Id: I7dabaaee0944e1030048826ba39fc574b0d63031
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/457
(cherry picked from commit ca94ea8ab583f8ab366ee5971bfc1bdd96e54cc9)

7 years agoMerge "Reflect ASC/DESC in MySQL index columns" into rel_1_2
mike bayer [Thu, 28 Jun 2018 23:48:33 +0000 (19:48 -0400)] 
Merge "Reflect ASC/DESC in MySQL index columns" into rel_1_2

7 years agoReflect ASC/DESC in MySQL index columns
Mike Bayer [Thu, 28 Jun 2018 18:33:14 +0000 (14:33 -0400)] 
Reflect ASC/DESC in MySQL index columns

Fixed bug in index reflection where on MySQL 8.0 an index that includes
ASC or DESC in an indexed column specfication would not be correctly
reflected, as MySQL 8.0 introduces support for returning this information
in a table definition string.

Change-Id: I21f64984ade690aac8c87dbe3aad0c1ee8e9727f
Fixes: #4293
(cherry picked from commit 9d2dc7911b7767b97814479d228072b6f566a864)

7 years agoUpdate URL for PyMySQL documentation
Logan Rosen [Thu, 28 Jun 2018 20:04:27 +0000 (16:04 -0400)] 
Update URL for PyMySQL documentation

(cherry picked from commit b694a309e89e7c3e57e83dd10e9a75c66672c396)

7 years agoVendor python3 formatargspec
Mike Bayer [Thu, 28 Jun 2018 15:49:02 +0000 (11:49 -0400)] 
Vendor python3 formatargspec

Replaced the usage of inspect.formatargspec() with a vendored version
copied from the Python standard library, as inspect.formatargspec()
is deprecated and as of Python 3.7.0 is emitting a warning.

Change-Id: I751652fac7f605a3a10b547ba8c5f34fef1de945
Fixes: #4291
(cherry picked from commit 536d5187a038a44aec624dd2a99792f49dec82ed)

7 years agoMerge "Add do_setinputsizes event for cx_Oracle" into rel_1_2
mike bayer [Thu, 28 Jun 2018 14:44:05 +0000 (10:44 -0400)] 
Merge "Add do_setinputsizes event for cx_Oracle" into rel_1_2

7 years agoTry to get mysqlconnector somewhat working
Mike Bayer [Wed, 27 Jun 2018 20:08:23 +0000 (16:08 -0400)] 
Try to get mysqlconnector somewhat working

Add CI support for MySQL connector and try to fix some of the
more obvious issues.  CI tests will run against MySQL 5.7
only for starters as there appear to be issues with
MySQL 8.0

Change-Id: Id8971143a8385a5c84f0646c21c4c21e793ce3a2
(cherry picked from commit 83750628d180b9b9e5a6ae9a2ecb3a001553cb81)

7 years agoAdd do_setinputsizes event for cx_Oracle
Mike Bayer [Tue, 26 Jun 2018 20:53:51 +0000 (16:53 -0400)] 
Add do_setinputsizes event for cx_Oracle

Added a new event currently used only by the cx_Oracle dialect,
:meth:`.DialectEvents.setiputsizes`.  The event passes a dictionary of
:class:`.BindParameter` objects to DBAPI-specific type objects that will be
passed, after conversion to parameter names, to the cx_Oracle
``cursor.setinputsizes()`` method.  This allows both visibility into the
setinputsizes process as well as the ability to alter the behavior of what
datatypes are passed to this method.

Change-Id: I43b97c8e3c840cad6f01edb274dc9cfed19cb5fc
Fixes: #4290
(cherry picked from commit c270efdfb38a266ac042be2a0d11b6ff7e5ee619)

7 years agoEnsure BakedQuery is cloned before we add options to it
Mike Bayer [Mon, 25 Jun 2018 02:50:06 +0000 (22:50 -0400)] 
Ensure BakedQuery is cloned before we add options to it

Fixed bug in new polymorphic selectin loading where the BakedQuery used
internally would be mutated by the given loader options, which would both
inappropriately mutate the subclass query as well as carry over the effect
to subsequent queries.

Change-Id: Iaceecb50557f78484d09e55b3029a0483dfe873f
Fixes: #4286
(cherry picked from commit f243c00dda1484da97e706b7237670cdce6f10b9)

7 years agoMerge "fix TypeReflectionTest for sqlite 3.24" into rel_1_2
mike bayer [Tue, 26 Jun 2018 03:51:17 +0000 (23:51 -0400)] 
Merge "fix TypeReflectionTest for sqlite 3.24" into rel_1_2

7 years agoLook up adapter info for previous left side in chained query.join()
Mike Bayer [Wed, 13 Jun 2018 22:13:21 +0000 (18:13 -0400)] 
Look up adapter info for previous left side in chained query.join()

Fixed issue where chaining multiple join elements inside of
:meth:`.Query.join` might not correctly adapt to the previous left-hand
side, when chaining joined inheritance classes that share the same base
class.

Change-Id: I4b846430b7362912dbebf50599ec15a1eb978fd4
Fixes: #3505
(cherry picked from commit f683ddf16b34513d9f589202f2cdff9d0e0fad6b)

7 years agoMerge "Fix UnboundLocalError in mssql during isolation level grab" into rel_1_2
mike bayer [Tue, 26 Jun 2018 02:42:51 +0000 (22:42 -0400)] 
Merge "Fix UnboundLocalError in mssql during isolation level grab" into rel_1_2

7 years agoMerge "Support JOIN in UPDATE..FROM" into rel_1_2
mike bayer [Mon, 25 Jun 2018 22:39:26 +0000 (18:39 -0400)] 
Merge "Support JOIN in UPDATE..FROM" into rel_1_2

7 years agofix TypeReflectionTest for sqlite 3.24
Nils Philippsen [Sun, 24 Jun 2018 15:47:05 +0000 (11:47 -0400)] 
fix TypeReflectionTest for sqlite 3.24

Fixed issue in test suite where SQLite 3.24 added a new reserved word that
conflicted with a usage in TypeReflectionTest.  Pull request courtesy Nils
Philippsen.

Change-Id: I396562cecb5ca774f29e9234845bcc6a399fc5cb
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/452
(cherry picked from commit 40a5d0a4b006780167976b296984eb9790f3df7f)

7 years agoFix UnboundLocalError in mssql during isolation level grab
Mike Bayer [Mon, 18 Jun 2018 14:12:56 +0000 (17:12 +0300)] 
Fix UnboundLocalError in mssql during isolation level grab

Fixed issue within the SQL Server dialect under Python 3 where when running
against a non-standard SQL server database that does not contain either the
"sys.dm_exec_sessions" or "sys.dm_pdw_nodes_exec_sessions" views, leading
to a failure to fetch the isolation level, the error raise would fail due
to an UnboundLocalError.

Fixes: #4273
Co-authored-by: wikiped <wikiped@yandex.ru>
Change-Id: I39877c1f65f9cf8602fb1dceaf03072357759564
(cherry picked from commit e2913f65c4e5720394105584c69e7b9e8c2d373c)

7 years agoUse utf8mb4 (or utf8mb3) for all things MySQL
Mike Bayer [Sun, 24 Jun 2018 17:06:38 +0000 (13:06 -0400)] 
Use utf8mb4 (or utf8mb3) for all things MySQL

Fixed bug in MySQLdb dialect and variants such as PyMySQL where an
additional "unicode returns" check upon connection makes explicit use of
the "utf8" character set, which in MySQL 8.0 emits a warning that utf8mb4
should be used.  This is now replaced with a utf8mb4 equivalent.
Documentation is also updated for the MySQL dialect to specify utf8mb4 in
all examples.  Additional changes have been made to the test suite to use
utf8mb3 charsets and databases (there seem to be collation issues in some
edge cases with utf8mb4), and to support configuration default changes made
in MySQL 8.0 such as explicit_defaults_for_timestamp as well as new errors
raised for invalid MyISAM indexes.

Change-Id: Ib596ea7de4f69f976872a33bffa4c902d17dea25
Fixes: #4283
Fixes: #4192
(cherry picked from commit c99345ee9994c3ea2a5e6536cc3365f18d017cc1)

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

7 years agoMerge "render WITH clause after INSERT for INSERT..SELECT on Oracle, MySQL" into...
mike bayer [Sun, 24 Jun 2018 15:57:34 +0000 (11:57 -0400)] 
Merge "render WITH clause after INSERT for INSERT..SELECT on Oracle, MySQL" into rel_1_2

7 years agoSupport JOIN in UPDATE..FROM
Mike Bayer [Wed, 13 Jun 2018 19:59:35 +0000 (15:59 -0400)] 
Support JOIN in UPDATE..FROM

The :class:`.Update` construct now accommodates a :class:`.Join` object
as supported by MySQL for UPDATE..FROM.  As the construct already
accepted an alias object for a similar purpose, the feature of UPDATE
against a non-table was already implied so this has been added.

Change-Id: I7b2bca627849384d5377abb0c94626463e4fad04
Fixes: #3645
(cherry picked from commit 58540ae93db30fb12f331587c32bb2d76db79ab3)

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.

(cherry picked from commit 6bb50e12930dce0471f74b24f93b3ff1569d94dd)

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

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

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

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

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

7 years agoMerge "Support undocumented non-entity sequence Query argument" into rel_1_2
mike bayer [Wed, 6 Jun 2018 13:31:30 +0000 (09:31 -0400)] 
Merge "Support undocumented non-entity sequence Query argument" into rel_1_2

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

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

(cherry picked from commit 5bdab5b0eea21d51cc30652c7e3a713c89bfe013)

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

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

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

7 years agoVersion 1.2.9 placeholder
Mike Bayer [Mon, 28 May 2018 19:23:41 +0000 (15:23 -0400)] 
Version 1.2.9 placeholder

7 years ago- 1.2.8 rel_1_2_8
Mike Bayer [Mon, 28 May 2018 19:16:36 +0000 (15:16 -0400)] 
- 1.2.8

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

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

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

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

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

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

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

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

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

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

Corrected backport, was supposed to be in 1.2.5 however
never got backported.

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.

As part of this change, 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.
In particular, this repairs one regression which occured when
using the dogpile.cache "advanced" example, which was not
returning cached results and instead emitting SQL due to an
incompatibility with the baked query loader; with the change,
the ``RelationshipCache`` option included for many releases
in the dogpile example will disable the "baked" query altogether.
Note that the dogpile example is also modernized to avoid both
of these issues as part of issue :ticket:`4258`.

This is a cherry-pick / squash from:
4a31c30fa5ebd6af0e72937b21b2e5ee79e12631
2e46f73f35b9036287f5f567c09a8cb786fe5fd3
b9f428a589a1718efa20e5555be45ae3f767e89e

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

7 years agoMerge "Use identity_token for refresh(), unexpire, undefer" into rel_1_2
mike bayer [Sun, 13 May 2018 15:25:51 +0000 (11:25 -0400)] 
Merge "Use identity_token for refresh(), unexpire, undefer" into rel_1_2

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

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

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

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

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

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

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

7 years agoVersion 1.2.8 placeholder
Mike Bayer [Fri, 20 Apr 2018 20:35:53 +0000 (16:35 -0400)] 
Version 1.2.8 placeholder

7 years ago- 1.2.7 rel_1_2_7
Mike Bayer [Fri, 20 Apr 2018 20:28:18 +0000 (16:28 -0400)] 
- 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
(cherry picked from commit 43f278356d94b5342a1020a9a97feea0bb7cd88f)

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

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

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

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

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

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

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

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

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

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

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

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

7 years agoVersion 1.2.7 placeholder
Mike Bayer [Fri, 30 Mar 2018 20:29:53 +0000 (16:29 -0400)] 
Version 1.2.7 placeholder

7 years ago- 1.2.6 rel_1_2_6
Mike Bayer [Fri, 30 Mar 2018 20:24:20 +0000 (16:24 -0400)] 
- 1.2.6

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

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

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

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