Mike Bayer [Thu, 2 Jun 2016 17:52:27 +0000 (13:52 -0400)]
Skip UniqueConstraint marked by unique=True in tometadata
Fixes an issue where a Column would be copied with unique=True
and at the same time the UniqueConstraint would also be copied,
leading to duplicate UniqueConstraints in the target table,
when tometadata() is used. Imitates the same logic used
by index=True/Index to avoid duplicates. For some reason
a fix was implemented for Index long ago but never for
UniqueConstraint.
Sheila Allen [Mon, 11 Apr 2016 19:29:03 +0000 (15:29 -0400)]
Use new mxODBC 3.3.4 varbinary null symbol
Use new mxODBC 3.3.4 varbinary null symbol with VARBINARY
data types when value is None(based on similar change to pyodbc).
Fix a test to pass on mxODBC starting w 3.3.3 version
Adam Chainz [Sun, 29 May 2016 13:28:55 +0000 (14:28 +0100)]
Convert readthedocs link for their .org -> .io migration for hosted projects
As per their email ‘Changes to project subdomains’:
> Starting today, Read the Docs will start hosting projects from subdomains on the domain readthedocs.io, instead of on readthedocs.org. This change addresses some security concerns around site cookies while hosting user generated data on the same domain as our dashboard.
Test Plan: Manually visited all the links I’ve modified.
Mike Bayer [Wed, 18 May 2016 15:07:02 +0000 (11:07 -0400)]
Support "blank" schema when MetaData.schema is set
Previously, it was impossible to have a Table that has
None for a schema name when the "schema" parameter on
MetaData was set. A new symbol sqlalchemy.schema.BLANK_SCHEMA
is added which indicates that the schema name should unconditionally
be set to None. In particular, this value must be passed within
cross-schema foreign key reflection, so that a Table which
is in the "default" schema can be represented properly.
Mike Bayer [Mon, 16 May 2016 14:32:07 +0000 (10:32 -0400)]
Accommodate "callable" bound param in evaluator
Fixed bug in "evaluate" strategy of :meth:`.Query.update` and
:meth:`.Query.delete` which would fail to accommodate a bound
parameter with a "callable" value, as which occurs when filtering
by a many-to-one equality expression along a relationship.
John Vandenberg [Thu, 5 May 2016 13:26:00 +0000 (09:26 -0400)]
Fix TypeError during cx_Oracle connection
cx_Oracle connection parameters user, password and dsn must be
either a string or NULL. When they are passed a Python None object,
"TypeError: expecting string, unicode or buffer object" is raised.
Mike Bayer [Tue, 10 May 2016 16:49:56 +0000 (12:49 -0400)]
Fix label referencing in SQL Server OFFSET logic
Fixed bug where by ROW_NUMBER OVER clause applied for OFFSET
selects in SQL Server would inappropriately substitute a plain column
from the local statement that overlaps with a label name used by
the ORDER BY criteria of the statement.
Mike Bayer [Tue, 10 May 2016 15:05:30 +0000 (11:05 -0400)]
Check for duplicate calls to register_attribute_impl
Fixed bug whereby the event listeners used for backrefs could
be inadvertently applied multiple times, when using a deep class
inheritance hierarchy in conjunction with mutiple mapper configuration
steps.
Mike Bayer [Thu, 5 May 2016 21:07:40 +0000 (17:07 -0400)]
Repair _orm_columns() to accommodate text()
Fixed bug whereby passing a :func:`.text` construct to the
:meth:`.Query.group_by` method would raise an error, instead
of intepreting the object as a SQL fragment.
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.
Mike Bayer [Tue, 19 Apr 2016 20:11:23 +0000 (16:11 -0400)]
Deprecate Mapper.order_by
This is an old parameter no longer relevant to how SQLAlchemy
works, once the Query object was introduced. By deprecating it
we establish that we aren't supporting non-working use cases
and that we encourage applications to move off of the use of this
parameter.
Mike Bayer [Tue, 19 Apr 2016 19:46:37 +0000 (15:46 -0400)]
Rename Query._mapper_zero() to Query._entity_zero()
To be more descriptive of the use of _mapper_zero(), rename
it to _entity_zero(), but also supply a new _mapper_zero() function
that more strictly returns a mapper. The existing
_entity_zero() function is renamed to _query_entity_zero.
_only_mapper_zero() is removed as it isn't used. Divide up the
existing calling functions to refer to the appropriate new method.
Mike Bayer [Mon, 18 Apr 2016 20:18:31 +0000 (16:18 -0400)]
Propagate hybrid properties / info
Keystone and others depend on the .property attribute being
"mirrored" when a @hybrid_property is linked directly to a
mapped attribute. Restore this linkage and also create a defined
behavior for the .info dictionary; it is that of the hybrid itself.
Add this behavioral change to the migration notes.
Mike Bayer [Sun, 10 Apr 2016 18:56:01 +0000 (14:56 -0400)]
Honor hybrid property / method docstrings
The docstring specified on a hybrid property or method is now honored
at the class level, allowing it to work with tools like Sphinx
autodoc. The mechanics here necessarily involve some wrapping of
expressions to occur for hybrid properties, which may cause them
to appear differently using introspection.
Mike Bayer [Wed, 30 Mar 2016 21:27:53 +0000 (17:27 -0400)]
- make sure negative row indexes are based on the size of the
number of columns we're actually reporting on
- add more tests for negative row index
- changelog/migration
Mike Bayer [Tue, 29 Mar 2016 21:56:02 +0000 (17:56 -0400)]
- Added :meth:`.Select.lateral` and related constructs to allow
for the SQL standard LATERAL keyword, currently only supported
by Postgresql. fixes #2857
Mike Bayer [Wed, 23 Mar 2016 20:54:03 +0000 (16:54 -0400)]
- Further continuing on the common MySQL exception case of
a savepoint being cancelled first covered in :ticket:`2696`,
the failure mode in which the :class:`.Session` is placed when a
SAVEPOINT vanishes before rollback has been improved to allow the
:class:`.Session` to still function outside of that savepoint.
It is assumed that the savepoint operation failed and was cancelled.
fixes #3680
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 [Tue, 15 Mar 2016 21:47:34 +0000 (17:47 -0400)]
- Added basic isolation level support to the SQL Server dialects
via :paramref:`.create_engine.isolation_level` and
:paramref:`.Connection.execution_options.isolation_level`
parameters. fixes #3534
Mike Bayer [Mon, 14 Mar 2016 21:56:57 +0000 (17:56 -0400)]
- Fixed bug where a newly inserted instance that is rolled back
would still potentially cause persistence conflicts on the next
transaction, because the instance would not be checked that it
was expired. This fix will resolve a large class of cases that
erronously cause the "New instance with identity X conflicts with
persistent instance Y" error.
fixes #3677
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 [Fri, 26 Feb 2016 04:22:30 +0000 (23:22 -0500)]
- An improvement to the workings of :meth:`.Query.correlate` such
that when a "polymorphic" entity is used which represents a straight
join of several tables, the statement will ensure that all the
tables within the join are part of what's correlating.
fixes #3662
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