Fix sakila.sql so it loads on 5.0. Only wait 60s for replication for test-env start.

This commit is contained in:
Daniel Nichter
2012-12-03 20:06:47 +00:00
parent 6282ee8796
commit 6c9f4c0722
6 changed files with 140 additions and 498 deletions

View File

@@ -246,6 +246,11 @@ set_mysql_version() {
fi
}
_seq() {
local i="$1"
awk "BEGIN { for(i=1; i<=$i; i++) print i; }"
}
# ###########################################################################
# Sanity check the cmd line options.
# ###########################################################################
@@ -326,13 +331,18 @@ case $opt in
/tmp/12345/use -e "create table percona_test.sentinel(id int primary key, ping varchar(64) not null default '')"
/tmp/12345/use -e "insert into percona_test.sentinel(id, ping) values(1, '$ping')";
echo -n "Waiting for replication to finish..."
while true; do
for i in $(_seq 60); do
pong=$(/tmp/12347/use -ss -e 'select ping from percona_test.sentinel where id=1' 2>/dev/null)
[ "$ping" = "$pong" ] && break
echo -n '.'
sleep 1
done
echo ' OK'
if [ "$ping" = "$pong" ]; then
echo " OK"
else
echo " FAILED"
exit_status=$((exit_status | 1))
fi
fi
fi
if [ $exit_status -eq 0 ]; then