Merge pull request #1854 from anthonyrossbach/patch-1

Fixes for dumps of large databases
This commit is contained in:
Serghey Rodin 2019-05-14 12:38:21 +03:00 committed by GitHub
commit e087a04f00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,14 +55,14 @@ mysql_query() {
mysql_dump() {
err="/tmp/e.mysql"
mysqldump --defaults-file=$mycnf --single-transaction -r $1 $2 2> $err
mysqldump --defaults-file=$mycnf --single-transaction --max_allowed_packet=100M -r $1 $2 2> $err
if [ '0' -ne "$?" ]; then
rm -rf $tmpdir
if [ "$notify" != 'no' ]; then
echo -e "Can't dump database $database\n$(cat $err)" |\
$SENDMAIL -s "$subj" $email
fi
echo "Error: dump $database failed"
echo "Error: dump $database failed\n$(cat $err)"
log_event "$E_DB" "$ARGUMENTS"
exit $E_DB
fi