]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
8 years agoDocument and test __table_cls__
Mike Bayer [Tue, 26 Sep 2017 00:00:20 +0000 (20:00 -0400)] 
Document and test __table_cls__

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

Change-Id: I87be5bcb72205cab89871fa586663bf147450995
Fixes: #4082
8 years agoMerge "Add table / column comments into tometadata()"
mike bayer [Mon, 25 Sep 2017 23:32:11 +0000 (19:32 -0400)] 
Merge "Add table / column comments into tometadata()"

8 years agoMerge branch 'kishkin/fixed-a-typo-in-before_execute-doc-event-1503409727849' of...
Mike Bayer [Mon, 25 Sep 2017 21:24:57 +0000 (17:24 -0400)] 
Merge branch 'kishkin/fixed-a-typo-in-before_execute-doc-event-1503409727849' of https://bitbucket.org/kishkin/sqlalchemy

8 years agoAdd table / column comments into tometadata()
Mike Bayer [Sat, 23 Sep 2017 16:08:40 +0000 (12:08 -0400)] 
Add table / column comments into tometadata()

Fixed bug in new SQL comments feature where table and column comment
would not be copied when using :meth:`.Table.tometadata`.

Change-Id: Ib3112e5e02930245daacb36c8ed38c01fa3e7dbd
Fixes: #4087
8 years agoMerge "Add __next__(), next() to ResultProxy"
mike bayer [Mon, 18 Sep 2017 13:49:50 +0000 (09:49 -0400)] 
Merge "Add __next__(), next() to ResultProxy"

8 years agoAdd multivalued insert context for defaults
Mike Bayer [Wed, 13 Sep 2017 15:39:47 +0000 (11:39 -0400)] 
Add multivalued insert context for defaults

Added a new method :class:`.DefaultExecutionContext.current_parameters`
which is used within a function-based default value generator in
order to retrieve the current parameters being passed to the statement.
The new function differs from the ``.current_parameters`` attribute in
that it also provides for optional grouping of parameters that
correspond to a multi-valued "insert" construct.  Previously it was not
possible to identify the subset of parameters that were relevant to
the function call.

Change-Id: I6894c7b4a2bce3e83c3ade8af0e5b2f8df37b785
Fixes: #4075
8 years agoAdd __next__(), next() to ResultProxy
Mike Bayer [Fri, 15 Sep 2017 15:14:36 +0000 (11:14 -0400)] 
Add __next__(), next() to ResultProxy

Added ``__next__()`` and ``next()`` methods to :class:`.ResultProxy`,
so that the ``next()`` builtin function works on the object directly.
:class:`.ResultProxy` has long had an ``__iter__()`` method which already
allows it to respond to the ``iter()`` builtin.   The implementation
for ``__iter__()`` is unchanged, as performance testing has indicated
that iteration using a ``__next__()`` method with ``StopIteration``
is about 20% slower in both Python 2.7 and 3.6.

Change-Id: I70569a4c48ad85a3c21a7ad422f270a559926cfb
Fixes: #4077
8 years agoMerge "Implement placeholders for CUBE, ROLLUP, GROUPING SETS"
mike bayer [Thu, 14 Sep 2017 19:40:22 +0000 (15:40 -0400)] 
Merge "Implement placeholders for CUBE, ROLLUP, GROUPING SETS"

8 years agoMerge "Ensure (+) is rendered for all right-hand members"
mike bayer [Wed, 13 Sep 2017 19:50:42 +0000 (15:50 -0400)] 
Merge "Ensure (+) is rendered for all right-hand members"

8 years agoImplement placeholders for CUBE, ROLLUP, GROUPING SETS
Spitcyn [Tue, 12 Sep 2017 14:21:57 +0000 (10:21 -0400)] 
Implement placeholders for CUBE, ROLLUP, GROUPING SETS

Fixes: #3429
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: I870ee7dc801d553c5309c291402ec468b671e9a9
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/383

8 years agoEnsure (+) is rendered for all right-hand members
Mike Bayer [Wed, 13 Sep 2017 18:53:29 +0000 (14:53 -0400)] 
Ensure (+) is rendered for all right-hand members

Fixed bug where Oracle 8 "non ansi" join mode would not add the
``(+)`` operator to expressions that used an operator other than the
``=`` operator.  The ``(+)`` needs to be on all columns that are part
of the right-hand side.

