diff --git a/r2/r2/lib/db/tdb_sql.py b/r2/r2/lib/db/tdb_sql.py index 71734829f..338e527ae 100644 --- a/r2/r2/lib/db/tdb_sql.py +++ b/r2/r2/lib/db/tdb_sql.py @@ -515,8 +515,8 @@ def fetch_query(table, id_col, thing_id): single = True thing_id = (thing_id,) - s = sa.select([table], sa.or_(*[id_col == tid - for tid in thing_id])) + s = sa.select([table], id_col.in_(thing_id)) + try: r = add_request_info(s).execute().fetchall() except Exception, e: