Mike Bayer [Fri, 18 Jul 2014 18:27:59 +0000 (14:27 -0400)]
- Fixed bug in oracle dialect test suite where in one test,
'username' was assumed to be in the database URL, even though
this might not be the case. Fixes #3128
Mike Bayer [Tue, 15 Jul 2014 17:20:55 +0000 (13:20 -0400)]
- Fixed a regression caused by :ticket:`2976` released in 0.9.4 where
the "outer join" propagation along a chain of joined eager loads
would incorrectly convert an "inner join" along a sibling join path
into an outer join as well, when only descendant paths should be
receiving the "outer join" propagation; additionally, fixed related
issue where "nested" join propagation would take place inappropriately
between two sibling join paths.
this is accomplished by re-introducing the removed flag "allow_innerjoin",
now inverted and named "chained_from_outerjoin". Propagating this flag
allows us to know when we have encountered an outerjoin along a load
path, without confusing it for state obtained from a sibling path.
Mike Bayer [Tue, 15 Jul 2014 16:25:38 +0000 (12:25 -0400)]
- Fixed a SQLite join rewriting issue where a subquery that is embedded
as a scalar subquery such as within an IN would receive inappropriate
substitutions from the enclosing query, if the same table were present
inside the subquery as were in the enclosing query such as in a
joined inheritance scenario.
fixes #3130
Mike Bayer [Tue, 15 Jul 2014 01:11:16 +0000 (21:11 -0400)]
- allow the compilation rule that gets the formatted name
to again have the chance to veto rendering, as the naming convention
can make the decision that the name is "none" or not now.
Mike Bayer [Tue, 15 Jul 2014 00:26:38 +0000 (20:26 -0400)]
- Fix bug in naming convention feature where using a check
constraint convention that includes ``constraint_name`` would
then force all :class:`.Boolean` and :class:`.Enum` types to
require names as well, as these implicitly create a
constraint, even if the ultimate target backend were one that does
not require generation of the constraint such as Postgresql.
The mechanics of naming conventions for these particular
constraints has been reorganized such that the naming
determination is done at DDL compile time, rather than at
constraint/table construction time.
fixes #3067
Mike Bayer [Mon, 14 Jul 2014 23:16:11 +0000 (19:16 -0400)]
- Fixed a regression from 0.9.5 caused by :ticket:`3025` where the
query used to determine "default schema" is invalid in SQL Server 2000.
For SQL Server 2000 we go back to defaulting to the "schema name"
parameter of the dialect, which is configurable but defaults
to 'dbo'. fixes #3025
Mike Bayer [Mon, 14 Jul 2014 23:02:20 +0000 (19:02 -0400)]
- Added statement encoding to the "SET IDENTITY_INSERT"
statements which operate when an explicit INSERT is being
interjected into an IDENTITY column, to support non-ascii table
identifiers on drivers such as pyodbc + unix + py2k that don't
support unicode statements.
ref #3091 as this fix is also in that issue's patch, but is
a different issue.
Mike Bayer [Mon, 14 Jul 2014 22:54:23 +0000 (18:54 -0400)]
- In the SQL Server pyodbc dialect, repaired the implementation
for the ``description_encoding`` dialect parameter, which when
not explicitly set was preventing cursor.description from
being parsed correctly in the case of result sets that
contained names in alternate encodings. This parameter
shouldn't be needed going forward.
fixes #3091
Mike Bayer [Mon, 14 Jul 2014 22:49:06 +0000 (18:49 -0400)]
- Fixed a regression from 0.9.0 due to :ticket:`2736` where the
:meth:`.Query.select_from` method no longer set up the "from
entity" of the :class:`.Query` object correctly, so that
subsequent :meth:`.Query.filter_by` or :meth:`.Query.join`
calls would fail to check the appropriate "from" entity when
searching for attributes by string name.
fixes #3083
Mike Bayer [Mon, 14 Jul 2014 22:34:32 +0000 (18:34 -0400)]
-Fixed bug in common table expressions whereby positional bound
parameters could be expressed in the wrong final order
when CTEs were nested in certain ways.
fixes #3090
Mike Bayer [Mon, 14 Jul 2014 22:28:07 +0000 (18:28 -0400)]
- Fixed bug where multi-valued :class:`.Insert` construct would fail
to check subsequent values entries beyond the first one given
for literal SQL expressions.
fixes #3069
Mike Bayer [Mon, 14 Jul 2014 22:09:54 +0000 (18:09 -0400)]
- Added a "str()" step to the dialect_kwargs iteration for
Python version < 2.6.5, working around the
"no unicode keyword arg" bug as these args are passed along as
keyword args within some reflection processes.
fixes #3123
Mike Bayer [Sun, 13 Jul 2014 22:55:18 +0000 (18:55 -0400)]
- Fixed bug in :class:`.Enum` and other :class:`.SchemaType`
subclasses where direct association of the type with a
:class:`.MetaData` would lead to a hang when events
(like create events) were emitted on the :class:`.MetaData`.
fixes #3124
Mike Bayer [Thu, 10 Jul 2014 15:26:13 +0000 (11:26 -0400)]
- The :meth:`.TypeEngine.with_variant` method will now accept a
type class as an argument which is internally converted to an
instance, using the same convention long established by other
constructs such as :class:`.Column`. fixes #3122
Mike Bayer [Wed, 9 Jul 2014 20:04:07 +0000 (16:04 -0400)]
- Changed the default value of "raise_on_warnings" to False for
MySQLconnector. This was set at True for some reason. The "buffered"
flag unfortunately must stay at True as MySQLconnector does not allow
a cursor to be closed unless all results are fully fetched. fixes #2515
- lots of MySQL tests seemed to not be hitting all backends, so we should
be getting some mysqlconnector failures now
Mike Bayer [Tue, 8 Jul 2014 23:08:42 +0000 (19:08 -0400)]
- The "evaulator" for query.update()/delete() won't work with multi-table
updates, and needs to be set to `synchronize_session=False` or
`synchronize_session='fetch'`; this now raises an exception, with a
message to change the synchronize setting. This will be only a warning
in 0.9.7. fixes #3117
Mike Bayer [Fri, 4 Jul 2014 19:40:47 +0000 (15:40 -0400)]
- rework the entire approach to #3076. As we need to catch all exceptions
in all cases unconditionally, the number of use cases that go beyond what
dbapi_error() is expecting has gone too far for an 0.9 release.
Additionally, the number of things we'd like to track is really a lot
more than the five arguments here, and ExecutionContext is really not
suitable as totally public API for this. So restore dbapi_error
to its old version, deprecate, and build out handle_error instead.
This is a lot more extensible and doesn't get in the way of anything
compatibility-wise.
Mike Bayer [Fri, 4 Jul 2014 01:49:10 +0000 (21:49 -0400)]
- Added new attributes :attr:`.ExecutionContext.exception` and
:attr:`.ExecutionContext.is_disconnect` which are meaningful within
the :meth:`.ConnectionEvents.dbapi_error` handler to see both the
original DBAPI error as well as whether or not it represents
a disconnect.
Mike Bayer [Thu, 3 Jul 2014 21:30:49 +0000 (17:30 -0400)]
- The mechanics of the :meth:`.ConnectionEvents.dbapi_error` handler
have been enhanced such that the function handler is now capable
of raising or returning a new exception object, which will replace
the exception normally being thrown by SQLAlchemy.
fixes #3076
Mike Bayer [Tue, 1 Jul 2014 16:12:27 +0000 (12:12 -0400)]
- Fixed bug where items that were persisted, deleted, or had a
primary key change within a savepoint block would not
participate in being restored to their former state (not in
session, in session, previous PK) after the outer transaction
were rolled back. fixes #3108
Mike Bayer [Tue, 1 Jul 2014 00:25:04 +0000 (20:25 -0400)]
- repair the _enable_single_crit method, it was named the same
as the attribute and probably just replaced itself, so that is
now _set_enable_single_crit
- as a side effect of the main issue fixed here, correct the case in
adjust_for_single_inheritance where the same mapper appears more
than once in mapper_adapter_map; run through a set() for uniqueness.
- Fixed bug in subquery eager loading in conjunction with
:func:`.with_polymorphic`, the targeting of entities and columns
in the subquery load has been made more accurate with respect
to this type of entity and others. Fixes #3106
Mike Bayer [Sun, 29 Jun 2014 04:10:59 +0000 (00:10 -0400)]
- attach the ResultMetaData to the Compiled object, when we detect that
the compiled cache is used. That allows us to cache the whole metadata
and save on creating it at result time, when compiled cache is used.
Mike Bayer [Fri, 27 Jun 2014 20:08:42 +0000 (16:08 -0400)]
- Fixed a bug within the custom operator plus :meth:`.TypeEngine.with_variant`
system, whereby using a :class:`.TypeDecorator` in conjunction with
variant would fail with an MRO error when a comparison operator was used.
fixes #3102
Mike Bayer [Fri, 27 Jun 2014 19:52:40 +0000 (15:52 -0400)]
- MySQL error 2014 "commands out of sync" appears to be raised as a
ProgrammingError, not OperationalError, in modern MySQL-Python versions;
all MySQL error codes that are tested for "is disconnect" are now
checked within OperationalError and ProgrammingError regardless.
fixes #3101
Mike Bayer [Thu, 26 Jun 2014 18:58:42 +0000 (14:58 -0400)]
- Fixed bug involving dynamic attributes, that was again a regression
of :ticket:`3060` from verision 0.9.5. A self-referential relationship
with lazy='dynamic' would raise a TypeError within a flush operation.
fixes #3099
Mike Bayer [Wed, 25 Jun 2014 18:30:25 +0000 (14:30 -0400)]
- Fixed bug when the declarative ``__abstract__`` flag was not being
distinguished for when it was actually the value ``False``.
The ``__abstract__`` flag needs to acutally evaluate to a True
value at the level being tested.
fixes #3097
Damian Dimmich [Tue, 24 Jun 2014 07:23:21 +0000 (11:23 +0400)]
initial support for JSONB - this only allows you to define the JSONB
datatype - this does not add any of the additional support for
querying/indexing yet.
Mike Bayer [Mon, 23 Jun 2014 23:50:23 +0000 (19:50 -0400)]
- reverse course in #3061 so that we instead no longer set None in the attribute
when we do a get; we return the None as always but we leave the dict blank
and the loader callable still in place. The case for this implicit get on a pending object is not
super common and there really should be no change in state at all when this
operation proceeds. This change is more dramatic as it reverses
a behavior SQLA has had since the first release.
fixes #3061
Mike Bayer [Mon, 23 Jun 2014 22:38:23 +0000 (18:38 -0400)]
- Reverted the change for :ticket:`3060` - this is a unit of work
fix that is updated more comprehensively in 1.0 via :ticket:`3061`.
The fix in :ticket:`3060` unfortunately produces a new issue whereby
an eager load of a many-to-one attribute can produce an event
that is interpreted into an attribute change.
Tony Locke [Mon, 23 Jun 2014 19:45:16 +0000 (20:45 +0100)]
pg8000 passing test/sql/test_types.py
Opened up two tests that now pass with pg8000. Also, rewrote two tests
to use actual tables rather than having a round trip in a single select
statement. This is necessary for pg8000 because it sends strings to the
server with type 'unknown' and lets the server work out the type.
Mike Bayer [Fri, 20 Jun 2014 22:47:28 +0000 (18:47 -0400)]
- Additional checks have been added for the case where an inheriting
mapper is implicitly combining one of its column-based attributes
with that of the parent, where those columns normally don't necessarily
share the same value. This is an extension of an existing check that
was added via :ticket:`1892`; however this new check emits only a
warning, instead of an exception, to allow for applications that may
be relying upon the existing behavior.
fixes #3042