diff --git a/synapse/storage/database.py b/synapse/storage/database.py index 0bbaa9e89835..90721c117f0f 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py @@ -1818,7 +1818,7 @@ def simple_update_many_txn( key_names: Collection[str], key_values: Collection[Iterable[Any]], value_names: Collection[str], - value_values: Iterable[Iterable[Any]], + value_values: Collection[Iterable[Any]], ) -> None: """ Update, many times, using batching where possible. @@ -1831,6 +1831,11 @@ def simple_update_many_txn( value_values: A list of each row's value column values. """ + if len(value_values) != len(key_values): + raise ValueError( + f"{len(key_values)} key rows and {len(value_values)} value rows: should be the same number." + ) + # List of value names, then key names allnames: List[str] = [] allnames.extend(value_names)