The bug766033.sh test is not portable
The bug766039.sh test introduced with https:/
- the values for 'count' and 'seek' are in 512-byte units. So we actually write 8 MB of zeroes starting with the 512 KB offset. Is that intentional?
- On *BSD and OSX "wc" has a different output format (the number is prepended with a tab character). But the next check compares "$COUNT" and "1" as strings rather than numbers. So that expression is always false. Besides, we don't really need the count of matched lines, all we need is the grep exit code (i.e. if there was at least one matching line).
> set +e
> COUNT=`xtrabackup --backup --datadir=
> | grep "File ./sakila/rental.ibd seems to be corrupted" | wc -l `
> set -e
> if [ "$COUNT" != "1" ] ; then
> vlog "test failed"
> exit 1
is equivalent to the following 2 lines that are also more portable:
> grep -q "File ./sakila/rental.ibd seems to be corrupted" $OUTFILE