[Sqlalchemy-tickets] Issue #3477: different results from sqlalchemy generated sql compared to resul
Brought to you by:
zzzeek
|
From: Michał S. <iss...@bi...> - 2015-07-08 14:31:36
|
New issue 3477: different results from sqlalchemy generated sql compared to result from orm - sqlalchemy version 1.0.6 and below https://bitbucket.org/zzzeek/sqlalchemy/issues/3477/different-results-from-sqlalchemy Michał Szczepański: When I'm trying to join two tables using String values that are duplicating in each column I get less rows then expected The query from database returns 10 rows but filtered is set to True and after ``` #!python if filtered: rows = util.unique_list(rows, filter_fn) ``` in sqlalchemy.orm.loading.py one row is left. I think it's a problem with hashing. ``` #!python def filter_fn(row): return tuple(fn(x) for x, fn in zip(row, filter_fns)) ``` Exist with 1.0.6 and below. Script with full example in attachment with workaround. Script create tables then execute bugged query and workaround query. You can vary result number from bugged query by changing result_rows to number from 1 to 10 ``` #!python s = Scaffold(db, result_rows=2) ``` Test script deletes the database file after run so it's always fresh start. I tried it on 1.0.6 on debian and 0.9.8 on windows same results |