Change-Id: I952e2369f11b78f5b918456ae3a5b0768d9761ec
Fixes: #4076
8 years agouse the stack to get the insert statement in on conflict
Mike Bayer [Tue, 12 Sep 2017 16:57:40 +0000 (12:57 -0400)] 
use the stack to get the insert statement in on conflict

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

Change-Id: Ie20972a05e194290bc9d92819750845872949ecc
Fixes: #4074
8 years agoRefactor for cx_Oracle version 6
Mike Bayer [Fri, 1 Sep 2017 04:11:10 +0000 (00:11 -0400)] 
Refactor for cx_Oracle version 6

Drops support for cx_Oracle prior to version 5.x, reworks
numeric and binary support.

Fixes: #4064
Change-Id: Ib9ae9aba430c15cd2a6eeb4e5e3fd8e97b5fe480

8 years agoDon't use repr() for Column/ColumnClause in warning
Mike Bayer [Mon, 11 Sep 2017 03:08:30 +0000 (23:08 -0400)] 
Don't use repr() for Column/ColumnClause in warning

for #4073, use the string version of the column expression
in the warning, otherwise the repr() is showing the hex id
which causes unlimited warnings.

Change-Id: I6869b685b237e7f02c7b5071701dd63a3577182a

8 years agoWarn instead of raise for unmapped column that matches on key
Mike Bayer [Sun, 10 Sep 2017 04:01:18 +0000 (00:01 -0400)] 
Warn instead of raise for unmapped column that matches on key

Modified the change made to the ORM update/delete evaluator in
:ticket:`3366` such that if an unmapped column expression is present
in the update or delete, if the evaluator can match its name to the
mapped columns of the target class, a warning is emitted, rather than
raising UnevaluatableError.  This is essentially the pre-1.2 behavior,
and is to allow migration for applications that are currently relying
upon this pattern.  However, if the given attribute name cannot be
matched to the columns of the mapper, the UnevaluatableError is
still raised, which is what was fixed in :ticket:`3366`.

Change-Id: I658ed0dbf485b7f8009774f9c12d9912447abd2a
Fixes: #4073
8 years agoMerge "Remove LRU warnings"
mike bayer [Sat, 9 Sep 2017 14:28:56 +0000 (10:28 -0400)] 
Merge "Remove LRU warnings"

8 years agoRemove LRU warnings
Mike Bayer [Fri, 8 Sep 2017 00:38:00 +0000 (20:38 -0400)] 
Remove LRU warnings

Removed the warnings that are emitted when the LRU caches employed
by the mapper as well as loader srtategies reach their threshold; the
purpose of this warning was at first a guard against excess cache keys
being generated but became basically a check on the "creating many
engines" antipattern.   While this is still an antipattern, the presense
of test suites which both create an engine per test as well as raise
on all warnings will be an inconvenience; it should not be critical
that such test suites change their architecture just for this warning
(though engine-per-test suite is always better).

Change-Id: I41ef8cd642d05a845f53119b196440f9d7879cd9
Fixes: #4071
8 years agoRename MySQL dml.insert().values to .inserted
Mike Bayer [Sat, 9 Sep 2017 01:34:39 +0000 (21:34 -0400)] 
Rename MySQL dml.insert().values to .inserted

Changed the name of the ``.values`` attribute of the new MySQL
INSERT..ON DUPLICATE KEY UPDATE construct to ``.inserted``, as
:class:`.Insert` already has a method called :meth:`.Insert.values`.
The ``.inserted`` attribute ultimately renders the MySQL ``VALUES()``
function.

Change-Id: I8da8e30a3077698385a4b77e2c2032e2d1ff10b2
Fixes: #4072
8 years ago- skip oracle tests until we can merge refactor
Mike Bayer [Sat, 9 Sep 2017 01:40:53 +0000 (21:40 -0400)] 
- skip oracle tests until we can merge refactor

Change-Id: Ie9bec6e8f51d52349dcbd8009981818e459e88b8

8 years ago- add separate oracle / oracle5 jobs so we can CI
Mike Bayer [Tue, 5 Sep 2017 21:20:05 +0000 (17:20 -0400)] 
- add separate oracle / oracle5 jobs so we can CI
on both series for now

Change-Id: Ide8938334c248119c1d5c2e1bf07070f17c86242

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

