|
3 | 3 | use warnings;
|
4 | 4 | use PostgresNode;
|
5 | 5 | use TestLib;
|
6 |
| -use Test::More tests => 20; |
| 6 | +use Test::More tests => 22; |
7 | 7 |
|
8 | 8 | # Initialize publisher node
|
9 | 9 | my $node_publisher = get_new_node('publisher');
|
|
168 | 168 | local|2.2|bar|2),
|
169 | 169 | 'update works with different column order and subscriber local values');
|
170 | 170 |
|
| 171 | +# check behavior with toasted values |
| 172 | + |
| 173 | +$node_publisher->safe_psql('postgres', |
| 174 | + "UPDATE tab_mixed SET b = repeat('xyzzy', 100000) WHERE a = 2"); |
| 175 | + |
| 176 | +$node_publisher->wait_for_catchup('tap_sub'); |
| 177 | + |
| 178 | +$result = $node_subscriber->safe_psql('postgres', |
| 179 | + "SELECT a, length(b), c, d FROM tab_mixed ORDER BY a"); |
| 180 | +is( $result, qq(1|3|1.1|local |
| 181 | +2|500000|2.2|local), |
| 182 | + 'update transmits large column value'); |
| 183 | + |
| 184 | +$node_publisher->safe_psql('postgres', |
| 185 | + "UPDATE tab_mixed SET c = 3.3 WHERE a = 2"); |
| 186 | + |
| 187 | +$node_publisher->wait_for_catchup('tap_sub'); |
| 188 | + |
| 189 | +$result = $node_subscriber->safe_psql('postgres', |
| 190 | + "SELECT a, length(b), c, d FROM tab_mixed ORDER BY a"); |
| 191 | +is( $result, qq(1|3|1.1|local |
| 192 | +2|500000|3.3|local), |
| 193 | + 'update with non-transmitted large column value'); |
| 194 | + |
171 | 195 | # check behavior with dropped columns
|
172 | 196 |
|
| 197 | +# this update should get transmitted before the column goes away |
| 198 | +$node_publisher->safe_psql('postgres', |
| 199 | + "UPDATE tab_mixed SET b = 'bar', c = 2.2 WHERE a = 2"); |
| 200 | + |
173 | 201 | $node_publisher->safe_psql('postgres', "ALTER TABLE tab_mixed DROP COLUMN b");
|
| 202 | + |
174 | 203 | $node_publisher->safe_psql('postgres',
|
175 | 204 | "UPDATE tab_mixed SET c = 11.11 WHERE a = 1");
|
176 | 205 |
|
|
0 commit comments