mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 05:29:30 +00:00
PT-1554 Updated DSNs for mysql_random_data_load
This commit is contained in:
@@ -599,9 +599,9 @@ for i in `_seq $NUM`; do
|
|||||||
NEXTFILE=$(($i + 1))
|
NEXTFILE=$(($i + 1))
|
||||||
|
|
||||||
# Sort each file and eliminate empty lines, so 'join' doesn't complain.
|
# Sort each file and eliminate empty lines, so 'join' doesn't complain.
|
||||||
sort "$FILE$i" | grep . > "$FILE$i.tmp"
|
sort -s "$FILE$i" | grep . > "$FILE$i.tmp"
|
||||||
mv "$FILE$i.tmp" "$FILE$i"
|
mv "$FILE$i.tmp" "$FILE$i"
|
||||||
sort "$FILE${NEXTFILE}" | grep . > "$FILE${NEXTFILE}.tmp"
|
sort -s "$FILE${NEXTFILE}" | grep . > "$FILE${NEXTFILE}.tmp"
|
||||||
mv "$FILE${NEXTFILE}.tmp" "$FILE${NEXTFILE}"
|
mv "$FILE${NEXTFILE}.tmp" "$FILE${NEXTFILE}"
|
||||||
|
|
||||||
# Join the files together. This gets slow O(n^2) as we add more files, but
|
# Join the files together. This gets slow O(n^2) as we add more files, but
|
||||||
@@ -610,7 +610,7 @@ for i in `_seq $NUM`; do
|
|||||||
|
|
||||||
# Find the max length of the [numeric only] values in the file so we know how
|
# Find the max length of the [numeric only] values in the file so we know how
|
||||||
# wide to make the columns
|
# wide to make the columns
|
||||||
MAXLEN=`awk '{print $2}' "$FILE${NEXTFILE}" | grep -v '[^0-9]' | awk '{print length($1)}' | sort -rn | head -n1`
|
MAXLEN=`awk '{print $2}' "$FILE${NEXTFILE}" | grep -v '[^0-9]' | awk '{print length($1)}' | sort -rns | head -n1`
|
||||||
mv "$FILE" "$FILE${NEXTFILE}"
|
mv "$FILE" "$FILE${NEXTFILE}"
|
||||||
SPEC="$SPEC %${MAXLEN}d";
|
SPEC="$SPEC %${MAXLEN}d";
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ my $num_rows = 1000;
|
|||||||
my $master_port = 12345;
|
my $master_port = 12345;
|
||||||
|
|
||||||
diag("Loading $num_rows into the table. This might take some time.");
|
diag("Loading $num_rows into the table. This might take some time.");
|
||||||
diag(`util/mysql_random_data_load --host=127.1 --port=$master_port --user=msandbox --password=msandbox employees t1 $num_rows`);
|
diag(`util/mysql_random_data_load --host=127.0.0.1 --port=$master_port --user=msandbox --password=msandbox employees t1 $num_rows`);
|
||||||
diag("$num_rows rows loaded. Starting tests.");
|
diag("$num_rows rows loaded. Starting tests.");
|
||||||
|
|
||||||
$master_dbh->do("FLUSH TABLES");
|
$master_dbh->do("FLUSH TABLES");
|
||||||
|
@@ -46,7 +46,7 @@ $sb->load_file('master', "t/pt-online-schema-change/samples/pt-229.sql");
|
|||||||
|
|
||||||
my $num_rows = 40000;
|
my $num_rows = 40000;
|
||||||
diag("Loading $num_rows into the table. This might take some time.");
|
diag("Loading $num_rows into the table. This might take some time.");
|
||||||
diag(`util/mysql_random_data_load --host=127.1 --port=12345 --user=msandbox --password=msandbox test test_a $num_rows`);
|
diag(`util/mysql_random_data_load --host=127.0.0.1 --port=12345 --user=msandbox --password=msandbox test test_a $num_rows`);
|
||||||
diag("$num_rows rows loaded. Starting tests.");
|
diag("$num_rows rows loaded. Starting tests.");
|
||||||
$master_dbh->do("FLUSH TABLES");
|
$master_dbh->do("FLUSH TABLES");
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ $sb->load_file('master3', "t/pt-online-schema-change/samples/pt-244.sql");
|
|||||||
|
|
||||||
my $num_rows = 1000;
|
my $num_rows = 1000;
|
||||||
diag("Loading $num_rows into the table. This might take some time.");
|
diag("Loading $num_rows into the table. This might take some time.");
|
||||||
diag(`util/mysql_random_data_load --host=127.1 --port=$master3_port --user=msandbox --password=msandbox test t3 $num_rows`);
|
diag(`util/mysql_random_data_load --host=127.0.0.1 --port=$master3_port --user=msandbox --password=msandbox test t3 $num_rows`);
|
||||||
diag("$num_rows rows loaded. Starting tests.");
|
diag("$num_rows rows loaded. Starting tests.");
|
||||||
|
|
||||||
$dbh3->do("FLUSH TABLES");
|
$dbh3->do("FLUSH TABLES");
|
||||||
|
@@ -32,7 +32,7 @@ my $dp = new DSNParser(opts=>$dsn_opts);
|
|||||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||||
my $master_dbh = $sb->get_dbh_for('master');
|
my $master_dbh = $sb->get_dbh_for('master');
|
||||||
my $slave_dbh = $sb->get_dbh_for('slave1');
|
my $slave_dbh = $sb->get_dbh_for('slave1');
|
||||||
my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox';
|
my $master_dsn = 'h=127.0.0.1,P=12345,u=msandbox,p=msandbox';
|
||||||
|
|
||||||
if ( !$master_dbh ) {
|
if ( !$master_dbh ) {
|
||||||
plan skip_all => 'Cannot connect to sandbox master';
|
plan skip_all => 'Cannot connect to sandbox master';
|
||||||
@@ -65,7 +65,7 @@ $sb->load_file('master', "t/pt-online-schema-change/samples/slave_lag.sql");
|
|||||||
|
|
||||||
my $num_rows = 10000;
|
my $num_rows = 10000;
|
||||||
diag("Loading $num_rows into the table. This might take some time.");
|
diag("Loading $num_rows into the table. This might take some time.");
|
||||||
diag(`util/mysql_random_data_load --host=127.1 --port=12345 --user=msandbox --password=msandbox test pt178 $num_rows`);
|
diag(`util/mysql_random_data_load --host=127.0.0.1 --port=12345 --user=msandbox --password=msandbox test pt178 $num_rows`);
|
||||||
|
|
||||||
# Run a full table scan query to ensure the slave is behind the master
|
# Run a full table scan query to ensure the slave is behind the master
|
||||||
# There is no query cache in MySQL 8.0+
|
# There is no query cache in MySQL 8.0+
|
||||||
@@ -89,7 +89,7 @@ like(
|
|||||||
|
|
||||||
# Repeat the test now using --check-slave-lag
|
# Repeat the test now using --check-slave-lag
|
||||||
$args = "$master_dsn,D=test,t=pt178 --execute --chunk-size 1 --max-lag 5 --alter 'ENGINE=InnoDB' "
|
$args = "$master_dsn,D=test,t=pt178 --execute --chunk-size 1 --max-lag 5 --alter 'ENGINE=InnoDB' "
|
||||||
. "--check-slave-lag h=127.1,P=12346,u=msandbox,p=msandbox,D=test,t=sbtest";
|
. "--check-slave-lag h=127.0.0.1,P=12346,u=msandbox,p=msandbox,D=test,t=sbtest";
|
||||||
|
|
||||||
# Run a full table scan query to ensure the slave is behind the master
|
# Run a full table scan query to ensure the slave is behind the master
|
||||||
reset_query_cache($master_dbh, $master_dbh);
|
reset_query_cache($master_dbh, $master_dbh);
|
||||||
|
Reference in New Issue
Block a user