]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
6 years agoAdd missing range_ / rows parameters to additional over() methods
Mike Bayer [Mon, 20 Aug 2018 02:19:59 +0000 (22:19 -0400)] 
Add missing range_ / rows parameters to additional over() methods

Added missing window function parameters
:paramref:`.WithinGroup.over.range_` and :paramref:`.WithinGroup.over.rows`
parameters to the :meth:`.WithinGroup.over` and
:meth:`.FunctionFilter.over` methods, to correspond to the range/rows
feature added to the "over" method of SQL functions as part of
:ticket:`3049` in version 1.1.

Fixes: #4322
Change-Id: I77dcdac65c699a4b52a3fc3ee09a100ffb4fc20e

6 years agoDocument binary_prefix for mysqlclient and PyMySQL
Mike Bayer [Fri, 17 Aug 2018 23:25:20 +0000 (19:25 -0400)] 
Document binary_prefix for mysqlclient and PyMySQL

Also, remove the section on "use_unicode=0", there is no reason
anyone should be using that now.

Fixes: #4216
Change-Id: I5b8b53e40903adf339af2934a4f2d8b068818ebf

6 years agoMerge "Accommodate for classically mapped base classes in declarative"
mike bayer [Fri, 17 Aug 2018 18:55:26 +0000 (14:55 -0400)] 
Merge "Accommodate for classically mapped base classes in declarative"

6 years agoMerge "Add concept of "implicit boolean", treat as native"
mike bayer [Fri, 17 Aug 2018 15:51:22 +0000 (11:51 -0400)] 
Merge "Add concept of "implicit boolean", treat as native"

6 years agoAccommodate for classically mapped base classes in declarative
Mike Bayer [Fri, 17 Aug 2018 15:37:30 +0000 (11:37 -0400)] 
Accommodate for classically mapped base classes in declarative

Fixed issue in previously untested use case, allowing a declarative mapped
class to inherit from a classically-mapped class outside of the declarative
base, including that it accommodates for unmapped intermediate classes. An
unmapped intermediate class may specify ``__abstract__``, which is now
interpreted correctly, or the intermediate class can remain unmarked, and
the classically mapped base class will be detected within the hierarchy
regardless. In order to anticipate existing scenarios which may be mixing
in classical mappings into existing declarative hierarchies, an error is
now raised if multiple mapped bases are detected for a given class.

Fixes: #4321
Change-Id: I8604ecfd170d2589d9d1b1c87ba303762071fc30

6 years agoAdd test support for #4036
Mike Bayer [Wed, 15 Aug 2018 20:36:30 +0000 (16:36 -0400)] 
Add test support for #4036

Add a test that asserts MySQL can't implicitly treat a decimal
bound parameter without context and everyone else can.

Change-Id: I40e24a463d6eb03fd677195895891e73624776c3

6 years agoAdd concept of "implicit boolean", treat as native
Mike Bayer [Wed, 15 Aug 2018 21:11:14 +0000 (17:11 -0400)] 
Add concept of "implicit boolean", treat as native

Fixed issue that is closely related to :ticket:`3639` where an expression
rendered in a boolean context on a non-native boolean backend would
be compared to 1/0 even though it is already an implcitly boolean
expression, when :meth:`.ColumnElement.self_group` were used.  While this
does not affect the user-friendly backends (MySQL, SQLite) it was not
handled by Oracle (and possibly SQL Server).   Whether or not the
expression is implicitly boolean on any database is now determined
up front as an additional check to not generate the integer comparison
within the compliation of the statement.

Fixes: #4320
Change-Id: Iae0a65e5c01bd576e64733c3651e1e1a1a1b240c

6 years agoAdd ability to preserve order in MySQL ON DUPLICATE KEY UPDATE.
Maxim Bublis [Wed, 18 Jul 2018 18:06:07 +0000 (14:06 -0400)] 
Add ability to preserve order in MySQL ON DUPLICATE KEY UPDATE.

Added support for the parameters in an ON DUPLICATE KEY UPDATE statement on
MySQL to be ordered, since parameter order in a MySQL UPDATE clause is
significant, in a similar manner as that described at
:ref:`updates_order_parameters`.  Pull request courtesy Maxim Bublis.

Pull-request: https://github.com/zzzeek/sqlalchemy/pull/462
Change-Id: If508d8e26dbd3c55ab1e83cf573fb4021e9d091e

6 years agoCorrect for the INSERT statement, typos
Mike Bayer [Thu, 9 Aug 2018 18:35:52 +0000 (14:35 -0400)] 
Correct for the INSERT statement, typos

Change-Id: I036f3eb9b5e591515920678bc9a76f707fda142c

6 years agoWrite a much better section about server defaults
Mike Bayer [Thu, 9 Aug 2018 17:34:03 +0000 (13:34 -0400)] 
Write a much better section about server defaults