Change-Id: I81fd38694b19ee9dadaf89276dd4fe9bd6f67c94
(cherry picked from commit 21ca9b50c794c58df476300206aefff46511909d)

8 years ago- 1.1.14
Mike Bayer [Tue, 5 Sep 2017 17:06:26 +0000 (13:06 -0400)] 
- 1.1.14

(cherry picked from commit 4b22b01ade6f94cc4db2f2040c802067a25d29a4)

Change-Id: I520fbff300ae034166a2f80685e0831ff2d1929e

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

Change-Id: I1648f7780cc0accdfe7650a62754b39c8e5552a8
(cherry picked from commit 2cdb0777c2bfd35b1cdda7fdb9ce60122211bc29)

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

8 years agoMerge "Check for non-mapped property in synonym"
mike bayer [Tue, 5 Sep 2017 13:44:06 +0000 (09:44 -0400)] 
Merge "Check for non-mapped property in synonym"

8 years agoMerge "Ensure custom ops have consistent typing behavior, boolean support"
mike bayer [Mon, 4 Sep 2017 23:49:23 +0000 (19:49 -0400)] 
Merge "Ensure custom ops have consistent typing behavior, boolean support"

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

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

Change-Id: Ifecfb8b9d50c52d0ebd5a03e1bd69fe3abf1dc40
Fixes: #4069
8 years ago- add forwards-port versions
Mike Bayer [Mon, 4 Sep 2017 23:02:19 +0000 (19:02 -0400)] 
- add forwards-port versions

Change-Id: I5741f213d0edb989566f45140f5e7e1dd522e194

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

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

Change-Id: If2ce38c429a69951df4c94b71b74edbd59d775e3
Fixes: #4067
8 years agoAlways check that discarded state is the expected one
Mike Bayer [Mon, 4 Sep 2017 19:53:34 +0000 (15:53 -0400)] 
Always check that discarded state is the expected one

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

Change-Id: I9f6ae3fe5b078f26146af82b15d16f3a549a9032
Fixes: #4068
8 years agoEnsure custom ops have consistent typing behavior, boolean support
Mike Bayer [Fri, 1 Sep 2017 14:35:30 +0000 (10:35 -0400)] 
Ensure custom ops have consistent typing behavior, boolean support

Refined the behavior of :meth:`.Operators.op` such that in all cases,
if the :paramref:`.Operators.op.is_comparison` flag is set to True,
the return type of the resulting expression will be
:class:`.Boolean`, and if the flag is False, the return type of the
resulting expression will be the same type as that of the left-hand
expression, which is the typical default behavior of other operators.
Also added a new parameter :paramref:`.Operators.op.return_type` as well
as a helper method :meth:`.Operators.bool_op`.

Change-Id: Ifc8553cd4037d741b84b70a9702cbd530f1a9de0
Fixes: #4063
8 years agoAdd InternalError for mysqlclient disconnect
Mike Bayer [Fri, 1 Sep 2017 16:31:38 +0000 (12:31 -0400)] 
Add InternalError for mysqlclient disconnect

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

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

Change-Id: Ia7dab65523d6a34fcc92ee785ffe03f7e2a33cfd

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

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

Change-Id: I0a6e00043be0b2979cda33740e1be3b430ecf8c7
Fixes: #4056
(cherry picked from commit 5243341ed886e10a0d3f7fef8ae3d071e0ffdcf0)

8 years agoAdd SQL Server CI coverage
Mike Bayer [Tue, 29 Aug 2017 16:36:54 +0000 (12:36 -0400)] 
Add SQL Server CI coverage

Change-Id: Ida0d01ae9bcc0573b86e24fddea620a38c962822

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

Change-Id: Ia3927337fb48824e0fdc764ed3a9d4930ca7a9c6

8 years agoAdditional fixes to sane rowcount
Mike Bayer [Thu, 31 Aug 2017 19:27:26 +0000 (15:27 -0400)] 
Additional fixes to sane rowcount

Implement rowcount assertions and single row check
for post_update as well as deletes.

Change-Id: I4e5ba7e8747bf0e0b41f569089eb8cdbf064b7a9
Fixes: #4062
8 years agoAdd new sane_rowcount_w_returning flag
Mike Bayer [Thu, 31 Aug 2017 17:12:50 +0000 (13:12 -0400)] 
Add new sane_rowcount_w_returning flag

