diff options
author | Erich Eckner <git@eckner.net> | 2019-06-26 09:18:38 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-06-26 09:18:38 +0200 |
commit | a716811bd1c3862f860861f24b98f632369f6e40 (patch) | |
tree | ef56bc95b82e966ff5704093c0e444799fd27cad /lib | |
parent | f9c180ee7e646c0cf6c45e413a7a422039e61581 (diff) | |
download | builder-a716811bd1c3862f860861f24b98f632369f6e40.tar.xz |
lib/mysql-functions: make mysql_run_query() more verbose in case of error
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/mysql-functions | 5 |
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/ |