Include information about eager_defaults etc.  These
docs were written before we had all the features
we do now.

Change-Id: Ie62e58c5986698824f717e9f8c802b07a27517d4
Fixes: #4317
6 years agoFixed issue with :meth:`.TypeEngine.bind_expression` and
Mike Bayer [Tue, 7 Aug 2018 22:59:05 +0000 (18:59 -0400)] 
Fixed issue with :meth:`.TypeEngine.bind_expression` and
:meth:`.TypeEngine.column_expression` methods where these methods would not
work if the target type were part of a :class:`.Variant`, or other target
type of a :class:`.TypeDecorator`.  Additionally, the SQL compiler now
calls upon the dialect-level implementation when it renders these methods
so that dialects can now provide for SQL-level processing for built-in
types.

Change-Id: Ic7b39575184db582e628e6ecee48dcda7d03a817
Fixes: #3981
6 years agoAdd support of empty list in exanding of bindparam
Nicolas Rolin [Fri, 25 May 2018 17:27:22 +0000 (13:27 -0400)] 
Add support of empty list in exanding of bindparam

Added new logic to the "expanding IN" bound parameter feature whereby if
the given list is empty, a special "empty set" expression that is specific
to different backends is generated, thus allowing IN expressions to be
fully dynamic including empty IN expressions.

Fixes: #4271
Change-Id: Icc3c73bbd6005206b9d06baaeb14a097af5edd36
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/432

6 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
6 years agoMerge "Handle association proxy delete and provide for scalar delete cascade"
mike bayer [Thu, 2 Aug 2018 03:20:01 +0000 (23:20 -0400)] 
Merge "Handle association proxy delete and provide for scalar delete cascade"

6 years agoMerge "Bind Integers to int for cx_Oracle"
mike bayer [Thu, 2 Aug 2018 03:18:58 +0000 (23:18 -0400)] 
Merge "Bind Integers to int for cx_Oracle"

6 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
6 years agoHandle association proxy delete and provide for scalar delete cascade
Mike Bayer [Wed, 1 Aug 2018 16:01:59 +0000 (12:01 -0400)] 
Handle association proxy delete and provide for scalar delete cascade

Fixed multiple issues regarding de-association of scalar objects with the
association proxy.  ``del`` now works, and additionally a new flag
:paramref:`.AssociationProxy.cascade_scalar_deletes` is added, which when
set to True indicates that setting a scalar attribute to ``None`` or
deleting via ``del`` will also set the source association to ``None``.

Change-Id: I1580d761571d63eb03a7e8df078cef97d265b85c
Fixes: #4308
6 years agoMerge "Fix collections ABC access before Python 3.8"
mike bayer [Wed, 1 Aug 2018 21:39:58 +0000 (17:39 -0400)] 
Merge "Fix collections ABC access before Python 3.8"

6 years agoMention Properties keys in __dir__
Korn, Uwe [Mon, 9 Jul 2018 15:54:38 +0000 (11:54 -0400)] 
Mention Properties keys in __dir__

The Python builtin ``dir()`` is now supported for a SQLAlchemy "properties"
object, such as that of a Core columns collection (e.g. ``.c``),
``mapper.attrs``, etc.  Allows iPython autocompletion to work as well.
Pull request courtesy Uwe Korn.

Change-Id: I8696729542d1b74a566642a3a63fd500f64588cd
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/458

Mention Properties keys in __dir__

Change-Id: I88939955857c8df5eed0b87bc27c45357780b17d

6 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

6 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

6 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

6 years agoMerge branch 'migration-12-typo-fix' of https://bitbucket.org/nbasu02/sqlalchemy
Mike Bayer [Wed, 1 Aug 2018 02:11:22 +0000 (22:11 -0400)] 
Merge branch 'migration-12-typo-fix' of https://bitbucket.org/nbasu02/sqlalchemy

Change-Id: I4682c1f7f94f25b813be686fdce0a2e0839412fe

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

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

7 years agoMerge "Fix quoting schemas in _get_table_sql for the SQLite backend"
mike bayer [Wed, 18 Jul 2018 18:00:33 +0000 (14:00 -0400)] 
Merge "Fix quoting schemas in _get_table_sql for the SQLite backend"

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

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

7 years agoDon't apply no-traverse to query.statement
Mike Bayer [Sat, 14 Jul 2018 16:26:29 +0000 (12:26 -0400)] 
Don't apply no-traverse to query.statement

Fixed long-standing issue in :class:`.Query` where a scalar subquery such
as produced by :meth:`.Query.exists`, :meth:`.Query.as_scalar` and other
derivations from :attr:`.Query.statement` would not correctly be adapted
when used in a new :class:`.Query` that required entity adaptation, such as
when the query were turned into a union, or a from_self(), etc. The change
removes the "no adaptation" annotation from the :func:`.select` object
produced by the :attr:`.Query.statement` accessor.

