Mike Bayer [Wed, 27 Apr 2016 16:37:58 +0000 (11:37 -0500)]
Don't double-process ResultMetaData for BufferedColumnResultProxy
Fixed a bug in the result proxy used mainly by Oracle when binary and
other LOB types are in play, such that when query / statement caching
were used, the type-level result processors, notably that required by
the binary type itself but also any other processor, would become lost
after the first run of the statement due to it being removed from the
cached result metadata.
Mike Bayer [Wed, 27 Apr 2016 00:00:43 +0000 (19:00 -0500)]
Simplify directed graph example
Changed the "directed graph" example to no longer consider
integer identifiers of nodes as significant; the "higher" / "lower"
references now allow mutual edges in both directions.
Mike Bayer [Thu, 21 Apr 2016 14:36:19 +0000 (10:36 -0400)]
Fix result set handling for case insensitive dupe cols
Fixed bug where when using ``case_sensitive=False`` with an
:class:`.Engine`, the result set would fail to correctly accomodate
for duplicate column names in the result set, causing an error
when the statement is executed in 1.0, and preventing the
"ambiguous column" exception from functioning in 1.1.
Marius Gedminas [Mon, 21 Mar 2016 10:00:49 +0000 (12:00 +0200)]
ReST fix: missing backtick
Fixes a misrendering at http://docs.sqlalchemy.org/en/latest/dialects/mssql.html#nullability:
(cherry picked from commit e3abb63293be80379d20b4c3f0d1cd093459a9eb)
Mike Bayer [Mon, 21 Mar 2016 14:57:40 +0000 (10:57 -0400)]
- Fixed bug where the negation of an EXISTS expression would not
be properly typed as boolean in the result, and also would fail to be
anonymously aliased in a SELECT list as is the case with a
non-negated EXISTS construct.
fixes #3682
Mike Bayer [Thu, 3 Mar 2016 01:24:49 +0000 (20:24 -0500)]
- move out unconsumed names tests from test_compiler out to test_insert, test_update
- establish consistent names between existing unconsumed names tests and new ones
added per ref #3666
Mike Bayer [Fri, 26 Feb 2016 16:27:12 +0000 (11:27 -0500)]
- unfortunately calling upon "_label" here makes it unclear if
we're trying to hit columns without names yet and such, to suit the bug
right now just make it specific to FunctionElement
Mike Bayer [Fri, 26 Feb 2016 05:20:39 +0000 (00:20 -0500)]
- Anonymous labeling is applied to a :attr:`.func` construct that is
passed to :func:`.column_property`, so that if the same attribute
is referred to as a column expression twice the names are de-duped,
thus avoiding "ambiguous column" errors. Previously, the
``.label(None)`` would need to be applied in order for the name
to be de-anonymized.
fixes #3663
Mike Bayer [Mon, 22 Feb 2016 03:46:31 +0000 (22:46 -0500)]
- additional adjustment to the fix made in 8ad968f33100baeb3b13c7e0b724b6b79ab4277f
for ref #3657. The Oracle dialect makes more use of the "select_wraps_for"
feature than SQL server because Oracle doesn't have "TOP" for a limit-only
select, so tests are showing more happening here. In the case where
the select() has some dupe columns, these are deduped from the .c collection
so a positional match between the wrapper and original can't use .inner_columns,
because these collections wont match. Using _columns_plus_names
instead which is the deduped collection that determines the SELECT display,
which definitely have to match up.
Mike Bayer [Mon, 22 Feb 2016 01:52:43 +0000 (20:52 -0500)]
- Fixed bug in "to_list" conversion where a single bytes object
would be turned into a list of individual characters. This would
impact among other things using the :meth:`.Query.get` method
on a primary key that's a bytes object.
fixes #3660
Mike Bayer [Sun, 21 Feb 2016 01:22:38 +0000 (20:22 -0500)]
- reworked the way the "select_wraps_for" expression is
handled within visit_select(); this attribute was added in the
1.0 series to accommodate the subquery wrapping behavior of
SQL Server and Oracle while also working with positional
column targeting and no longer relying upon "key fallback"
in order to target columns in such a statement. The IBM DB2
third-party dialect also has this use case, but its implementation
is using regular expressions to rewrite the textual SELECT only
and does not make use of a "wrapped" select at this time.
The logic no longer attempts to reconcile proxy set collections as
this was not deterministic, and instead assumes that the select()
and the wrapper select() match their columns postionally,
at least for the column positions they have in common,
so it is now very simple and safe. fixes #3657.
- as a side effect of #3657 it was also revealed that the
strategy of calling upon a ResultProxy._getter was not
correctly calling into NoSuchColumnError when an expected
column was not present, and instead returned None up to
loading.instances() to produce NoneType failures; added
a raiseerr argument to _getter() which is called when we
aren't expecting None, fixes #3658.
Mike Bayer [Fri, 12 Feb 2016 03:29:18 +0000 (22:29 -0500)]
- Fixed bug in :meth:`.Session.merge` where an object with a composite
primary key that has values for some but not all of the PK fields
would emit a SELECT statement leaking the internal NEVER_SET symbol
into the query, rather than detecting that this object does not have
a searchable primary key and no SELECT should be emitted.
fixes #3647
Mike Bayer [Wed, 10 Feb 2016 15:17:45 +0000 (10:17 -0500)]
- add more documentation to MutableDict explaining
that this structure is only intended to track additions
and removals from the dictionary, not recursive tracking
of embedded changes. fixes #3646.
Mike Bayer [Wed, 10 Feb 2016 02:08:21 +0000 (21:08 -0500)]
- don't drop the ts1/ts2 databases without seeing the primary DB,
because we never log in on the ts1/ts2. races against other runs
and erases their DBs
Mike Bayer [Tue, 9 Feb 2016 23:10:50 +0000 (18:10 -0500)]
- repair the fix just cherry-picked for ref #3644 as compiler.py wasn't
present in the commit for master, having been inadvertently committed
on February 3. Source of this line is c1316a299257fae8264c8038d83e415f4605fde7.
Mike Bayer [Tue, 9 Feb 2016 23:05:40 +0000 (18:05 -0500)]
- Fixed bug in :func:`.expression.text` construct where a double-colon
expression would not escape properly, e.g. ``some\:\:expr``, as is most
commonly required when rendering Postgresql-style CAST expressions.
fixes #3644
Mike Bayer [Tue, 9 Feb 2016 03:57:02 +0000 (22:57 -0500)]
- Testing reveals that we have *no* weak references to any cx_Oracle connections at all,
yet cx_Oracle still has open sessions that cannot be killed until process dies.
Oracle wins! Add a completely separate DB reaper script that runs
after py.test is done.
Mike Bayer [Mon, 8 Feb 2016 23:05:51 +0000 (18:05 -0500)]
- fully hyperlink the docstring for make_transient
- establish make_transient and make_transient_to_detached as special-use,
advanced use only functions
- list all conditions under make_transient() under which an attribute
will not be loaded and establish that make_transient() does not attempt
to load all attributes before detaching the object from its
session, fixes #3640
Mike Bayer [Mon, 8 Feb 2016 18:13:39 +0000 (13:13 -0500)]
- adjust to allow dblink tests to work with multiprocess users.
unfortunately the synonym doesn't work for SQL statements here
when the dblink is on a different user, testing this is not really
critical so just removed it.
Carlos Rivas [Sat, 23 Jan 2016 09:23:46 +0000 (09:23 +0000)]
Removed entry that causes AttributeError (#3621) - Oracle zxJDBC fails with AttributeError in object OracleCompiler_zxjdbc
(cherry picked from commit edc0b8678bc06ae27fa0f7e80c3eb074978fbe10)
Mike Bayer [Tue, 2 Feb 2016 17:07:39 +0000 (12:07 -0500)]
- D rules seem to have been added overnight to the flake8 plugin
I'm using and many of these seem contradictory and/or undesirable.
block all until individual rules can be approved.
Mike Bayer [Tue, 2 Feb 2016 15:15:40 +0000 (10:15 -0500)]
- Fixed issue where inadvertent use of the Python ``__contains__``
override with a column expression (e.g. by using ``'x' in col``)
would cause an endless loop in the case of an ARRAY type, as Python
defers this to ``__getitem__`` access which never raises for this
type. Overall, all use of ``__contains__`` now raises
NotImplementedError.
fixes #3642
Mike Bayer [Thu, 28 Jan 2016 20:01:31 +0000 (15:01 -0500)]
- revert the change first made in a6fe4dc, as we are now generalizing
the warning here to all safe_reraise() cases in Python 2.
- Revisiting :ticket:`2696`, first released in 1.0.10, which attempts to
work around Python 2's lack of exception context reporting by emitting
a warning for an exception that was interrupted by a second exception
when attempting to roll back the already-failed transaction; this
issue continues to occur for MySQL backends in conjunction with a
savepoint that gets unexpectedly lost, which then causes a
"no such savepoint" error when the rollback is attempted, obscuring
what the original condition was.
The approach has been generalized to the Core "safe
reraise" function which takes place across the ORM and Core in any
place that a transaction is being rolled back in response to an error
which occurred trying to commit, including the context managers
provided by :class:`.Session` and :class:`.Connection`, and taking
place for operations such as a failure on "RELEASE SAVEPOINT".
Previously, the fix was only in place for a specific path within
the ORM flush/commit process; it now takes place for all transational
context managers as well.
fixes #2696
Mike Bayer [Tue, 26 Jan 2016 22:28:40 +0000 (17:28 -0500)]
- unfortunately we need to match within join where col.key does not match
what's given so we need to use a set() here. contains_column is not within
any performance paths
Mike Bayer [Tue, 26 Jan 2016 21:41:26 +0000 (16:41 -0500)]
- rework ColumnCollection to no longer persist "all_col_set"; we don't
need this collection except in the extend/update uses where we
create it ad-hoc. simplifies pickling. Compatibility with 1.0
should be OK as ColumnColleciton uses __getstate__ in any case
and the __setstate__ contract hasn't changed.
- Fixed bug in :class:`.Table` metadata construct which appeared
around the 0.9 series where adding columns to a :class:`.Table`
that was unpickled would fail to correctly establish the
:class:`.Column` within the 'c' collection, leading to issues in
areas such as ORM configuration. This could impact use cases such
as ``extend_existing`` and others. fixes #3632
Mike Bayer [Thu, 21 Jan 2016 20:21:33 +0000 (15:21 -0500)]
- documenation updates to clarify specific SQLite versions
that have problems with right-nested joins and UNION column keys;
references #3633 references #3634. backport from 1.1 to 0.9
announcing 1.1 as where these behaviors will be retired based
on version-specific checks
- fix test_resultset so that it passes when SQLite 3.10.0 is
present, references #3633
Mike Bayer [Mon, 18 Jan 2016 22:35:44 +0000 (17:35 -0500)]
- Fixed bug where some exception re-raise scenarios would attach
the exception to itself as the "cause"; while the Python 3 interpreter
is OK with this, it could cause endless loops in iPython.
fixes #3625
- add tests for reraise, raise_from_cause
- raise_from_cause is the same on py2k/3k, use just one function
Mike Bayer [Thu, 14 Jan 2016 22:18:21 +0000 (17:18 -0500)]
- fix some old verbiage that refers to text() as an "implicit" thing
for SQL fragments; we've deprecated that in 1.0 and its a good idea
to document like this for 0.9 as well.
Mike Bayer [Sun, 10 Jan 2016 16:48:53 +0000 (11:48 -0500)]
- fix link to types in metadata, fixes #3618
- fix "version" got whacked into "f" in core tutorial
- fix short underline in automap
- fix unmatched boldface in session events