Commit Graph

9901 Commits

Author SHA1 Message Date
Mike Bayer ac52239b32 - Fixed bug where the truncation of long labels in SQL could produce
a label that overlapped another label that is not truncated; this
because the length threshhold for truncation was greater than
the portion of the label that remains after truncation.  These
two values have now been made the same; label_length - 6.
The effect here is that shorter column labels will be "truncated"
where they would not have been truncated before.
fixes #3396
2015-04-28 16:02:59 -04:00
mike bayer 0783cb9337 Merge pull request #170 from eronisko/fix_typo
Fix typo in 'Relationships API' docs
2015-04-28 10:10:40 -04:00
Ernest Walzel da327d0349 Fix typo in 'Relationships API' docs
exprssed -> expressed
2015-04-28 12:27:00 +01:00
Mike Bayer 34f98a63b5 - altered part of the use contract first set up in #2992; we
now skip textual label references when copying ORDER BY elements
to the joined-eager-load subquery, as we can't know that these
expressions are compatible with this placement;  either because
they are meant for text(), or because they refer to label names
already stated and aren't bound to a table. fixes #3392
2015-04-27 17:40:41 -04:00
Mike Bayer e5c20fce93 - replace old crufty ddl event test fixture with mock 2015-04-27 15:21:18 -04:00
Mike Bayer e25ef01fbb - Fixed regression due to 🎫3282 where the `tables` collection
passed as a keyword argument to the :meth:`.DDLEvents.before_create`,
:meth:`.DDLEvents.after_create`, :meth:`.DDLEvents.before_drop`, and
:meth:`.DDLEvents.after_drop` events would no longer be a list
of tables, but instead a list of tuples which contained a second
entry with foreign keys to be added or dropped.  As the ``tables``
collection, while documented as not necessarily stable, has come
to be relied upon, this change is considered a regression.
Additionally, in some cases for "drop", this collection would
be an iterator that would cause the operation to fail if
prematurely iterated.   The collection is now a list of table
objects in all cases and test coverage for the format of this
collection is now added.
fixes #3391
2015-04-27 15:05:41 -04:00
Mike Bayer 6c0f30db81 - Fixed a regression regarding the :meth:.MapperEvents.instrument_class
event where its invocation was moved to be after the class manager's
instrumentation of the class, which is the opposite of what the
documentation for the event explicitly states.  The rationale for the
switch was due to Declarative taking the step of setting up
the full "instrumentation manager" for a class before it was mapped
for the purpose of the new ``@declared_attr`` features
described in :ref:`feature_3150`, but the change was also made
against the classical use of :func:`.mapper` for consistency.
However, SQLSoup relies upon the instrumentation event happening
before any instrumentation under classical mapping.
The behavior is reverted in the case of classical and declarative
mapping, the latter implemented by using a simple memoization
without using class manager.
fixes #3388
2015-04-26 18:22:41 -04:00
Mike Bayer d48acff23b - Fixed issue in new :meth:.QueryEvents.before_compile event where
changes made to the :class:`.Query` object's collection of entities
to load within the event would render in the SQL, but would not
be reflected during the loading process.
fixes #3387
2015-04-26 12:33:17 -04:00
Mike Bayer 6833669469 - try pinning a tag here to for RTD to please build correctly 2015-04-25 10:48:54 -04:00
Mike Bayer 42c9fe1d1d 1.0.2 rel_1_0_2 2015-04-24 18:03:01 -04:00
Mike Bayer 723e07a374 - reword the notes here 2015-04-24 18:02:57 -04:00
Mike Bayer 372e0600d9 - fix link 2015-04-24 17:55:05 -04:00
Mike Bayer f58ca25df7 - tag declarative as "orm declarative" 2015-04-24 17:52:00 -04:00
Mike Bayer c71c7444ec - add a note about that resolution 2015-04-24 17:28:19 -04:00
Mike Bayer f9275198c3 - Fixed a regression that was incorrectly fixed in 1.0.0b4
(hence becoming two regressions); reports that
SELECT statements would GROUP BY a label name and fail was misconstrued
that certain backends such as SQL Server should not be emitting
ORDER BY or GROUP BY on a simple label name at all; when in fact,
we had forgotten that 0.9 was already emitting ORDER BY on a simple
label name for all backends, as described in :ref:`migration_1068`,
as 1.0 had rewritten this logic as part of 🎫`2992`.

