Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Avoid executing no-op queries. #16583

Merged
merged 7 commits into from
Nov 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix
  • Loading branch information
clokep committed Oct 31, 2023
commit da04633d590772a7492e09e41fed95807c681414
4 changes: 2 additions & 2 deletions synapse/storage/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,7 @@ def simple_upsert_many_txn(
value_values: A list of each row's value column values.
Ignored if value_names is empty.
"""
if not value_values:
if not key_values:
return

if table not in self._unsafe_to_upsert_tables:
Expand Down Expand Up @@ -2065,7 +2065,7 @@ def simple_update_many_txn(
raise ValueError(
f"{len(key_values)} key rows and {len(value_values)} value rows: should be the same number."
)
if not value_values:
if not key_values:
return

# List of tuples of (value values, then key values)
Expand Down