Commit Graph

2794 Commits

Author SHA1 Message Date
Mike Bayer eb859dcd2c Improve check for overlapping FK targets on sibling classes
Fixed bug where ORM relationship would warn against conflicting sync
targets (e.g. two relationships would both write to the same column) for
sibling classes in an inheritance hierarchy, where the two relationships
would never actually conflict during writes.

Change-Id: I9367a7978cadc59066e89fc4917d7eb6c78dedee
Fixes: #4078
(cherry picked from commit 8ba8dd23b7)
2017-10-03 14:42:49 -04:00
Mike Bayer 8948d961b2 Take schema name into account when querying sqlite_master
Fixed bug where SQLite CHECK constraint reflection would fail
if the referenced table were in a remote schema, e.g. on SQLite a
remote database referred to by ATTACH.

Also add suite support for general CHECK constraint reflection.

Change-Id: I073a72cb47dc4f8c5683000d708768523759332f
Fixes: #4099
(cherry picked from commit 68b52c48b7)
2017-09-29 18:45:36 -04:00
Mike Bayer 917a971764 Support mariadb 10.2
Fixed issue where CURRENT_TIMESTAMP would not reflect correctly
in the MariaDB 10.2 series due to a syntax change, where the function
is now represented as ``current_timestamp()``.

Fixes: #4096

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

Fixes: #4098

Change-Id: I8666d61814e8145ca12cbecad94019b44af868e3
(cherry picked from commit 29b752f8b2)
2017-09-29 13:21:16 -04:00
mike bayer eae1edc749 Merge "Add full list of pyodbc error codes for MSSQL" into rel_1_1 2017-09-28 12:07:29 -04:00
Mike Bayer 124c14c6e4 - add more dragons to session.begin() / autocommit docs
Change-Id: I9e326f353d396321565dfbf53b7a30f18d8c86e9
(cherry picked from commit 1ec7ba52e1)
2017-09-28 11:44:09 -04:00
Mike Bayer af70c3022f Add full list of pyodbc error codes for MSSQL
Moved the SQL server error codes out of connnectors/pyodbc.py
and into mssql/pyodbc.py.  Added complete list
of odbc-related disconnect codes.

Change-Id: Icd84a920dbfa1f188847f859654ff6f7a48170f1
Fixes: #4095
(cherry picked from commit 6a38697261)
2017-09-28 09:41:40 -04:00
mike bayer 171e6efd35 Merge "Support method form of any_(), all_()" into rel_1_1 2017-09-27 18:10:18 -04:00
Mike Bayer 3a8a8b9bc5 Support method form of any_(), all_()
Fixed bug where the recently added :meth:`.ColumnOperators.any_`
and :meth:`.ColumnOperators.all_` methods didn't work when called
as methods, as opposed to using the standalone functions
:func:`~.expression.any_` and :func:`~.expression.all_`.  Also
added documentation examples for these relatively unintuitive
SQL operators.

Change-Id: I3e56b463e9fd146a077b9970624f50cba27f9811
Fixes: #4093
(cherry picked from commit 944c662d8a)
2017-09-27 15:50:07 -04:00
mike bayer 0c608ebec6 Merge "Accomodate for multidimensional array in rewriting for COLLATE" into rel_1_1 2017-09-27 15:48:02 -04:00
Mike Bayer f66a3dfc9c Accomodate for multidimensional array in rewriting for COLLATE
Made further fixes to the :class:`.ARRAY` class in conjunction with
COLLATE, as the fix made in 🎫`4006` failed to accommodate
for a multidimentional array.

Change-Id: If3e438f8ce94ebae2196671c88a4914f3b743e60
Fixes: #4006
(cherry picked from commit 6652f72352)
2017-09-27 09:49:11 -04:00
Mike Bayer d1ca3a8d46 Document and test __table_cls__
A use case has been identified for __table_cls__, which was
added in 1.0 just for the purpose of test fixtures.   Add this to
public API and ensure the target use case (conditional table generation)
stays supported.

