Mike Bayer [Mon, 16 Dec 2013 20:25:48 +0000 (15:25 -0500)]
- Fixed bug when using joined table inheritance from a table to a
select/alias on the base, where the PK columns were also not same
named; the persistence system would fail to copy primary key values
from the base table to the inherited table upon INSERT.
[ticket:2885]
Mike Bayer [Thu, 12 Dec 2013 18:30:16 +0000 (13:30 -0500)]
- :func:`.composite` will raise an informative error message when the
columns/attribute (names) passed don't resolve to a Column or mapped
attribute (such as an erroneous tuple); previously raised an unbound
local. [ticket:2889]
Mike Bayer [Thu, 12 Dec 2013 17:49:57 +0000 (12:49 -0500)]
- Error message when a string arg sent to :func:`.relationship` which
doesn't resolve to a class or mapper has been corrected to work
the same way as when a non-string arg is received, which indicates
the name of the relationship which had the configurational error.
[ticket:2888]
Mike Bayer [Sat, 7 Dec 2013 22:20:05 +0000 (17:20 -0500)]
- A DBAPI that raises an error on ``connect()`` which is not a subclass
of dbapi.Error (such as ``TypeError``, ``NotImplementedError``, etc.)
will propagate the exception unchanged. Previously,
the error handling specific to the ``connect()`` routine would both
inappropriately run the exception through the dialect's
:meth:`.Dialect.is_disconnect` routine as well as wrap it in
a :class:`sqlalchemy.exc.DBAPIError`. It is now propagated unchanged
in the same way as occurs within the execute process. [ticket:2881]
- add tests for this in test_parseconnect, but also add tests in test_execute
to ensure the execute() behavior as well
Mike Bayer [Sat, 7 Dec 2013 00:57:19 +0000 (19:57 -0500)]
- The :class:`.QueuePool` has been enhanced to not block new connection
attempts when an existing connection attempt is blocking. Previously,
the production of new connections was serialized within the block
that monitored overflow; the overflow counter is now altered within
it's own critical section outside of the connection process itself.
[ticket:2880]
Mike Bayer [Fri, 6 Dec 2013 20:53:59 +0000 (15:53 -0500)]
- Made a slight adjustment to the logic which waits for a pooled
connection to be available, such that for a connection pool
with no timeout specified, it will every half a second break out of
the wait to check for the so-called "abort" flag, which allows the
waiter to break out in case the whole connection pool was dumped;
normally the waiter should break out due to a notify_all() but it's
possible this notify_all() is missed in very slim cases.
This is an extension of logic first introduced in 0.8.0, and the
issue has only been observed occasionally in stress tests.
Roman Podolyaka [Sun, 9 Jun 2013 16:07:00 +0000 (19:07 +0300)]
- backport unique constraints reflection to 0.8.4, thereby
assisting with alembic installations that have upgraded and are dealing with
PG index/unique constraint reflection.
Inspection API already supports reflection of table
indexes information and those also include unique
constraints (at least for PostgreSQL and MySQL).
But it could be actually useful to distinguish between
indexes and plain unique constraints (though both are
implemented in the same way internally in RDBMS).
This change adds a new method to Inspection API - get_unique_constraints()
and implements it for SQLite, PostgreSQL and MySQL dialects.
Mike Bayer [Sat, 30 Nov 2013 22:31:00 +0000 (17:31 -0500)]
- the pronoun removal commit. there was only one instance of a
standalone gendered pronoun with a gender-neutral subject, but also
have replaced all occurences of "his/her", "his or her", etc. The docs have always
strived to account for both genders in any non-specific singular pronoun,
however recent controversy in the community suggests
that a zero-gendered-pronoun policy is probably best going forward.
Mike Bayer [Fri, 22 Nov 2013 23:35:36 +0000 (18:35 -0500)]
- Fixed bug where SQL statement would be improperly ASCII-encoded
when a pre-DBAPI :class:`.StatementError` were raised within
:meth:`.Connection.execute`, causing encoding errors for
non-ASCII statements. The stringification now remains within
Python unicode thus avoiding encoding errors. [ticket:2871]
Mike Bayer [Fri, 22 Nov 2013 22:56:35 +0000 (17:56 -0500)]
Fixed bug where Oracle ``VARCHAR`` types given with no length
(e.g. for a ``CAST`` or similar) would incorrectly render ``None CHAR``
or similar. [ticket:2870]
Mike Bayer [Thu, 21 Nov 2013 18:30:32 +0000 (13:30 -0500)]
- Fixed bug which prevented the ``serializer`` extension from working
correctly with table or column names that contain non-ASCII
characters. [ticket:2869]
Mike Bayer [Thu, 31 Oct 2013 19:29:45 +0000 (15:29 -0400)]
- add a section re: using column_reflect for mapping, link to it from the "naming columns distinctly" and "column_prefix" sections since this is often what ppl are looking for. [ticket:2856] is related.
Mike Bayer [Wed, 30 Oct 2013 14:34:31 +0000 (10:34 -0400)]
- Fixed a regression introduced by :ticket:`2818` where the EXISTS
query being generated would produce a "columns being replaced"
warning for a statement with two same-named columns,
as the internal SELECT wouldn't have use_labels set.
Mike Bayer [Sun, 27 Oct 2013 22:14:44 +0000 (18:14 -0400)]
- Fixed bug where index reflection would mis-interpret indkey values
when using the pypostgresql adapter, which returns these values
as lists vs. psycopg2's return type of string.
[ticket:2855]
Mike Bayer [Fri, 25 Oct 2013 23:11:53 +0000 (19:11 -0400)]
- Fixed bug where Oracle table reflection using synonyms would fail
if the synonym and the table were in different remote schemas.
Patch to fix courtesy Kyle Derr. [ticket:2853]
Mike Bayer [Sun, 20 Oct 2013 20:25:46 +0000 (16:25 -0400)]
- add a type_coerce() step within Enum, Boolean to the CHECK constraint,
so that the custom type isn't exposed to an operation that is against the
"impl" type's constraint, [ticket:2842]
- this change showed up as some recursion overflow in pickling with labels,
add a __reduce__() there....pickling of expressions is less and less something
that's very viable...
Mike Bayer [Fri, 18 Oct 2013 23:00:05 +0000 (19:00 -0400)]
- Removed a 128-character truncation from the reflection of the
server default for a column; this code was original from
PG system views which truncated the string for readability.
[ticket:2844]
Mike Bayer [Fri, 18 Oct 2013 19:00:42 +0000 (15:00 -0400)]
- The change in :ticket:`2721`, which is that the ``deferrable`` keyword
of :class:`.ForeignKeyConstraint` is silently ignored on the MySQL
backend, will be reverted as of 0.9; this keyword will now render again, raising
errors on MySQL as it is not understood - the same behavior will also
apply to the ``initially`` keyword. In 0.8, the keywords will remain
ignored but a warning is emitted. Additionally, the ``match`` keyword
now raises a :class:`.CompileError` on 0.9 and emits a warning on 0.8;
this keyword is not only silently ignored by MySQL but also breaks
the ON UPDATE/ON DELETE options.
To use a :class:`.ForeignKeyConstraint`
that does not render or renders differently on MySQL, use a custom
compilation option. An example of this usage has been added to the
documentation, see :ref:`mysql_foreign_keys`.
[ticket:2721] [ticket:2839]
Mike Bayer [Mon, 14 Oct 2013 18:53:28 +0000 (14:53 -0400)]
The ``.unique`` flag on :class:`.Index` could be produced as ``None``
if it was generated from a :class:`.Column` that didn't specify ``unique``
(where it defaults to ``None``). The flag will now always be ``True`` or
``False``. [ticket:2825]
Mike Bayer [Sun, 13 Oct 2013 20:54:21 +0000 (16:54 -0400)]
- Added new option to :func:`.relationship` ``distinct_target_key``.
This enables the subquery eager loader strategy to apply a DISTINCT
to the innermost SELECT subquery, to assist in the case where
duplicate rows are generated by the innermost query which corresponds
to this relationship (there's not yet a general solution to the issue
of dupe rows within subquery eager loading, however, when joins outside
of the innermost subquery produce dupes). When the flag
is set to ``True``, the DISTINCT is rendered unconditionally, and when
it is set to ``None``, DISTINCT is rendered if the innermost relationship
targets columns that do not comprise a full primary key.
The option defaults to False in 0.8 (e.g. off by default in all cases),
None in 0.9 (e.g. automatic by default). Thanks to Alexander Koval
for help with this. [ticket:2836]
Mike Bayer [Sun, 13 Oct 2013 18:09:35 +0000 (14:09 -0400)]
MySQL-connector dialect now allows options in the create_engine
query string to override those defaults set up in the connect,
including "buffered" and "raise_on_warnings".
[ticket:2515]
Mike Bayer [Sun, 13 Oct 2013 00:04:55 +0000 (20:04 -0400)]
- Fixed bug in default compiler plus those of postgresql, mysql, and
mssql to ensure that any literal SQL expression values are
rendered directly as literals, instead of as bound parameters,
within a CREATE INDEX statement. [ticket:2742]
- don't need expression_as_ddl(); literal_binds and include_table
take care of this functionality.
Mike Bayer [Wed, 9 Oct 2013 00:06:58 +0000 (20:06 -0400)]
A :func:`.select` that is made to refer to itself in its FROM clause,
typically via in-place mutation, will raise an informative error
message rather than causing a recursion overflow.
[ticket:2815]
Mike Bayer [Tue, 8 Oct 2013 23:47:13 +0000 (19:47 -0400)]
Fixed bug where using an annotation such as :func:`.remote` or
:func:`.foreign` on a :class:`.Column` before association with a parent
:class:`.Table` could produce issues related to the parent table not
rendering within joins, due to the inherent copy operation performed
by an annotation. [ticket:2813]
Mike Bayer [Wed, 28 Aug 2013 21:25:44 +0000 (17:25 -0400)]
Fixed bug where using the ``column_reflect`` event to change the ``.key``
of the incoming :class:`.Column` would prevent primary key constraints,
indexes, and foreign key constraints from being correctly reflected.
Also in 0.8.3. [ticket:2811]