Files
synapse/tests
Olivier 'reivilibreandOlivier 'reivilibre 5bc1195e6f Don't %-substitute SQL that is run without parameters.
`LoggingTransaction.execute` hands its (empty by default) parameter
collection to the driver unconditionally. psycopg2 `%`-substitutes the SQL
whenever it is given any parameters at all, so a statement containing a
literal `%` fails with `IndexError: tuple index out of range`.

This has been the case since #15432 changed the signature from
`execute(self, sql, *args)` to `execute(self, sql, parameters=())`, and it
means a Postgres database older than schema version 58 cannot be upgraded:

  * `main/delta/58/10_pushrules_enabled_delete_obsolete.sql` matches
    `LIKE 'global/%/.m.rule.%'`, and
  * the `event_fix_redactions_bytes` background update, scheduled by
    `main/delta/56/redaction_censor3_fix_update.sql.postgres`, matches
    `json NOT LIKE '{%'`.

Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
2026-08-13 18:09:54 +01:00
..
2026-06-02 11:05:38 +01:00