Change-Id: I87be5bcb72205cab89871fa586663bf147450995
Fixes: #4082
(cherry picked from commit 04bbad660b)
2017-09-26 11:39:08 -04:00
Mike Bayer a14e5c42ca use the stack to get the insert statement in on conflict
Fixed bug in Postgresql :meth:`.postgresql.dml.Insert.on_conflict_do_update`
which would prevent the insert statement from being used as a CTE,
e.g. via :meth:`.Insert.cte`, within another statement.

Change-Id: Ie20972a05e194290bc9d92819750845872949ecc
Fixes: #4074
(cherry picked from commit 7051653610)
2017-09-12 12:58:55 -04:00
Mike Bayer 21ca9b50c7 Version 1.1.15 placeholder
Change-Id: I81fd38694b19ee9dadaf89276dd4fe9bd6f67c94
2017-09-05 13:06:29 -04:00
Mike Bayer 4b22b01ade - 1.1.14 2017-09-05 10:26:00 -04:00
Mike Bayer 2cdb0777c2 - 1.1.14 placeholder
Change-Id: I1648f7780cc0accdfe7650a62754b39c8e5552a8
2017-09-05 09:56:17 -04:00
mike bayer ba9c238d7e Merge "Guard against KeyError in session.merge after check for identity" into rel_1_1 2017-09-05 09:46:05 -04:00
mike bayer 04958bb7d7 Merge "Check for non-mapped property in synonym" into rel_1_1 2017-09-05 09:43:52 -04:00
Mike Bayer 68953902dd Guard against KeyError in session.merge after check for identity
Fixed bug in :meth:`.Session.merge` following along similar lines as that
of 🎫`4030`, where an internal check for a target object in
the identity map could lead to an error if it were to be garbage collected
immediately before the merge routine actually retrieves the object.

Change-Id: Ifecfb8b9d50c52d0ebd5a03e1bd69fe3abf1dc40
Fixes: #4069
(cherry picked from commit bfad032017fde2e519ad5eacc0011a71bf7a22a9)
2017-09-04 19:36:51 -04:00
Mike Bayer 8ec1369eb3 Check for non-mapped property in synonym
An :class:`.InvalidRequestError` is raised when a :func:`.synonym`
is used against an attribute that is not against a :class:`.MapperProperty`,
such as an association proxy.  Previously, a recursion overflow would
occur trying to locate non-existent attributes.

Change-Id: If2ce38c429a69951df4c94b71b74edbd59d775e3
Fixes: #4067
(cherry picked from commit 130f31ca79)
2017-09-04 18:56:38 -04:00
Mike Bayer a3965ea5ff Always check that discarded state is the expected one
Fixed race condition in ORM identity map which would cause objects
to be inappropriately removed during a load operation, causing
duplicate object identities to occur, particularly under joined eager
loading which involves deduplication of objects.  The issue is specific
to garbage collection of weak references and is observed only under the
Pypy interpreter.

Change-Id: I9f6ae3fe5b078f26146af82b15d16f3a549a9032
Fixes: #4068
(cherry picked from commit 37c5ed2ed9)
2017-09-04 16:22:51 -04:00
Mike Bayer 4be865f79b Add InternalError for mysqlclient disconnect
mysqlclient as of 1.3.11 changed the exception
class for a particular disconnect situation from
InterfaceError to InternalError; the disconnection
detection logic now accommodates this.

Change-Id: I294f90f794491fd363548719222d8e3008480615
Fixes: #4065
(cherry picked from commit 65680b2343)
2017-09-01 12:32:44 -04:00
Mike Bayer 5dc3eed55e include a note about the importance of type coerce for custom ops
Change-Id: Ia7dab65523d6a34fcc92ee785ffe03f7e2a33cfd
(cherry picked from commit 56845d8cc2)
2017-09-01 10:52:47 -04:00
Mike Bayer 5243341ed8 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
2017-08-31 16:23:42 -04:00
Mike Bayer fb55270835 Allow for multiple FOLLOWING/PRECEDING in a window range
Altered the range specification for window functions to allow
for two of the same PRECEDING or FOLLOWING keywords in a range
by allowing for the left side of the range to be positive
and for the right to be negative, e.g. (1, 3) is
"1 FOLLOWING AND 3 FOLLOWING".

