From 16f58c74b0e03164153c802e44c9fc034abaa33d Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 2 Oct 2018 14:33:05 +0200 Subject: lib/mysql-functions: mysql_run_query(): rename INFILEs to make query more easily replayable --- lib/mysql-functions | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/mysql-functions b/lib/mysql-functions index 1e609f5..1eca658 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -72,8 +72,12 @@ mysql_run_query() { T p ' "${query_stdin}" | \ + sponge | \ cat -n | \ while read -r number file; do + sed -i ' + s@"'"$(str_to_regex "${file}")"'"@"'"${query_stdin%.stdin}.infile.${number}"'"@g + ' "${query_stdin}" cp "${file}" "${query_stdin%.stdin}.infile.${number}" printf ' %s' "${query_stdin%.stdin}.infile.${number}" done -- cgit v1.2.3-70-g09d2