Check if the query starts with UPDATE and contains no WHERE.
(formatted_sql)
| 21 | |
| 22 | |
| 23 | def query_is_unconditional_update(formatted_sql): |
| 24 | """Check if the query starts with UPDATE and contains no WHERE.""" |
| 25 | tokens = formatted_sql.split() |
| 26 | return bool(tokens) and tokens[0] == "update" and "where" not in tokens |
| 27 | |
| 28 | |
| 29 | def is_destructive(queries, keywords): |