diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2023-11-07 14:02:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-07 14:02:09 -0500 |
commit | 455ef041871fe944a0f3b7b1f5073663f20a99be (patch) | |
tree | 4d81ac2b66652be0a2954314ddcdda5252e1078b /synapse/storage/database.py | |
parent | Avoid executing no-op queries. (#16583) (diff) | |
download | synapse-455ef041871fe944a0f3b7b1f5073663f20a99be.tar.xz |
Avoid updating the same rows multiple times with simple_update_many_txn. (#16609)
simple_update_many_txn had a bug in it which would cause each update to be applied twice.
Diffstat (limited to 'synapse/storage/database.py')
-rw-r--r-- | synapse/storage/database.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py index 792f2e7cdf..f50a4ce2fc 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py @@ -2060,10 +2060,7 @@ class DatabasePool: # List of tuples of (value values, then key values) # (This matches the order needed for the query) - args = [tuple(x) + tuple(y) for x, y in zip(value_values, key_values)] - - for ks, vs in zip(key_values, value_values): - args.append(tuple(vs) + tuple(ks)) + args = [tuple(vv) + tuple(kv) for vv, kv in zip(value_values, key_values)] # 'col1 = ?, col2 = ?, ...' set_clause = ", ".join(f"{n} = ?" for n in value_names) |