From 43b983ff97df9216c966023c50ceac9f4a4c36e4 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 4 Feb 2020 14:50:24 +0100 Subject: lib/mysql-functions: only save queries which (potentially) delete binary_packages or binary_packages_in_repositories --- lib/mysql-functions | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/mysql-functions b/lib/mysql-functions index 4bd1164..5173bfb 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -57,7 +57,11 @@ mysql_run_query() { < "${query_stdin}" \ > "${query_stdout}" \ 2>> "${query_stderr}"; then - mv "${query_stdin}" "${work_dir}/successful.${query_stdin##*/}" + if grep -qF 'DELETE `binary_packages' "${query_stdin}"; then + mv "${query_stdin}" "${work_dir}/successful.${query_stdin##*/}" + else + rm "${query_stdin}" + fi rm "${query_stderr}" fi if ! [ -f "${query_stdin}" ]; then -- cgit v1.2.3-70-g09d2