mirror of
https://github.com/affaan-m/ECC.git
synced 2026-11-07 16:45:53 +00:00
The DESTRUCTIVE_SQL_DD phrases (drop table, delete from, truncate) were only ever tested against quote-stripped text, so a real invocation such as `psql -c "drop table users"` or `mysql -e "delete from sessions"`, which must quote the statement, was always allowed. Only the unquoted spelling, which the shell would split into separate arguments, was caught. Keep the quote-stripped scan for the generic case (a commit message that mentions "drop table" still passes), and additionally test the SQL phrases against the unquoted argument text when the segment's executable is a known database client (psql, mysql, mariadb, sqlite3, duckdb, clickhouse-client, mongosh, ...). The check lives in the quote-aware pass, so it also applies behind `sh -c` and in chained segments. Fixes #3024