mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-24 18:45:52 +03:00
Merge pull request #2491 from matrix-org/rav/port_db_fixes
Drop search values with nul characters
This commit is contained in:
commit
e4779be97a
1 changed files with 7 additions and 4 deletions
|
@ -376,10 +376,13 @@ class Porter(object):
|
|||
" VALUES (?,?,?,?,to_tsvector('english', ?),?,?)"
|
||||
)
|
||||
|
||||
rows_dict = [
|
||||
dict(zip(headers, row))
|
||||
for row in rows
|
||||
]
|
||||
rows_dict = []
|
||||
for row in rows:
|
||||
d = dict(zip(headers, row))
|
||||
if "\0" in d['value']:
|
||||
logger.warn('dropping search row %s', d)
|
||||
else:
|
||||
rows_dict.append(d)
|
||||
|
||||
txn.executemany(sql, [
|
||||
(
|
||||
|
|
Loading…
Reference in a new issue