On Wednesday, April 27, 2016 at 5:46:11 PM UTC-4, kevin...@chownow.com 
wrote:
>
> Thank you again for all your hard work on SQLAlchemy. It's incredibly 
> useful. I'm pleasantly surprised by how few things broke when we moved from 
> SQLAlchemy 0.7.9 to the 1.0.12.
>

FYI, something that WILL break on that migration is 'pagination' (ie, using 
limit/offset) with joinedloads if you do not have a fully deterministic 
column used for sorting in the "where" clause.

A new default was introduced in .9 (and backported to .8 for optional 
support) that adds a "distinct" clause to an inner query in the 
subqueryload.  If you don't have a fully deterministic where clause, the 
first few "pages" will appear to be fine BUT the latter pages will likely 
generate lots of errors from missing objects.

It's described in this note somewhat differently:
http://docs.sqlalchemy.org/en/latest/changelog/migration_09.html#subquery-eager-loading-will-apply-distinct-to-the-innermost-select-for-some-queries

I've been working on a changelog fix to make this more clear.

Because this is usually only apparent towards the latter "pages", most 
people (and tests) will miss it.  We had this bug in production for months 
without it being triggered.

The behavior until the .7 branch, combined with default natural sort orders 
on most backends, allowed "insufficient" queries to work.

I would just check your code to make sure any calls to subqueryload have a 
fully deterministic column.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to