Change-Id: I7d3a6c641151bb49219104968d18dac2266f3db8
Fixes: #4053
(cherry picked from commit 3a5bbe4cbe)
2017-08-25 09:43:38 -04:00
Mike Bayer 3b5840f16a Ensure col is not None when retrieving quick populators
Fixed bug where an :func:`.undefer_group` option would not be recognized
if it extended from a relationship that was loading using joined eager
loading.

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

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

Change-Id: I0f48766f12f7299f4626ff41a00bf1f5bfca5f3b
Fixes: #4048
(cherry picked from commit eee9dfd4514801f0c67f71632fc722731171479b)
2017-08-24 09:41:12 -04:00
Mike Bayer 6a8955f32b - fix typos
Change-Id: Ibf8bc0e997ff989c7b0c16afad48a95414078052
(cherry picked from commit d8a80a35a0)
2017-08-22 18:16:08 -04:00
Mike Bayer b6412f6029 - modernize the mysql connection timeout docs
Change-Id: Icb0474509539c1eb7536544749f2a48b4972078a
(cherry picked from commit 4ce46fb0a085c1cc739e21881cc25567e663f8dc)
2017-08-22 16:50:33 -04:00
hsmtkk 320ba61529 fix a typo
(cherry picked from commit 58fb83c45b)
2017-08-21 16:28:29 -04:00
Nils Philippsen 13079eb1db fix "constrast" typos
(cherry picked from commit 7765724d51)
2017-08-09 09:33:07 -04:00
Mike Bayer 9b7b7923cf - modernize orm.reconstructor documentation a bit
Change-Id: Ied786e8f9ad78f524be03a382d002dada7dd218b
(cherry picked from commit 4b4f8fbf25)
2017-08-05 21:46:45 -04:00
Mike Bayer 2d24d9c4f1 - 1.1.13 2017-08-03 11:37:42 -04:00
Mike Bayer 90ef2c2314 - 1.0.19
Change-Id: I65ebe00fa7372151210a1f177f5417ac08c41586
2017-08-03 11:36:44 -04:00
Mike Bayer 5fc7056a53 - convert to spaces
- restore unreleased directories

Change-Id: Ia5c1142ffbdba6372f800c2e2521660ab62d9c4f
(cherry picked from commit a1160414b8)
2017-07-31 08:38:56 -04:00
Mike Bayer 9689bb85f1 Revert cx_Oracle WITH_UNICODE change under > 5.0
Fixed performance regression caused by the fix for 🎫`3937` where
cx_Oracle as of version 5.3 dropped the ``.UNICODE`` symbol from its
namespace,  which was interpreted as cx_Oracle's "WITH_UNICODE" mode being
turned on unconditionally, which invokes functions on the SQLAlchemy
side which convert all strings to unicode unconditionally and causing
a performance impact.  In fact, per cx_Oracle's author the
"WITH_UNICODE" mode has been removed entirely as of 5.1, so the expensive unicode
conversion functions are no longer necessary and are disabled if
cx_Oracle 5.1 or greater is detected under Python 2.  The warning against
"WITH_UNICODE" mode that was removed under 🎫`3937` is also restored.

Change-Id: Iddd38d81a5adb27c953a5ee2eae5529a21da16e1
Fixes: #4035
(cherry picked from commit 7997d7fdc3)
2017-07-28 17:42:22 -04:00
Mike Bayer f7beeb389d - 1.1.13
- 1.0.19

Change-Id: I476213fe905a51826feeddb4e1c97416c2bac558
2017-07-28 15:16:17 -04:00
Mike Bayer ad5626cdb9 - 1.1.12 2017-07-24 17:18:33 -04:00
Mike Bayer ac517ff58b - 1.0.18 release date
(cherry picked from commit f00391a070)

