Skip to content
Snippets Groups Projects

mysql dump: update check for empty data

Merged Hahn Axel (hahn) requested to merge update-localdump-to-classlike-functions into master
2 files
+ 7
7
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -93,15 +93,15 @@ function mysql.db.dump(){
@@ -93,15 +93,15 @@ function mysql.db.dump(){
"$_dbname" 2>&1
"$_dbname" 2>&1
fetchrc >/dev/null
fetchrc >/dev/null
zgrep -iE "(CREATE|INSERT)" "$_dumpfile" >/dev/null
if [ $myrc -eq 0 ]; then
typeset -i local _rc2=$?
zgrep -iE "(CREATE|INSERT)" "$_dumpfile" >/dev/null
test $_rc2 -ne 0 && echo "ERROR: the dump does not contain any CREATE or INSERT statement."
fetchrc >/dev/null
 
test $myrc -ne 0 && echo "ERROR: no data - the dump doesn't contain any CREATE or INSERT statement."
 
fi
typeset -i local myrc+=$_rc2
test $myrc -eq 0 && mysql_COUNT_DUMPS+=1
test $myrc -eq 0 && mysql_COUNT_DUMPS+=1
test $myrc -eq 0 || mysql_COUNT_ERRORS+=1
test $myrc -eq 0 || mysql_COUNT_ERRORS+=1
test $myrc -eq 0
}
}
# import [file] --> [database]
# import [file] --> [database]
Loading