summaryrefslogtreecommitdiff
path: root/lib/mysql-functions
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-10-02 14:33:05 +0200
committerErich Eckner <git@eckner.net>2018-10-02 14:34:43 +0200
commit16f58c74b0e03164153c802e44c9fc034abaa33d (patch)
tree3fc0cedc68e26a361fcde4195cae9bb2f1a57c27 /lib/mysql-functions
parent31e615a2a81f56b99ec14fc7ca6cb304a3a4813e (diff)
downloadbuilder-16f58c74b0e03164153c802e44c9fc034abaa33d.tar.xz
lib/mysql-functions: mysql_run_query(): rename INFILEs to make query more easily replayable
Diffstat (limited to 'lib/mysql-functions')
-rwxr-xr-xlib/mysql-functions4
1 files changed, 4 insertions, 0 deletions
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