mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-10-20 09:40:38 +00:00
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:
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
err() {
|
die() {
|
||||||
echo
|
echo
|
||||||
for msg; do
|
for msg; do
|
||||||
echo $msg
|
echo $msg
|
||||||
@@ -12,44 +12,25 @@ err() {
|
|||||||
# Sanity check the cmd line options.
|
# Sanity check the cmd line options.
|
||||||
# ###########################################################################
|
# ###########################################################################
|
||||||
if [ $# -lt 1 ]; then
|
if [ $# -lt 1 ]; then
|
||||||
err "Usage: load-sakila-db PORT"
|
die "Usage: load-sakila-db PORT"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PORT=$1
|
PORT=$1
|
||||||
|
|
||||||
if [ ! -d "/tmp/$PORT" ]; then
|
if [ ! -d "/tmp/$PORT" ]; then
|
||||||
err "MySQL test server does not exist: /tmp/$PORT"
|
die "MySQL test server does not exist: /tmp/$PORT"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ###########################################################################
|
# ###########################################################################
|
||||||
# Sanity check the environment.
|
# Sanity check the environment.
|
||||||
# ###########################################################################
|
# ###########################################################################
|
||||||
if [ -z "$PERCONA_TOOLKIT_BRANCH" ]; then
|
if [ -z "$PERCONA_TOOLKIT_BRANCH" ]; then
|
||||||
err "PERCONA_TOOLKIT_BRANCH environment variable is not set."
|
die "PERCONA_TOOLKIT_BRANCH environment variable is not set."
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d "$PERCONA_TOOLKIT_BRANCH" ]; then
|
if [ ! -d "$PERCONA_TOOLKIT_BRANCH" ]; then
|
||||||
err "Invalid PERCONA_TOOLKIT_BRANCH directory: $PERCONA_TOOLKIT_BRANCH"
|
die "Invalid PERCONA_TOOLKIT_BRANCH directory: $PERCONA_TOOLKIT_BRANCH"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $PERCONA_TOOLKIT_BRANCH/sandbox
|
/tmp/$PORT/use < $PERCONA_TOOLKIT_BRANCH/sandbox/sakila.sql
|
||||||
|
exit $?
|
||||||
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
|
|
||||||
|
443
sandbox/sakila.sql
Normal file
443
sandbox/sakila.sql
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user