Mike Bayer [Thu, 15 Sep 2016 04:50:17 +0000 (00:50 -0400)]
Repair foreign_keys population for Join._refresh_for_new_column
Fixed bug where setting up a single-table inh subclass of a joined-table
subclass which included an extra column would corrupt the foreign keys
collection of the mapped table, thereby interfering with the
initialization of relationships.
Edouard Berthe [Wed, 31 Aug 2016 06:52:48 +0000 (16:52 +1000)]
Corrects typo
This example doesn't work with 'back_populates' because 'parent_associations' and 'child_associations' are not defined in Parent and Child classes respectively.
Alternatively, we could create 'parent_associations' and 'child_associations' into the classes.
(cherry picked from commit 53c3119ebb6801cbfcaf2841311d117eba250444)
Mike Bayer [Mon, 15 Aug 2016 20:39:12 +0000 (16:39 -0400)]
Rework _apply_joins(), _prep_for_joins() totally
The approach here is still error prone
and hard to follow. Reorganize the whole
thing to take a pretty blunt approach to
the structure of to_join(). Also fix some never-called
code (!) in _prep_for_joins() and ensure we re-use
an aliased object.
Mike Bayer [Sat, 13 Aug 2016 03:35:40 +0000 (23:35 -0400)]
Ensure final link in subqueryload join is correct
Fixed bug in subquery eager loading where a subqueryload
of an "of_type()" object linked to a second subqueryload of a plain
mapped class would fail to link the joins correctly.
brln [Tue, 2 Aug 2016 22:37:35 +0000 (18:37 -0400)]
Warn that bulk save groups inserts/updates by type
Users who pass many different object types to bulk_save_objects
may be surprised that the INSERT/UPDATE batches must necessarily
be broken up by type. Add this to the list of caveats.
Co-authored-by: Mike Bayer
Change-Id: I8390c1c971ced50c41268b479a9dcd09c695b135
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/294
(cherry picked from commit ce1492ef3aae692a3dc10fff400e178e7b2edff8)
Mike Bayer [Sun, 24 Jul 2016 21:37:25 +0000 (17:37 -0400)]
Allow Table._reset_exported to silently pass
Fixed bug in :class:`.Table` where the internal method
``_reset_exported()`` would corrupt the state of the object. This
method is intended for selectable objects and is called by the ORM
in some cases; an erroneous mapper configuration would could lead the
ORM to call this on on a :class:`.Table` object.
Mark Hahnenberg [Tue, 12 Jul 2016 18:07:52 +0000 (14:07 -0400)]
Fix issue with unbaking subqueries
Fix improper capture of a loop variable inside a lambda during unbaking
of subquery eager loaders, which would cause the incorrect query
to be invoked.
Mike Bayer [Tue, 5 Jul 2016 16:48:41 +0000 (12:48 -0400)]
Adapt "FOR UPDATE OF" with Oracle limit/offset
This modifies the Oracle ROWNUM limit/offset approach
to accommodate for the "OF" clause in a "FOR UPDATE"
phrase. The column expressions must be added to the selected
subquery if necessary and adapted on the outside.
Mike Bayer [Mon, 4 Jul 2016 20:37:26 +0000 (16:37 -0400)]
Repair PG BIGSERIAL w/ TypeDecorator, Variant
Some of the dialect impl memoization for TypeDecorator
necessarily keeps the top-level TypeDecorator type
around, since a user-defined type will have bind and result
set processing behavior. For both TypeDecorator and Variant,
PG dialect needs to ensure it's looking at the SQLAlchemy
type to check for SmallInteger / BigInteger.
Mike Bayer [Fri, 1 Jul 2016 16:44:47 +0000 (12:44 -0400)]
Preserve type for math negation
Fixed issue in SQL math negation operator where the type of the
expression would no longer be the numeric type of the original.
This would cause issues where the type determined result set
behaviors.
Pieter Mulder [Wed, 29 Jun 2016 15:15:44 +0000 (11:15 -0400)]
Repair pickling for Properties object
Fixed bug whereby the ``__getstate__`` / ``__setstate__``
methods for sqlalchemy.util.Properties were
non-working due to the transition in the 1.0 series to ``__slots__``.
The issue potentially impacted some third-party applications.
Pull request courtesy Pieter Mulder.
Mike Bayer [Mon, 13 Jun 2016 19:18:13 +0000 (15:18 -0400)]
Deprecate FromClause.count() (pending for 1.1)
count() here is misleading in that it not only
counts from an arbitrary column in the table, it also
does not make accommodations for DISTINCT, JOIN, etc.
as the ORM-level function does. Core should not be
attempting to provide a function like this.
Mike Bayer [Fri, 10 Jun 2016 21:24:36 +0000 (17:24 -0400)]
Ensure CTE internals are handled during clone
The CTE construct was missing a _copy_internals() method
which would handle CTE-specific structures including _cte_alias,
_restates during a clone operation.
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.
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.
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