|
3 | 3 | use warnings;
|
4 | 4 | use PostgresNode;
|
5 | 5 | use TestLib;
|
6 |
| -use Test::More tests => 19; |
| 6 | +use Test::More tests => 21; |
7 | 7 |
|
8 | 8 | # Initialize publisher node
|
9 | 9 | my $node_publisher = get_new_node('publisher');
|
|
157 | 157 | local|2.2|bar|2),
|
158 | 158 | 'update works with different column order and subscriber local values');
|
159 | 159 |
|
| 160 | +# check behavior with toasted values |
| 161 | + |
| 162 | +$node_publisher->safe_psql('postgres', |
| 163 | + "UPDATE tab_mixed SET b = repeat('xyzzy', 100000) WHERE a = 2"); |
| 164 | + |
| 165 | +$node_publisher->poll_query_until('postgres', $caughtup_query) |
| 166 | + or die "Timed out while waiting for subscriber to catch up"; |
| 167 | + |
| 168 | +$result = $node_subscriber->safe_psql('postgres', |
| 169 | + "SELECT a, length(b), c, d FROM tab_mixed ORDER BY a"); |
| 170 | +is( $result, qq(1|3|1.1|local |
| 171 | +2|500000|2.2|local), |
| 172 | + 'update transmits large column value'); |
| 173 | + |
| 174 | +$node_publisher->safe_psql('postgres', |
| 175 | + "UPDATE tab_mixed SET c = 3.3 WHERE a = 2"); |
| 176 | + |
| 177 | +$node_publisher->poll_query_until('postgres', $caughtup_query) |
| 178 | + or die "Timed out while waiting for subscriber to catch up"; |
| 179 | + |
| 180 | +$result = $node_subscriber->safe_psql('postgres', |
| 181 | + "SELECT a, length(b), c, d FROM tab_mixed ORDER BY a"); |
| 182 | +is( $result, qq(1|3|1.1|local |
| 183 | +2|500000|3.3|local), |
| 184 | + 'update with non-transmitted large column value'); |
| 185 | + |
160 | 186 | # check behavior with dropped columns
|
161 | 187 |
|
| 188 | +# this update should get transmitted before the column goes away |
| 189 | +$node_publisher->safe_psql('postgres', |
| 190 | + "UPDATE tab_mixed SET b = 'bar', c = 2.2 WHERE a = 2"); |
| 191 | + |
162 | 192 | $node_publisher->safe_psql('postgres', "ALTER TABLE tab_mixed DROP COLUMN b");
|
| 193 | + |
163 | 194 | $node_publisher->safe_psql('postgres',
|
164 | 195 | "UPDATE tab_mixed SET c = 11.11 WHERE a = 1");
|
165 | 196 |
|
|
0 commit comments