Use direct mysqldump for sakila to avoid PXC MyISAM bugs and so that tests like t/pt-online-schema-change/basics.t can restore sakila easily.

This commit is contained in:
Daniel Nichter
2012-11-28 01:29:49 +00:00
parent 5343d43528
commit d30265d245
2 changed files with 450 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/sh
err() {
die() {
echo
for msg; do
echo $msg
@@ -12,44 +12,25 @@ err() {
# Sanity check the cmd line options.
# ###########################################################################
if [ $# -lt 1 ]; then
err "Usage: load-sakila-db PORT"
exit 1
die "Usage: load-sakila-db PORT"
fi
PORT=$1
if [ ! -d "/tmp/$PORT" ]; then
err "MySQL test server does not exist: /tmp/$PORT"
exit 1
die "MySQL test server does not exist: /tmp/$PORT"
fi
# ###########################################################################
# Sanity check the environment.
# ###########################################################################
if [ -z "$PERCONA_TOOLKIT_BRANCH" ]; then
err "PERCONA_TOOLKIT_BRANCH environment variable is not set."
exit 1
die "PERCONA_TOOLKIT_BRANCH environment variable is not set."
fi
if [ ! -d "$PERCONA_TOOLKIT_BRANCH" ]; then
err "Invalid PERCONA_TOOLKIT_BRANCH directory: $PERCONA_TOOLKIT_BRANCH"
exit 1
die "Invalid PERCONA_TOOLKIT_BRANCH directory: $PERCONA_TOOLKIT_BRANCH"
fi
cd $PERCONA_TOOLKIT_BRANCH/sandbox
exit_status=0
/tmp/$PORT/use < sakila-db/sakila-schema.sql
exit_status=$((exit_status | $?))
# We can remove this once PXC's triggers can handle myisam tables
if [ "${2:-""}" = "cluster" ]; then
/tmp/$PORT/use -e "ALTER TABLE sakila.film_text DROP KEY idx_title_description"
/tmp/$PORT/use -e "ALTER TABLE sakila.film_text ENGINE = 'InnoDB'"
fi
/tmp/$PORT/use < sakila-db/sakila-data.sql
exit_status=$((exit_status | $?))
exit $exit_status
/tmp/$PORT/use < $PERCONA_TOOLKIT_BRANCH/sandbox/sakila.sql
exit $?

443
sandbox/sakila.sql Normal file

File diff suppressed because one or more lines are too long