Added a new class of "rowcount support" for dialects that is specific to
when "RETURNING", which on SQL Server looks like "OUTPUT inserted", is in
use, as the PyODBC backend isn't able to give us rowcount on an UPDATE or
DELETE statement when OUTPUT is in effect.  This primarily affects the ORM
when a flush is updating a row that contains server-calcluated values,
raising an error if the backend does not return the expected row count.
PyODBC now states that it supports rowcount except if OUTPUT.inserted is
present, which is taken into account by the ORM during a flush as to
whether it will look for a rowcount.

ORM tests are implicit in existing tests run against PyODBC

Fixes: #4062
Change-Id: Iff17cbe4c7a5742971ed85a4d58660c18cc569c2

8 years agoUse text_type, not unicode
Mike Bayer [Thu, 31 Aug 2017 14:04:22 +0000 (10:04 -0400)] 
Use text_type, not unicode

Revise the fix from 03560c4b83308719067ec635662c35f9a437fb7f
to use compat.text_type for py3k compatibility

Change-Id: Ia6807bd4de3bba4b33b5327a1be7e728b45eb093

8 years agoEnable native boolean for SQL Server
Mike Bayer [Wed, 30 Aug 2017 22:06:07 +0000 (18:06 -0400)] 
Enable native boolean for SQL Server

SQL Server supports what SQLAlchemy calls "native boolean"
with its BIT type, as this type only accepts 0 or 1 and the
DBAPIs return its value as True/False.   So the SQL Server
dialects now enable "native boolean" support, in that a
CHECK constraint is not generated for a :class:`.Boolean`
datatype.  The only difference vs. other native boolean
is that there are no "true" / "false" constants so "1" and
"0" are still rendered here.

Tests are implicit in the existing suites.

Change-Id: I75bbcd549884099fb1a177e68667bf880c40fa7c
Fixes: #4061
8 years agoMerge "Join key_constraints on schema as well for SQL server get_fks"
mike bayer [Wed, 30 Aug 2017 16:30:44 +0000 (12:30 -0400)] 
Merge "Join key_constraints on schema as well for SQL server get_fks"

8 years agoMerge "Ignore SQL Server "heap" indexes"
mike bayer [Wed, 30 Aug 2017 16:30:17 +0000 (12:30 -0400)] 
Merge "Ignore SQL Server "heap" indexes"

8 years agoAdd preparer to pymssql that disables percent doubling
Mike Bayer [Wed, 30 Aug 2017 16:19:54 +0000 (12:19 -0400)] 
Add preparer to pymssql that disables percent doubling

Fixed the pymssql dialect so that percent signs in SQL text, such
as used in modulus expressions or literal textual values, are
**not** doubled up, as seems to be what pymssql expects.  This is
despite the fact that the pymssql DBAPI uses the "pyformat" parameter
style which itself considers the percent sign to be significant.

Tests are part of standard suite already (CI has been disabled)

Change-Id: Ie05de403caefcba3292a967183a995e95a5854d5
Fixes: #4057
8 years agoIgnore SQL Server "heap" indexes
Mike Bayer [Wed, 30 Aug 2017 16:23:31 +0000 (12:23 -0400)] 
Ignore SQL Server "heap" indexes

Added a rule to SQL Server index reflection to ignore the so-called
"heap" index that is implicitly present on a table that does not
specify a clustered index.

Tests are part of standard suite already (CI has been disabled)

Change-Id: I593b95551c40ee5d95d54203611112cbff10856f
Fixes: #4059
8 years agoJoin key_constraints on schema as well for SQL server get_fks
Mike Bayer [Wed, 30 Aug 2017 16:25:57 +0000 (12:25 -0400)] 
Join key_constraints on schema as well for SQL server get_fks

Fixed bug where the SQL Server dialect could pull columns from multiple
schemas when reflecting a self-referential foreign key constraint, if
multiple schemas contained a constraint of the same name against a
table of the same name.

Tests are part of standard suite already (CI has been disabled)

Change-Id: I04ff4a5dea9b82c8e517b3700a28fe994b5550f3
Fixes: #4060
8 years ago- rename SQL server autocommit issue to 4058
Mike Bayer [Wed, 30 Aug 2017 16:15:00 +0000 (12:15 -0400)] 
- rename SQL server autocommit issue to 4058
Fixes #4058

Change-Id: I5d56f4a4d8e42659860fa982abee4698118e4d84

