diff --git a/bin/pt-mext b/bin/pt-mext index 0e522065..af0f6b4b 100755 --- a/bin/pt-mext +++ b/bin/pt-mext @@ -599,9 +599,9 @@ for i in `_seq $NUM`; do NEXTFILE=$(($i + 1)) # 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" - sort "$FILE${NEXTFILE}" | grep . > "$FILE${NEXTFILE}.tmp" + sort -s "$FILE${NEXTFILE}" | grep . > "$FILE${NEXTFILE}.tmp" mv "$FILE${NEXTFILE}.tmp" "$FILE${NEXTFILE}" # 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 # 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}" SPEC="$SPEC %${MAXLEN}d"; diff --git a/t/pt-online-schema-change/pt-1455.t b/t/pt-online-schema-change/pt-1455.t index 1af031fd..78d86389 100644 --- a/t/pt-online-schema-change/pt-1455.t +++ b/t/pt-online-schema-change/pt-1455.t @@ -53,7 +53,7 @@ my $num_rows = 1000; my $master_port = 12345; 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."); $master_dbh->do("FLUSH TABLES"); diff --git a/t/pt-online-schema-change/pt-229.t b/t/pt-online-schema-change/pt-229.t index d91d1fdf..2b8ed8c3 100644 --- a/t/pt-online-schema-change/pt-229.t +++ b/t/pt-online-schema-change/pt-229.t @@ -46,7 +46,7 @@ $sb->load_file('master', "t/pt-online-schema-change/samples/pt-229.sql"); my $num_rows = 40000; 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."); $master_dbh->do("FLUSH TABLES"); diff --git a/t/pt-online-schema-change/pt-244.t b/t/pt-online-schema-change/pt-244.t index f0c4dd50..f3e351a1 100644 --- a/t/pt-online-schema-change/pt-244.t +++ b/t/pt-online-schema-change/pt-244.t @@ -53,7 +53,7 @@ $sb->load_file('master3', "t/pt-online-schema-change/samples/pt-244.sql"); my $num_rows = 1000; 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."); $dbh3->do("FLUSH TABLES"); diff --git a/t/pt-online-schema-change/slave_lag.t b/t/pt-online-schema-change/slave_lag.t index 58c13f70..c57d7a44 100644 --- a/t/pt-online-schema-change/slave_lag.t +++ b/t/pt-online-schema-change/slave_lag.t @@ -32,7 +32,7 @@ my $dp = new DSNParser(opts=>$dsn_opts); my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); my $master_dbh = $sb->get_dbh_for('master'); 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 ) { 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; 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 # There is no query cache in MySQL 8.0+ @@ -89,7 +89,7 @@ like( # 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' " - . "--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 reset_query_cache($master_dbh, $master_dbh);