In 1.0.2, the bug is fixed both that SQL Server, Firebird and others
will again emit ORDER BY on a simple label name when passed a
:class:`.Label` construct that is expressed in the columns clause,
and no backend will emit GROUP BY on a simple label name in this case,
as even Postgresql can't reliably do GROUP BY on a simple name
in every case.
fixes #3338, fixes #3385
2015-04-24 17:04:35 -04:00
Mike Bayer 0170075934 - add the "strict" version of this lookup for __abstract__ as well,
fixes #3383
2015-04-24 17:03:34 -04:00
Mike Bayer f7e89f887f Merge remote-tracking branch 'origin/pr/169' 2015-04-24 15:52:42 -04:00
Mike Bayer e73f735382 - Fixed regression regarding the declarative `__declare_first__`
and ``__declare_last__`` accessors where these would no longer be
called on the superclass of the declarative base.
fixes #3383
2015-04-24 13:49:09 -04:00
Gaëtan de Menten e77cf339ee micro-optimize unique_list
This makes unique_list approx 2x faster in my (simple) tests
2015-04-24 14:26:42 +02:00
Mike Bayer 0fc751e4ab 1.0.1 rel_1_0_1 2015-04-23 14:21:56 -04:00
Mike Bayer 350d002ee9 - update date
- repair category for EXISTS issue
2015-04-23 14:21:56 -04:00
Mike Bayer 846b2b835e - change/migration edits 2015-04-23 13:43:25 -04:00
Mike Bayer dd4240e43b - Fixed support for "literal_binds" mode when using limit/offset
with Firebird, so that the values are again rendered inline when
this is selected.  Related to 🎫`3034`.
fixes #3381
2015-04-23 12:07:56 -04:00
Mike Bayer 167a45a442 changelog for #3380, fixes #3380 2015-04-23 11:40:40 -04:00
effem-git ce1ab2bef3 Update base.py
Fix TypeError: Boolean value of this clause is not defined
2015-04-23 13:00:42 +02:00
Mike Bayer 39978060b0 - repair a regression caused by #3282, where we no longer were
applying any topological sort to tables on SQLite.  See the
changelog for details, but we now continue to sort
tables for SQLite on DROP, prohibit the sort from considering
alter, and only warn if we encounter an unresolvable cycle, in
which case, then we forego the ordering.  use_alter as always
is used to break such a cycle.
fixes #3378
2015-04-22 14:14:11 -04:00
Mike Bayer f704b7265a - correct migration note for #3084; doesn't apply to create/drop 2015-04-22 11:59:08 -04:00
Mike Bayer 4442eb3e1e - typo 2015-04-21 13:05:24 -04:00
Mike Bayer 732fb99fc0 - add a warning to SingletonThreadPool that it isn't for general use 2015-04-21 11:04:21 -04:00
Mike Bayer c2e3002503 - Added the string value `"none"` to those accepted by the
:paramref:`.Pool.reset_on_return` parameter as a synonym for ``None``,
so that string values can be used for all settings, allowing
.ini file utilities like :func:`.engine_from_config` to be usable
without issue.
fixes #3375
2015-04-21 10:04:02 -04:00
Mike Bayer 3e80d628bd - Fixed issue where a straight SELECT EXISTS query would fail to
assign the proper result type of Boolean to the result mapping, and
instead would leak column types from within the query into the
result map.  This issue exists in 0.9 and earlier as well, however
has less of an impact in those versions.  In 1.0, due to #918
this becomes a regression in that we now rely upon the result mapping
to be very accurate, else we can assign result-type processors to
the wrong column.   In all versions, this issue also has the effect
that a simple EXISTS will not apply the Boolean type handler, leading
to simple 1/0 values for backends without native boolean instead of
True/False.   The fix includes that an EXISTS columns argument
will be anon-labeled like other column expressions; a similar fix is
implemented for pure-boolean expressions like ``not_(True())``.
fixes #3372
2015-04-20 19:21:00 -04:00
Mike Bayer 2c91f71776 - add migration note for #3084 2015-04-20 17:44:21 -04:00
Mike Bayer a3af638e1a - Fixed more regressions caused by NEVER_SET; comparisons
to transient objects with attributes unset would leak NEVER_SET,
and negated_contains_or_equals would do so for any transient
object as the comparison used only the committed value.
Repaired the NEVER_SET cases, fixes #3371, and also made
negated_contains_or_equals() use state_attr_by_column() just
like a non-negated comparison, fixes #3374
2015-04-20 17:38:03 -04:00
Mike Bayer bd61e7a328 - add documentation describing the behavioral change in relationship
assignments that we would see from #3060; fixes #3369
2015-04-17 17:03:16 -04:00
Mike Bayer 2d877868b4 1.0.1 2015-04-17 16:08:26 -04:00
Mike Bayer d349ad448c - Fixed a critical regression caused by 🎫3061 where the
NEVER_SET symbol could easily leak into a lazyload query, subsequent
to the flush of a pending object.  This would occur typically
for a many-to-one relationship that does not use a simple
"get" strategy.   The good news is that the fix improves efficiency
vs. 0.9, because we can now skip the SELECT statement entirely
when we detect NEVER_SET symbols present in the parameters; prior to
🎫`3061`, we couldn't discern if the None here were set or not.
fixes #3368
2015-04-17 16:06:04 -04:00
Mike Bayer 9f468e305d 1.0.0 rel_1_0_0 2015-04-16 14:58:51 -04:00
Mike Bayer 2bc8c92279 - Identified an inconsistency when handling :meth:.Query.join to the
same target more than once; it implicitly dedupes only in the case of
a relationship join, and due to 🎫`3233`, in 1.0 a join
to the same table twice behaves differently than 0.9 in that it no
longer erroneously aliases.   To help document this change,
the verbiage regarding 🎫`3233` in the migration notes has
been generalized, and a warning has been added when :meth:`.Query.join`
is called against the same target relationship more than once.
fixes #3367
2015-04-15 17:30:23 -04:00
Mike Bayer 623e5b2149 Merge remote-tracking branch 'origin/pr/163' into pr163 2015-04-12 14:56:15 -04:00
Mike Bayer 09e698c602 - remove excess comment 2015-04-12 13:51:40 -04:00
Mike Bayer 35a488ae5f - Made a small improvement to the heuristics of relationship when
determining remote side with semi-self-referential (e.g. two joined
inh subclasses referring to each other), non-simple join conditions
such that the parententity is taken into account and can reduce the
need for using the ``remote()`` annotation; this can restore some
cases that might have worked without the annotation prior to 0.9.4
via 🎫`2948`. fixes #3364
2015-04-12 13:45:08 -04:00
Mike Bayer fc702c9d80 - adjust for "0" 2015-04-12 12:59:31 -04:00
Mike Bayer 55c26710a1 - Fixed issue where a :class:.MetaData object that used a naming
convention would not properly work with pickle.  The attribute was
skipped leading to inconsistencies and failures if the unpickled
:class:`.MetaData` object were used to base additional tables
from.
fixes #3362
2015-04-10 11:20:14 -04:00
Mike Bayer ffec6ab936 - add test support for MySQLdb with use_unicode=1 or using mysqlclient on py3k 2015-04-08 17:23:26 -04:00
Mike Bayer 07153dc092 - ensure that the keys we put into the parameters dictionary
for an insert from select are the string names, and not
the Column objects.  The MSSQL dialect in particular relies upon
checking for these keys in params to know if identity insert
should be on.  references #3360
2015-04-08 12:14:56 -04:00
Mike Bayer 1b83b588f5 - Fixed a regression where the "last inserted id" mechanics would
fail to store the correct value for MSSQL on an INSERT where the
primary key value was present in the insert params before execution.
fixes #3360
2015-04-08 11:59:12 -04:00
Mike Bayer 3f930732f1 - changelog for pr github:166 2015-04-08 10:54:32 -04:00
Mike Bayer 6ee3d6ce81 Merge remote-tracking branch 'origin/pr/166' into pr166 2015-04-08 10:53:11 -04:00
Mike Bayer 44a9820b4e - add some teardown for connections that are held open after tests
in some cases, interfering with tests that check pool._refs
2015-04-08 00:10:54 -04:00
Mike Bayer 72329433e7 - OK, forget it, the DBAPIs, etc. everything else is also site-wide,
we need site-packages
2015-04-05 21:55:40 -04:00