mirror of
https://github.com/postgres/postgres.git
synced 2025-06-01 14:21:49 +03:00
Add test coverage for "unchanged toast column" replication code path.
It seems pretty unacceptable to have no regression test coverage for this aspect of the logical replication protocol, especially given the bugs we've found in related code. Discussion: https://postgr.es/m/16129-a0c0f48e71741e5f@postgresql.org
This commit is contained in:
parent
5d3fcb53a6
commit
8b46acf7c4
@ -3,7 +3,7 @@ use strict;
|
||||
use warnings;
|
||||
use PostgresNode;
|
||||
use TestLib;
|
||||
use Test::More tests => 19;
|
||||
use Test::More tests => 21;
|
||||
|
||||
# Initialize publisher node
|
||||
my $node_publisher = get_new_node('publisher');
|
||||
@ -157,9 +157,40 @@ is( $result, qq(local|1.1|baz|1
|
||||
local|2.2|bar|2),
|
||||
'update works with different column order and subscriber local values');
|
||||
|
||||
# check behavior with toasted values
|
||||
|
||||
$node_publisher->safe_psql('postgres',
|
||||
"UPDATE tab_mixed SET b = repeat('xyzzy', 100000) WHERE a = 2");
|
||||
|
||||
$node_publisher->poll_query_until('postgres', $caughtup_query)
|
||||
or die "Timed out while waiting for subscriber to catch up";
|
||||
|
||||
$result = $node_subscriber->safe_psql('postgres',
|
||||
"SELECT a, length(b), c, d FROM tab_mixed ORDER BY a");
|
||||
is( $result, qq(1|3|1.1|local
|
||||
2|500000|2.2|local),
|
||||
'update transmits large column value');
|
||||
|
||||
$node_publisher->safe_psql('postgres',
|
||||
"UPDATE tab_mixed SET c = 3.3 WHERE a = 2");
|
||||
|
||||
$node_publisher->poll_query_until('postgres', $caughtup_query)
|
||||
or die "Timed out while waiting for subscriber to catch up";
|
||||
|
||||
$result = $node_subscriber->safe_psql('postgres',
|
||||
"SELECT a, length(b), c, d FROM tab_mixed ORDER BY a");
|
||||
is( $result, qq(1|3|1.1|local
|
||||
2|500000|3.3|local),
|
||||
'update with non-transmitted large column value');
|
||||
|
||||
# check behavior with dropped columns
|
||||
|
||||
# this update should get transmitted before the column goes away
|
||||
$node_publisher->safe_psql('postgres',
|
||||
"UPDATE tab_mixed SET b = 'bar', c = 2.2 WHERE a = 2");
|
||||
|
||||
$node_publisher->safe_psql('postgres', "ALTER TABLE tab_mixed DROP COLUMN b");
|
||||
|
||||
$node_publisher->safe_psql('postgres',
|
||||
"UPDATE tab_mixed SET c = 11.11 WHERE a = 1");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user