8 years agoImplement AUTOCOMMIT for pyodbc, pymssql
Mike Bayer [Tue, 29 Aug 2017 18:31:43 +0000 (14:31 -0400)] 
Implement AUTOCOMMIT for pyodbc, pymssql

In prep for CI coverage for SQL Server, allow AUTOCOMMIT
isolation level to work

Change-Id: I850b977e75f53385986f2c181be4e4412dd3b3f4

8 years agoGeneralize autocommit testing
Mike Bayer [Tue, 29 Aug 2017 17:37:02 +0000 (13:37 -0400)] 
Generalize autocommit testing

To support adding AUTOCOMMIT to more dialects, add a suite
test

Change-Id: I585dcce19fcdce70e8cf21aea4edaa97d7bf2bb9

8 years agoMerge "Apply percent sign escaping to literal binds, comments"
mike bayer [Mon, 28 Aug 2017 14:53:28 +0000 (10:53 -0400)] 
Merge "Apply percent sign escaping to literal binds, comments"

8 years agoMerge "Don't do recovery operations under Empty/AttributeError"
mike bayer [Fri, 25 Aug 2017 21:33:32 +0000 (17:33 -0400)] 
Merge "Don't do recovery operations under Empty/AttributeError"

8 years agoApply percent sign escaping to literal binds, comments
Mike Bayer [Fri, 25 Aug 2017 19:26:02 +0000 (15:26 -0400)] 
Apply percent sign escaping to literal binds, comments

Fixed bug in new percent-sign support (e.g. :ticket:`3740`) where a bound
parameter rendered with literal_binds would fail to escape percent-signs
for relevant dialects.  In addition, ensured new table / column comment
support feature also fully makes use of literal-rendered parameters so that
this percent sign support takes place with table / column comment DDL as
well, allowing percent sign support for the mysql / psycopg2 backends that
require escaping of percent signs.

Change-Id: Ia4136a300933e9bc6a01a7b9afd5c7b9a3fee4e3
Fixes: #4054
Fixes: #4052
8 years agoDon't do recovery operations under Empty/AttributeError
Mike Bayer [Fri, 14 Jul 2017 22:06:48 +0000 (18:06 -0400)] 
Don't do recovery operations under Empty/AttributeError

Made some adjustments to :class:`.Pool` and :class:`.Connection` such
that recovery logic is not run underneath exception catches for
``pool.Empty``, ``AttributeError``, since when the recovery operation
itself fails, Python 3 creates a misleading stack trace referring to the
``Empty`` / ``AttributeError`` as the cause, when in fact these exception
catches are part of control flow.

Change-Id: Id3ed9a8f96ce4ccb4009c94af30ddc2ddb9818b9
Fixes: #4028
8 years agoMerge "Allow for multiple FOLLOWING/PRECEDING in a window range"
mike bayer [Fri, 25 Aug 2017 19:29:25 +0000 (15:29 -0400)] 
Merge "Allow for multiple FOLLOWING/PRECEDING in a window range"

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

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

Change-Id: I7d3a6c641151bb49219104968d18dac2266f3db8
Fixes: #4053
8 years agoMerge "Ensure col is not None when retrieving quick populators"
mike bayer [Thu, 24 Aug 2017 15:00:50 +0000 (11:00 -0400)] 
Merge "Ensure col is not None when retrieving quick populators"

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

Change-Id: I16c9bceaf1ab68f72059b43bf01bb11f6395e6d5

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

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

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

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

Change-Id: I0f48766f12f7299f4626ff41a00bf1f5bfca5f3b
Fixes: #4048
8 years agoHandle cache key for option that has no strategy
Mike Bayer [Tue, 22 Aug 2017 22:35:09 +0000 (18:35 -0400)] 
Handle cache key for option that has no strategy

Fixed regression where the use of a :func:`.undefer_group` option
in conjunction with a lazy loaded relationship option would cause
an attribute error, due to a bug in the SQL cache key generation
added in 1.2 as part of :ticket:`3954`.

Change-Id: Icd9a34f0b5aa96d6433a2ab9c8d3eaee0006f609
Fixes: #4049
8 years ago- fix typos
Mike Bayer [Tue, 22 Aug 2017 22:15:59 +0000 (18:15 -0400)] 
- fix typos

Change-Id: Ibf8bc0e997ff989c7b0c16afad48a95414078052

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

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