Change-Id: I554e0e909ac6ee785ec3b3b14aaec9d235aa28cf
Fixes: #4304
7 years agocherry-pick changelog update for 1.2.11
Mike Bayer [Fri, 13 Jul 2018 23:03:48 +0000 (19:03 -0400)] 
cherry-pick changelog update for 1.2.11

7 years agocherry-pick changelog from 1.2.10
Mike Bayer [Fri, 13 Jul 2018 23:03:48 +0000 (19:03 -0400)] 
cherry-pick changelog from 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
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
7 years ago- fix typo
Mike Bayer [Fri, 13 Jul 2018 16:41:04 +0000 (12:41 -0400)] 
- fix typo

Change-Id: I78692e821e34afe654c1131cd3465e4a6dfe773f

7 years agoCorrect fastexecutemany test for lower pyodbc version
Mike Bayer [Fri, 13 Jul 2018 02:55:01 +0000 (22:55 -0400)] 
Correct fastexecutemany test for lower pyodbc version

some builds on CI have a pyodbc that is < 4.0.19, make
the check more specific

Change-Id: I69b33c2367d4a03adb00bcf52fb6d1483b0327f8

7 years agoMerge "Don't null FK for collection-removed item with passive_deletes='all'"
mike bayer [Thu, 12 Jul 2018 21:41:25 +0000 (17:41 -0400)] 
Merge "Don't null FK for collection-removed item with passive_deletes='all'"

7 years agoDon't null FK for collection-removed item with passive_deletes='all'
Mike Bayer [Wed, 28 Feb 2018 16:50:17 +0000 (11:50 -0500)] 
Don't null FK for collection-removed item with passive_deletes='all'

Fixed issue regarding passive_deletes="all", where the foreign key
attribute of an object is maintained with its value even after the object
is removed from its parent collection.  Previously, the unit of work would
set this to NULL even though passive_deletes indicated it should not be
modified.

Change-Id: I5ba98bc388cbdd6323d255b764e02506c2e66896
Fixes: #3844
7 years agoMerge "Drop default-related structures after the Table is dropped."
mike bayer [Wed, 11 Jul 2018 13:30:17 +0000 (09:30 -0400)] 
Merge "Drop default-related structures after the Table is dropped."

7 years agoAdd pyodbc fast_executemany
Mike Bayer [Wed, 11 Jul 2018 03:47:05 +0000 (23:47 -0400)] 
Add pyodbc fast_executemany

Added ``fast_executemany=True`` parameter to the SQL Server pyodbc dialect,
which enables use of pyodbc's new performance feature of the same name
when using Microsoft ODBC drivers.

Change-Id: I743fa7280e8f709addd330cfc7682623701cbb2e
Fixes: #4158
7 years agoMerge "Add all "like", "between", "is" operators as comparison operators"
mike bayer [Wed, 11 Jul 2018 03:15:33 +0000 (23:15 -0400)] 
Merge "Add all "like", "between", "is" operators as comparison operators"

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
7 years agoSqlite json
Ilja Everilä [Thu, 15 Mar 2018 14:18:13 +0000 (10:18 -0400)] 
Sqlite json

Added support for SQLite's json functionality via the new
SQLite implementation for :class:`.sqltypes.JSON`, :class:`.sqlite.JSON`.
The name used for the type is ``JSON``, following an example found at
SQLite's own documentation. Pull request courtesy Ilja Everilä.

Fixes: #3850
Change-Id: I3d2714fb8655343a99d13dc751b16b93d05d7dda
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/434

7 years agoAdd all "like", "between", "is" operators as comparison operators
Mike Bayer [Tue, 10 Jul 2018 21:00:21 +0000 (17:00 -0400)] 
Add all "like", "between", "is" operators as comparison operators

Added "like" based operators as "comparison" operators, including
:meth:`.ColumnOperators.startswith` :meth:`.ColumnOperators.endswith`
:meth:`.ColumnOperators.ilike` :meth:`.ColumnOperators.notilike` among many
others, so that all of these operators can be the basis for an ORM
"primaryjoin" condition.

Change-Id: Idb13961f0c74462a139fc3444626e042f798ff08
Fixes: #4302
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

7 years agoMerge "Use MySQL protocol-level ping."
mike bayer [Tue, 10 Jul 2018 01:51:58 +0000 (21:51 -0400)] 
Merge "Use MySQL protocol-level ping."

7 years agoMerge "Expire memoizations on setattr/delattr, check in delattr"
mike bayer [Tue, 10 Jul 2018 01:51:10 +0000 (21:51 -0400)] 
Merge "Expire memoizations on setattr/delattr, check in delattr"

7 years agosupport functions "as binary comparison"
Mike Bayer [Mon, 9 Jul 2018 19:47:14 +0000 (15:47 -0400)] 
support functions "as binary comparison"

