mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Finish pgindent run for 9.6: Perl files.
This commit is contained in:
@ -16,7 +16,7 @@ sub test_index_replay
|
||||
# Wait for standby to catch up
|
||||
my $applname = $node_standby->name;
|
||||
my $caughtup_query =
|
||||
"SELECT pg_current_xlog_location() <= write_location FROM pg_stat_replication WHERE application_name = '$applname';";
|
||||
"SELECT pg_current_xlog_location() <= write_location FROM pg_stat_replication WHERE application_name = '$applname';";
|
||||
$node_master->poll_query_until('postgres', $caughtup_query)
|
||||
or die "Timed out while waiting for standby 1 to catch up";
|
||||
|
||||
@ -56,20 +56,25 @@ $node_standby->start;
|
||||
# Create some bloom index on master
|
||||
$node_master->psql("postgres", "CREATE EXTENSION bloom;");
|
||||
$node_master->psql("postgres", "CREATE TABLE tst (i int4, t text);");
|
||||
$node_master->psql("postgres", "INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series(1,100000) i;");
|
||||
$node_master->psql("postgres", "CREATE INDEX bloomidx ON tst USING bloom (i, t) WITH (col1 = 3);");
|
||||
$node_master->psql("postgres",
|
||||
"INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series(1,100000) i;"
|
||||
);
|
||||
$node_master->psql("postgres",
|
||||
"CREATE INDEX bloomidx ON tst USING bloom (i, t) WITH (col1 = 3);");
|
||||
|
||||
# Test that queries give same result
|
||||
test_index_replay('initial');
|
||||
|
||||
# Run 10 cycles of table modification. Run test queries after each modification.
|
||||
for my $i (1..10)
|
||||
for my $i (1 .. 10)
|
||||
{
|
||||
$node_master->psql("postgres", "DELETE FROM tst WHERE i = $i;");
|
||||
test_index_replay("delete $i");
|
||||
$node_master->psql("postgres", "VACUUM tst;");
|
||||
test_index_replay("vacuum $i");
|
||||
my ($start, $end) = (100001 + ($i - 1) * 10000, 100000 + $i * 10000);
|
||||
$node_master->psql("postgres", "INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series($start,$end) i;");
|
||||
$node_master->psql("postgres",
|
||||
"INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM generate_series($start,$end) i;"
|
||||
);
|
||||
test_index_replay("insert $i");
|
||||
}
|
||||
|
Reference in New Issue
Block a user