8 years agoDeactivate transaction if rollback fails
Mike Bayer [Mon, 21 Aug 2017 18:21:50 +0000 (14:21 -0400)] 
Deactivate transaction if rollback fails

Fixed regression introduced in 1.2.0b1 due to :ticket:`3934` where the
:class:`.Session` would fail to "deactivate" the transaction, if a
rollback failed (the target issue is when MySQL loses track of a SAVEPOINT).
This would cause a subsequent call to :meth:`.Session.rollback` to raise
an error a second time, rather than completing and bringing the
:class:`.Session` back to ACTIVE.

Fixes: #4050
Change-Id: Id245e8dd3487cb006b2d6631c8bd513b5ce81abe

8 years ago- ensure identifier re-use doesn't make this break
Mike Bayer [Tue, 22 Aug 2017 17:55:49 +0000 (13:55 -0400)] 
- ensure identifier re-use doesn't make this break

Change-Id: I9fe6c42c097d31b50a479250d39a3cd8ebcbffaf

8 years ago- allow a separate template database to be used for
Mike Bayer [Tue, 22 Aug 2017 17:12:43 +0000 (13:12 -0400)] 
- allow a separate template database to be used for
PG CREATE DATABASE.  as nobody will connect to it that would
solve the contention issue here

Change-Id: I00a4d52091876e120faff4a8a5493c53280d96f1

8 years ago- repair --dbs
Mike Bayer [Tue, 22 Aug 2017 17:07:24 +0000 (13:07 -0400)] 
- repair --dbs

Change-Id: I69e39d2368f50b126c369ecc35e01799fd013254
(cherry picked from commit 3fc6f32ddc5fbbf439acff42c2fdae9e910154be)

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

8 years ago- add missing changelog file for #4045
Mike Bayer [Tue, 22 Aug 2017 02:14:19 +0000 (22:14 -0400)] 
- add missing changelog file for #4045

Change-Id: I649cef3f4d91dec79dbd425a7dc5aad35abe87e5

8 years ago- simplify and see if it still works
Mike Bayer [Tue, 22 Aug 2017 02:12:30 +0000 (22:12 -0400)] 
- simplify and see if it still works

Change-Id: Id0cf7ae2223507d413aaa22e5f8df066b7ac2b46

8 years ago- keep trying to get PG dbs to build
Mike Bayer [Mon, 21 Aug 2017 23:00:25 +0000 (19:00 -0400)] 
- keep trying to get PG dbs to build

Change-Id: Ib36949da8f079594494a482423d96e7509673481

8 years ago- add missing quotes
Mike Bayer [Mon, 21 Aug 2017 22:19:02 +0000 (18:19 -0400)] 
- add missing quotes

Change-Id: Ib6efc465cccd7c7661dd089856edfd4979b53517

8 years ago- try to get PG database create to be more reliable
Mike Bayer [Mon, 21 Aug 2017 21:55:26 +0000 (17:55 -0400)] 
- try to get PG database create to be more reliable

Change-Id: I9c9d101547f4484af447db924dc06afd0392a03e

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

Change-Id: I42821d8324208b708adc17a10b1a2758797cb9db

8 years agoMerge branch 'fixtypo' of https://github.com/hsmtkk/sqlalchemy
Mike Bayer [Mon, 21 Aug 2017 20:28:12 +0000 (16:28 -0400)] 
Merge branch 'fixtypo' of https://github.com/hsmtkk/sqlalchemy

8 years ago- filter out non-oracle URLs
Mike Bayer [Mon, 21 Aug 2017 16:08:01 +0000 (12:08 -0400)] 
- filter out non-oracle URLs

Change-Id: I475f744f8801bc923d738e466d208d662e707413

8 years ago- this test doesn't work in strict mode, not that important
Mike Bayer [Mon, 21 Aug 2017 03:11:57 +0000 (23:11 -0400)] 
- this test doesn't work in strict mode, not that important

Change-Id: I3ed361af5c9f0c7acbeb8b534966828949f4958b

8 years ago- a few mysql fixes, more to come
Mike Bayer [Sun, 20 Aug 2017 22:57:05 +0000 (18:57 -0400)] 
- a few mysql fixes, more to come

Change-Id: Icdcc8ed03374251b8d3815ae58e2726ea27c14b4

8 years ago- rework oracle de-provisioning to write URLs to the file as well,
Mike Bayer [Sun, 20 Aug 2017 22:21:34 +0000 (18:21 -0400)] 
- rework oracle de-provisioning to write URLs to the file as well,
supporting custom dburi etc.

