summaryrefslogtreecommitdiff
path: root/lib/mysql-functions
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-06-26 09:18:38 +0200
committerErich Eckner <git@eckner.net>2019-06-26 09:18:38 +0200
commita716811bd1c3862f860861f24b98f632369f6e40 (patch)
treeef56bc95b82e966ff5704093c0e444799fd27cad /lib/mysql-functions
parentf9c180ee7e646c0cf6c45e413a7a422039e61581 (diff)
downloadbuilder-a716811bd1c3862f860861f24b98f632369f6e40.tar.xz
lib/mysql-functions: make mysql_run_query() more verbose in case of error
Diffstat (limited to 'lib/mysql-functions')
-rwxr-xr-xlib/mysql-functions5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 59a649e..b9ef23a 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -63,7 +63,10 @@ mysql_run_query() {
done
# a present query_file means there was an error
if [ -f "${query_stdin}" ]; then
- >&2 printf 'I could not complete a mysql query!\n'
+ >&2 printf 'I (%s) could not complete a mysql query:\n' \
+ "$(hostname)"
+ >&2 sed 's/^/mysql< /' "${query_stdin}"
+ >&2 sed 's/^/mysql>2 /' "${query_stderr}"
files="${query_stdin} ${query_stdout} ${query_stderr}$(
sed -n '
s/^.*INFILE "\(\S\+\)".*$/\1/