mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-12-17 02:00:59 +08:00
Use just RAND() instead of RAND() + NOW() to avoid be coerced to an int and therefore not sub-second safe.
This commit is contained in:
@@ -315,7 +315,7 @@ sub wait_for_slaves {
|
||||
my $self = shift;
|
||||
my $master_dbh = $self->get_dbh_for('master');
|
||||
my $slave2_dbh = $self->get_dbh_for('slave2');
|
||||
my ($ping) = $master_dbh->selectrow_array("SELECT MD5(RAND() + NOW())");
|
||||
my ($ping) = $master_dbh->selectrow_array("SELECT MD5(RAND())");
|
||||
$master_dbh->do("UPDATE percona_test.sentinel SET ping='$ping' WHERE id=1");
|
||||
PerconaTest::wait_until(
|
||||
sub {
|
||||
|
||||
@@ -291,7 +291,7 @@ case $opt in
|
||||
echo "OK"
|
||||
fi
|
||||
../util/checksum-test-dataset
|
||||
ping=$(/tmp/12345/use -ss -e "SELECT MD5(RAND() + NOW())")
|
||||
ping=$(/tmp/12345/use -ss -e "SELECT MD5(RAND())")
|
||||
/tmp/12345/use -e "create table percona_test.sentinel(id int primary key, ping varchar(64) not null default '')"
|
||||
/tmp/12345/use -e "insert into percona_test.sentinel(id, ping) values(1, '$ping')";
|
||||
echo -n "Waiting for replication to finish..."
|
||||
|
||||
Reference in New Issue
Block a user