Mike Bayer [Thu, 7 Aug 2014 14:43:55 +0000 (10:43 -0400)]
-Fixed bug where Postgresql JSON type was not able to persist or
otherwise render a SQL NULL column value, rather than a JSON-encoded
``'null'``. To support this case, changes are as follows:
* The value :func:`.null` can now be specified, which will always
result in a NULL value resulting in the statement.
* A new parameter :paramref:`.JSON.none_as_null` is added, which
when True indicates that the Python ``None`` value should be
peristed as SQL NULL, rather than JSON-encoded ``'null'``.
Retrival of NULL as None is also repaired for DBAPIs other than
psycopg2, namely pg8000.
Mike Bayer [Sat, 2 Aug 2014 18:42:57 +0000 (14:42 -0400)]
- Fixed bug in CTE where ``literal_binds`` compiler argument would not
be always be correctly propagated when one CTE referred to another
aliased CTE in a statement.
Fixes #3154
Mike Bayer [Tue, 29 Jul 2014 18:06:43 +0000 (14:06 -0400)]
- The exception wrapping system for DBAPI errors can now accommodate
non-standard DBAPI exceptions, such as the psycopg2
TransactionRollbackError. These exceptions will now be raised
using the closest available subclass in ``sqlalchemy.exc``, in the
case of TransactionRollbackError, ``sqlalchemy.exc.OperationalError``.
fixes #3075
Mike Bayer [Tue, 29 Jul 2014 17:32:05 +0000 (13:32 -0400)]
- Fixed 0.9.7 regression caused by :ticket:`3067` in conjunction with
a mis-named unit test such that so-called "schema" types like
:class:`.Boolean` and :class:`.Enum` could no longer be pickled.
fixes #3144
Mike Bayer [Fri, 25 Jul 2014 20:08:21 +0000 (16:08 -0400)]
- Fixed bug in :class:`.postgresql.array` object where comparison
to a plain Python list would fail to use the correct array constructor.
Pull request courtesy Andrew. fixes #3141
Mike Bayer [Fri, 25 Jul 2014 16:14:22 +0000 (12:14 -0400)]
- The MySQL dialect will now disable :meth:`.ConnectionEvents.handle_error`
events from firing for those statements which it uses internally
to detect if a table exists or not. This is achieved using an
execution option ``skip_user_error_events`` that disables the handle
error event for the scope of that execution. In this way, user code
that rewrites exceptions doesn't need to worry about the MySQL
dialect or other dialects that occasionally need to catch
SQLAlchemy specific exceptions.
Mike Bayer [Thu, 24 Jul 2014 18:33:50 +0000 (14:33 -0400)]
- Added a supported :meth:`.FunctionElement.alias` method to functions,
e.g. the ``func`` construct. Previously, behavior for this method
was undefined. The current behavior mimics that of pre-0.9.4,
which is that the function is turned into a single-column FROM
clause with the given alias name, where the column itself is
anonymously named.
fixes #3137
Andrew [Thu, 24 Jul 2014 05:56:50 +0000 (15:56 +1000)]
Fix argument to array() in array._bind_param()
array.__init__() expects a list as its sole parameter but inside _bind_param(), instead of sending a list it's sending each item in the list as a separate argument which is incorrect.
Mike Bayer [Mon, 21 Jul 2014 15:58:44 +0000 (11:58 -0400)]
- Fixed bug introduced in 0.9.5 by new pg8000 isolation level feature
where engine-level isolation level parameter would raise an error
on connect. fixes #3134
Tony Locke [Sat, 19 Jul 2014 14:26:43 +0000 (15:26 +0100)]
Remove requirement for manytomany_nonpassive
Removed the non_updating_cascade requirement from
test_manytomany_nonpassive. This is because setting
passive_updates=False in a relationship should work on *all* dialects.
Tony Locke [Sun, 13 Jul 2014 21:38:39 +0000 (22:38 +0100)]
Fix support for two phase commit in pg8000 dialect
The postgresql base dialect has problems with two-phase commit because
there isn't a standard way of handling autocommit in DBAPI. This commit
modifies the pg8000 dialect to use the DBAPI tpc extension, which is
supported by pg8000 as of version 1.9.11.
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