Change-Id: Ic0ab0b3b4223e40fd335ee3313fda4dfce942100

8 years ago- add some logging for the provisioning
Mike Bayer [Sun, 20 Aug 2017 02:45:31 +0000 (22:45 -0400)] 
- add some logging for the provisioning

Change-Id: I1ac16bc77642f4f576195ac10443ed8e641e0d49

8 years ago- dont run sql mode config tests if we aren't on mysql
Mike Bayer [Sat, 19 Aug 2017 22:20:48 +0000 (18:20 -0400)] 
- dont run sql mode config tests if we aren't on mysql

Change-Id: Ia5a491ec505afed1511a17a167cd1f7d8371acd4

8 years ago- do ten attempts to create database
Mike Bayer [Sat, 19 Aug 2017 22:06:02 +0000 (18:06 -0400)] 
- do ten attempts to create database

Change-Id: I14a5dd920d14096aa4401cb8b9d71f47d3915879

8 years agoMerge "First level repair for cx_Oracle 6.0 test regressions"
mike bayer [Sat, 19 Aug 2017 22:04:51 +0000 (18:04 -0400)] 
Merge "First level repair for cx_Oracle 6.0 test regressions"

8 years ago- correct server side cursor assertion for driver names
Mike Bayer [Sat, 19 Aug 2017 21:30:06 +0000 (17:30 -0400)] 
- correct server side cursor assertion for driver names

Change-Id: Id8156f6af15a36f7d5653dff56f68e81431692a6

8 years ago- name these TOX_ so that we can set them unconditionally
Mike Bayer [Sat, 19 Aug 2017 20:59:29 +0000 (16:59 -0400)] 
- name these TOX_ so that we can set them unconditionally
without them getting used unless we ask for them in the
build

Change-Id: Iec157ce9e70366af275acac959527461faebfdc1

8 years ago- rework the unittests README which was very out of date
Mike Bayer [Sat, 19 Aug 2017 18:06:14 +0000 (14:06 -0400)] 
- rework the unittests README which was very out of date

Change-Id: Id9bda43ea493a8d493be5ecb19da16a91a298f9d

8 years agoFirst level repair for cx_Oracle 6.0 test regressions
Mike Bayer [Fri, 18 Aug 2017 17:04:14 +0000 (13:04 -0400)] 
First level repair for cx_Oracle 6.0 test regressions

Fixed more regressions caused by cx_Oracle 6.0; at the moment, the only
behavioral change for users is disconnect detection now detects for
cx_Oracle.DatabaseError in addition to cx_Oracle.InterfaceError, as
this behavior seems to have changed.   Other issues regarding numeric
precision and uncloseable connections are pending with the upstream
cx_Oracle issue tracker.

Change-Id: Id61f1e33b21c155a598396340dfdecd28ff4066b
Fixes: #4045
8 years ago- convert to spaces
Mike Bayer [Thu, 17 Aug 2017 17:37:53 +0000 (13:37 -0400)] 
- convert to spaces

Change-Id: Ic5eb90049358935995721765b2239cf91144895a

8 years agoMerge "Enable uuid for pg8000"
mike bayer [Thu, 17 Aug 2017 13:14:07 +0000 (09:14 -0400)] 
Merge "Enable uuid for pg8000"

8 years agofix a typo
hsmtkk [Wed, 16 Aug 2017 09:38:40 +0000 (18:38 +0900)] 
fix a typo

8 years agoMerge "Ensure Oracle index w/ col DESC etc. is reflected"
mike bayer [Mon, 14 Aug 2017 17:54:12 +0000 (13:54 -0400)] 
Merge "Ensure Oracle index w/ col DESC etc. is reflected"

8 years agoIsolate memory tests in forks
Mike Bayer [Mon, 14 Aug 2017 16:04:26 +0000 (12:04 -0400)] 
Isolate memory tests in forks

Swing the biggest hammer, run multiprocessing.Process() for
each memusage test individually so that they are fully isolated
from the parent process and any side effects of pytest-xdist

Also add --nomemory as a shortcut to exclude_tags=memory-intensive
and add this to the setup.py test runner as the memory tests
should not be running for quick runs

Change-Id: I3c16c781e21b33deb939a64e77a6e0e41fb86922

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

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