Change-Id: Ib9e96acddc871fddbb7eb94993f0994248f8a85d
2017-07-24 17:17:42 -04:00
mike bayer 68140a14ca Merge "Ensure we check for boolean condition when we inspect __exit__()" into rel_1_1 2017-07-24 16:55:00 -04:00
mike bayer 5470ad6dc6 Merge "Guard all indexed access in WeakInstanceDict" into rel_1_1 2017-07-24 14:50:11 -04:00
Feanil Patel 7993357532 Make flush logic slightly clearer in tutorial.
Improve the wording of how sessions commit changes.
(cherry picked from commit c9b37f9689)
2017-07-24 12:43:02 -04:00
Mike Bayer c4bd01a68b Ensure we check for boolean condition when we inspect __exit__()
Fixed issue in testing fixtures which was incompatible with a change
made as of Python 3.6.2 involving context managers.

Change-Id: I0f12aa6cc15cba89153f7e4888ac347e7ce599c7
Fixes: #4034
(cherry picked from commit 7d4005156b)
2017-07-24 12:33:48 -04:00
Mike Bayer 676c49b51d Guard all indexed access in WeakInstanceDict
Added ``KeyError`` checks to all methods within
:class:`.WeakInstanceDict` where a check for ``key in dict`` is
followed by indexed access to that key, to guard against a race against
garbage collection that under load can remove the key from the dict
after the code assumes its present, leading to very infrequent
``KeyError`` raises.

Change-Id: I881cc2899f7961d29a0549f44149a2615ae7a4ea
Fixes: #4030
(cherry picked from commit 1a75f676d75b5daf67455d6e85b7b4df6f2316dc)
2017-07-24 11:49:41 -04:00
Mike Bayer 3e794a199d - Merge directory holder README from 1.0.x and also 1.0's changelog
Change-Id: I588eebd027b4ad3428bd522f36a6f1cd77f105bb
(cherry picked from commit 39c72682b8)
2017-07-24 10:50:37 -04:00
Mike Bayer 620fff8e2c - move to file-per-changelog for unreleased change notes,
so that we no longer have to rely upon merges within
the changelog files.   because gerrit doesn't allow us
to use custom merge engines unlike git, we have no ability
to merge multiple changes into the changelog files without
going through conflicts.   new version of changelog
in git supports these new patterns.

Change-Id: I588eebd027b4ad3428bd522f36a6f1cd77f105bb
(cherry picked from commit 39c72682b8)
2017-07-22 16:34:55 -04:00
mike bayer 0753f3940c Merge "Check for column object in eval_none, not propkey" into rel_1_1 2017-07-19 16:22:10 -04:00
Mike Bayer db3c58f9ee Check for column object in eval_none, not propkey
Fixed bug involving JSON NULL evaluation logic added in 1.1 as part
of 🎫`3514` where the logic would not accommodate ORM
mapped attributes named differently from the :class:`.Column`
that was mapped.

Change-Id: I1848afcfb63ad7f074f315d8d3097666069b42be
Fixes: #4031
(cherry picked from commit e2ede596adff3ce584f8c43ba024cafabc509a06)
2017-07-18 15:04:55 -04:00
Mike Bayer 23565166f1 Check for non-entity when inspecting for subqueryload
Fixed issue where adding additional non-entity columns to
a query that includes an entity with subqueryload relationships
would fail, due to an inspection added in 1.1.11 as a result of
🎫`4011`.

Change-Id: I8ef082be649125bdc07b428cb9b0a77a65d73671
Fixes: #4033
(cherry picked from commit 3d41ea09a8)
2017-07-18 15:04:10 -04:00
Tom Sitter d7dd0e1e02 Replace Session class with session instance
The Session class was used instead of the session instance which resulted in an attribute error.
(cherry picked from commit 43f41fbfaa)
2017-07-17 10:31:45 -04:00
Pablo Marti 923f66f971 Fix typo, foriegn -> foreign
(cherry picked from commit c6b4675982)
2017-07-17 10:29:28 -04:00
Mike Bayer e66d0cd394 - remove intersphinx usage, the overhead of re-fetching
inventory on every build not worth it

Change-Id: I3c4506b246d0f327c4b56afa723975daee984476
(cherry picked from commit a66979fe1e)
2017-07-09 13:03:45 -04:00