Added new feature :meth:`.FunctionElement.as_comparison` which allows a SQL
function to act as a binary comparison operation that can work within the
ORM.

Change-Id: I07018e2065d09775c0406cabdd35fc38cc0da699
Fixes: #3831
7 years agoMerge "Refactor pool.py into a package"
mike bayer [Mon, 9 Jul 2018 22:38:27 +0000 (18:38 -0400)] 
Merge "Refactor pool.py into a package"

7 years agoExpire memoizations on setattr/delattr, check in delattr
Mike Bayer [Mon, 9 Jul 2018 22:24:12 +0000 (18:24 -0400)] 
Expire memoizations on setattr/delattr, check in delattr

Fixed bug where declarative would not update the state of the
:class:`.Mapper` as far as what attributes were present, when additional
attributes were added or removed after the mapper attribute collections had
already been called and memoized.  Addtionally, a ``NotImplementedError``
is now raised if a fully mapped attribute (e.g. column, relationship, etc.)
is deleted from a class that is currently mapped, since the mapper will not
function correctly if the attribute has been removed.

Change-Id: Idaca8e0237b31aa1d6564d94c3a179d7dc6b5df9
Fixes: #4133
7 years agoUse MySQL protocol-level ping.
Maxim Bublis [Mon, 2 Jul 2018 16:34:32 +0000 (12:34 -0400)] 
Use MySQL protocol-level ping.

Utilizes MySQL protocol-level pings for disconnection detection.
This is just a 5-byte packet followed by a 7-byte response.

Affects MySQLdb, MySQL Connector and PyMySQL dialects.

Change-Id: I672f75e3746878d88987a31750444dde0cf8eb9b
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/460

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

7 years ago- add changelog 13 and links
Mike Bayer [Mon, 9 Jul 2018 21:37:06 +0000 (17:37 -0400)] 
- add changelog 13 and links

Change-Id: I658a5958c0b053a26308aba213d9da3a67b75a1c

7 years agoRefactor pool.py into a package
Mike Bayer [Wed, 13 Jun 2018 20:19:23 +0000 (16:19 -0400)] 
Refactor pool.py into a package

for better separation of concerns split out the
core pooling constructs from the implementations.  also
makes more room for new pool classes should we decide to
add them.  The DBProxy feature is never used so remove it
from documentation and split it out.

Change-Id: I04c9d7ae1882b17f3cf5c37ed05b781b05ef88fa
Fixes: #4255
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
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

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

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

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

7 years agocherry-pick changelog update for 1.2.10
Mike Bayer [Fri, 29 Jun 2018 17:45:17 +0000 (13:45 -0400)] 
cherry-pick changelog update for 1.2.10

7 years agocherry-pick changelog from 1.2.9
Mike Bayer [Fri, 29 Jun 2018 17:45:16 +0000 (13:45 -0400)] 
cherry-pick changelog from 1.2.9

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

7 years agoMerge remote-tracking branch 'origin/pr/456'
Mike Bayer [Fri, 29 Jun 2018 15:08:23 +0000 (11:08 -0400)] 
Merge remote-tracking branch 'origin/pr/456'

Change-Id: Id1d26d756f26e8cece921f476bc3f49689a3b782

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

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

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
7 years agoMerge "Vendor python3 formatargspec"
mike bayer [Thu, 28 Jun 2018 17:41:18 +0000 (13:41 -0400)] 
Merge "Vendor python3 formatargspec"

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
7 years agoMerge "Add do_setinputsizes event for cx_Oracle"
mike bayer [Thu, 28 Jun 2018 14:43:00 +0000 (10:43 -0400)] 
Merge "Add do_setinputsizes event for cx_Oracle"

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

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
7 years agoMerge "Ensure BakedQuery is cloned before we add options to it"
mike bayer [Tue, 26 Jun 2018 22:00:47 +0000 (18:00 -0400)] 
Merge "Ensure BakedQuery is cloned before we add options to it"

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
7 years agoMerge "fix TypeReflectionTest for sqlite 3.24"
mike bayer [Tue, 26 Jun 2018 03:51:07 +0000 (23:51 -0400)] 
Merge "fix TypeReflectionTest for sqlite 3.24"

7 years agoMerge "Look up adapter info for previous left side in chained query.join()"
mike bayer [Tue, 26 Jun 2018 03:48:52 +0000 (23:48 -0400)] 
Merge "Look up adapter info for previous left side in chained query.join()"

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
7 years agoMerge "Fix UnboundLocalError in mssql during isolation level grab"
mike bayer [Tue, 26 Jun 2018 02:42:40 +0000 (22:42 -0400)] 
Merge "Fix UnboundLocalError in mssql during isolation level grab"

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

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

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

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
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 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
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