Change-Id: Ica15a97408b9e0749a78c87f62749c15c1627009

8 years agoEnsure Oracle index w/ col DESC etc. is reflected
Mike Bayer [Fri, 11 Aug 2017 19:52:28 +0000 (15:52 -0400)] 
Ensure Oracle index w/ col DESC etc. is reflected

Fixed bug where an index reflected under Oracle with an expression like
"column DESC" would not be returned, if the table also had no primary
key, as a result of logic that attempts to filter out the
index implicitly added by Oracle onto the primary key columns.

Reworked the "filter out the primary key index" logic in oracle
get_indexes() to be clearer.

This changeset also adds an internal check to ColumnCollection
to accomodate for the case of a column being added twice,
as well as adding a private _table argument to Index such that
reflection can specify the Table explicitly.  The _table
argument can become part of public API in a later revision
or release if needed.

Change-Id: I745711e03b3e450b7f31185fc70e10d3823063fa
Fixes: #4042
8 years ago- since we can't isolate the memory tests to run withtout pytest-xdist,
Mike Bayer [Mon, 14 Aug 2017 05:15:22 +0000 (01:15 -0400)] 
- since we can't isolate the memory tests to run withtout pytest-xdist,
add a new tag nomemory so we can at least limit on the build

Change-Id: I3935cf15047d77fc09f8ee229914e37e064e5b8b

8 years ago- try adding the prints back in and re-test
Mike Bayer [Fri, 11 Aug 2017 13:54:16 +0000 (09:54 -0400)] 
- try adding the prints back in and re-test

Change-Id: I3a82b06ecc3c065240cc05871dee2881f20e414e

8 years ago- take more print statements out, maybe this is not
Mike Bayer [Thu, 10 Aug 2017 19:44:54 +0000 (15:44 -0400)] 
- take more print statements out, maybe this is not
the issue
- unblock pytest-xdist now that the upstream issue is fixed,
maybe this old version is the issue

Change-Id: I28dd7ae0872948a188651d42e2f4af60bcbafe81

8 years agoMerge branch 'master--typos' of https://github.com/nphilipp/sqlalchemy
Mike Bayer [Wed, 9 Aug 2017 13:32:51 +0000 (09:32 -0400)] 
Merge branch 'master--typos' of https://github.com/nphilipp/sqlalchemy

8 years agoEnable uuid for pg8000
Mike Bayer [Tue, 8 Aug 2017 16:56:43 +0000 (12:56 -0400)] 
Enable uuid for pg8000

Enabled UUID support for the pg8000 driver, which supports native Python
uuid round trips for this datatype.  Arrays of UUID are still not supported,
however.

Change-Id: I44ca323c5d9f2cd87327210233bc36a3556eb050
Fixes: #4016
8 years agoAdd quoted_name to pg8000 py_types
Mike Bayer [Tue, 8 Aug 2017 17:30:49 +0000 (13:30 -0400)] 
Add quoted_name to pg8000 py_types

Fixed bug where the pg8000 driver would fail if using
:meth:`.MetaData.reflect` with a schema name, since the schema name would
be sent as a "quoted_name" object that's a string subclass, which pg8000
doesn't recognize.   The quoted_name type is added to pg8000's
py_types collection on connect.

Change-Id: Id0f838320cb66563685e094e4eae2d5116100d27
Fixes: #4041
8 years ago- dont print samples, this appears like it may be
Mike Bayer [Tue, 8 Aug 2017 21:24:23 +0000 (17:24 -0400)] 
- dont print samples, this appears like it may be
itself causing the memory leak in conjunction with pytest-xdist

Change-Id: Ia8704e54186e6dd60ea0e32a246fcf1419686663

8 years ago- allow the shrink phase for memusage to go until zeroed,
Mike Bayer [Tue, 8 Aug 2017 18:02:16 +0000 (14:02 -0400)] 
- allow the shrink phase for memusage to go until zeroed,
some MySQL-env element is causing memory growth that goes very
far before stopping

Change-Id: Ic0882dd78636067980fceba4e3a969de78d5b26a

8 years agoEnable multi-level selectin polymorphic loading
Mike Bayer [Thu, 13 Jul 2017 22:32:42 +0000 (18:32 -0400)] 
Enable multi-level selectin polymorphic loading

Change-Id: Icc742bbeecdb7448ce84caccd63e086af16e81c1
Fixes: #4026