Merge pull request #42200 from shengis/sqlite3_fix_row_absent_2016.11

Fix #42198
This commit is contained in:
Nicole Thomas 2017-07-21 08:47:29 -06:00 committed by GitHub
commit 8262cc9054

View file

@ -147,9 +147,13 @@ def row_absent(name, db, table, where_sql, where_args=None):
changes['changes']['old'] = rows[0]
else:
cursor = conn.execute("DELETE FROM `" +
table + "` WHERE " + where_sql,
where_args)
if where_args is None:
cursor = conn.execute("DELETE FROM `" +
table + "` WHERE " + where_sql)
else:
cursor = conn.execute("DELETE FROM `" +
table + "` WHERE " + where_sql,
where_args)
conn.commit()
if cursor.rowcount == 1:
changes['result'] = True