summaryrefslogtreecommitdiff
path: root/lib/mysql-functions
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mysql-functions')
-rwxr-xr-xlib/mysql-functions8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index f84cb8b..4bd1164 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -53,11 +53,13 @@ mysql_run_query() {
if [ -f "${query_stdout}" ]; then
wait_some_time 10 10
fi
- ${mysql_command} -N --raw --batch "$@" \
+ if ${mysql_command} -N --raw --batch "$@" \
< "${query_stdin}" \
> "${query_stdout}" \
- 2>> "${query_stderr}" \
- && rm "${query_stdin}" "${query_stderr}"
+ 2>> "${query_stderr}"; then
+ mv "${query_stdin}" "${work_dir}/successful.${query_stdin##*/}"
+ rm "${query_stderr}"
+ fi
if ! [ -f "${query_stdin}" ]; then
# success!
break