2028
2030
TEST_REPLICATION
2032
'show_binlog.sh' => <<'SHOW_BINLOG',
2036
curdir="_HOME_DIR_/_SANDBOXDIR_"
2041
echo "$curdir/data not found"
2046
[ -z "$pattern" -o "$pattern" == 'N' ] && pattern='[0-9]*'
2047
if [ "$pattern" == "-h" -o "$pattern" == "--help" -o "$pattern" == "-help" -o "$pattern" == "help" ]
2049
echo "# Usage: $0 [BINLOG_PATTERN] [pager] "
2050
echo "# Where BINLOG_PATTERN is a number, or part of a number used after 'mysql-bin'"
2051
echo "# (The default is '[0-9]*]': you can use 'N' to confirm the default pattern)"
2052
echo "# The default 'pager' is 'less'. You may use 'vim -', or 'grep GTID_NEXT', or whatever is right"
2054
echo "# ./show_binlog 000012 'vim -'"
2055
echo "# ./show_binlog N 'grep -i \"CREATE TABLE\"'"
2059
last_binlog=$(ls -lotr data/mysql-bin.$pattern | tail -n 1 | awk '{print $NF}')
2061
if [ -z "$last_binlog" ]
2063
echo "No binlog found in $curdir/data"
2074
(printf "#\n# using '$pager' with $last_binlog\n#\n" ; ./my sqlbinlog $last_binlog ) | $pager
2078
'add_option.sh' => <<'ADD_OPTION',
2082
curdir="_HOME_DIR_/_SANDBOXDIR_"
2087
echo "# Syntax $0 options-for-my.cnf [more options] "
2094
option_exists=$(grep $OPTION ./my.sandbox.cnf)
2095
if [ -z "$option_exists" ]
2097
echo "$OPTION" >> my.sandbox.cnf
2098
echo "# option '$OPTION' added to configuration file"
2101
echo "# option '$OPTION' already exists configuration file"
2105
if [ -n "$CHANGED" ]
2032
2114
# --- END SCRIPTS IN CODE ---
2034
2116
my $license_text = <<'LICENSE';
2035
2117
# The MySQL Sandbox
2036
# Copyright (C) 2006-2013 Giuseppe Maxia
2118
# Copyright (C) 2006-2015 Giuseppe Maxia
2037
2119
# Contacts: http://datacharmer.org
2039
2121
# This program is free software; you can redistribute it and/or modify