Mike Bayer [Fri, 19 Sep 2014 16:39:34 +0000 (12:39 -0400)]
- these tests don't test anything in SQLAlchemy - from our perpsective,
we need to be in transactions (tested elsewhere) and we need to
emit the correct FOR UPDATE strings (tested elsewhere). There's nothing
in SQLA to be tested as far as validating that for update causes exceptions
or not, and these tests frequently fail as they are timing sensitive.
Mike Bayer [Thu, 18 Sep 2014 21:49:07 +0000 (17:49 -0400)]
- Fixed bug that affected generally the same classes of event
as that of :ticket:`3199`, when the ``named=True`` parameter
would be used. Some events would fail to register, and others
would not invoke the event arguments correctly, generally in the
case of when an event was "wrapped" for adaption in some other way.
The "named" mechanics have been rearranged to not interfere with
the argument signature expected by internal wrapper functions.
fixes #3197
Mike Bayer [Thu, 18 Sep 2014 19:42:27 +0000 (15:42 -0400)]
- Fixed an unlikely race condition observed in some exotic end-user
setups, where the attempt to check for "duplicate class name" in
declarative would hit upon a not-totally-cleaned-up weak reference
related to some other class being removed; the check here now ensures
the weakref still references an object before calling upon it further.
fixes #3208
Mike Bayer [Thu, 18 Sep 2014 19:24:40 +0000 (15:24 -0400)]
- Fixed bug that affected many classes of event, particularly
ORM events but also engine events, where the usual logic of
"de duplicating" a redundant call to :func:`.event.listen`
with the same arguments would fail, for those events where the
listener function is wrapped. An assertion would be hit within
registry.py. This assertion has now been integrated into the
deduplication check, with the added bonus of a simpler means
of checking deduplication across the board.
fixes #3199
Mike Bayer [Tue, 16 Sep 2014 21:40:06 +0000 (17:40 -0400)]
- Fixed the version string detection in the pymssql dialect to
work with Microsoft SQL Azure, which changes the word "SQL Server"
to "SQL Azure".
fixes #3151
Mike Bayer [Thu, 11 Sep 2014 15:51:44 +0000 (11:51 -0400)]
- Fixed warning that would emit when a complex self-referential
primaryjoin contained functions, while at the same time remote_side
was specified; the warning would suggest setting "remote side".
It now only emits if remote_side isn't present.
fixes #3194
Mike Bayer [Wed, 10 Sep 2014 18:14:50 +0000 (14:14 -0400)]
- Fixed bug in ordering list where the order of items would be
thrown off during a collection replace event, if the
reorder_on_append flag were set to True. The fix ensures that the
ordering list only impacts the list that is explicitly associated
with the object.
fixes #3191
Docs: use the base layout when mako_layout=='epub'
- https://readthedocs.org/projects/sqlalchemy/downloads/epub/latest/ renders with the full template which is unreadable on e-readers
- in the makefile the template-variable mako_layout is set for target: epub which makes mako use only the base layout.
- this is the more elegant solution as proposed to #133
Mike Bayer [Tue, 2 Sep 2014 18:21:10 +0000 (14:21 -0400)]
- An adjustment to table/index reflection such that if an index
reports a column that isn't found to be present in the table,
a warning is emitted and the column is skipped. This can occur
for some special system column situations as has been observed
with Oracle. fixes #3180
Mike Bayer [Mon, 1 Sep 2014 00:26:40 +0000 (20:26 -0400)]
- walk back these literal SQL lectures into something much more succinct.
the ORM one in particular was really long winded and I don't really care if people
use text() anyway, they'll figure it out ;)
Matt Chisholm [Sun, 27 Jul 2014 10:15:36 +0000 (12:15 +0200)]
fix MutableDict.coerce
If a class inherited from MutableDict (say, for instance, to add an update() method), coerce() would give back an instance of MutableDict instead of an instance of the derived class.
Add note on begin_nested requiring rollback/commit
Avoid confusion about rollback/commit "must be issued" after
``session.begin_nested()`` --- this might be taken to mean call must be
*added*, but that's only true if not using the return value as a context
manager.
Mike Bayer [Wed, 20 Aug 2014 16:01:20 +0000 (12:01 -0400)]
- Fixed bug in connection pool logging where the "connection checked out"
debug logging message would not emit if the logging were set up using
``logging.setLevel()``, rather than using the ``echo_pool`` flag.
Tests to assert this logging have been added. This is a
regression that was introduced in 0.9.0.
fixes #3168
Mike Bayer [Fri, 15 Aug 2014 18:57:29 +0000 (14:57 -0400)]
- TIL that dict.keys() in py3K is not an iterator, it is an iterable
view. So copy collections.OrderedDict and use MutableMapping to set up
keys, items, values on our own OrderedDict.
Mike Bayer [Fri, 15 Aug 2014 00:00:35 +0000 (20:00 -0400)]
- The string keys that are used to determine the columns impacted
for an INSERT or UPDATE are now sorted when they contribute towards
the "compiled cache" cache key. These keys were previously not
deterministically ordered, meaning the same statement could be
cached multiple times on equivalent keys, costing both in terms of
memory as well as performance.
fixes #3165
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
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.
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 [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 [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
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