|
427 | 427 | catch_all=> |
428 | 428 | 'ALTER ... OWNER commands (except LARGE OBJECTs and PUBLICATIONs)', |
429 | 429 | regexp=>qr/^ALTER COLLATION test0 OWNER TO .*;/m, |
| 430 | +collation=> 1, |
430 | 431 | like=> { |
431 | 432 | binary_upgrade=> 1, |
432 | 433 | clean=> 1, |
|
1707 | 1708 | create_sql=>'COMMENT ON COLLATION test0 |
1708 | 1709 | IS\'comment on test0 collation\';', |
1709 | 1710 | regexp=>qr/^COMMENT ON COLLATION test0 IS 'comment on test0 collation';/m, |
| 1711 | +collation=> 1, |
1710 | 1712 | like=> { |
1711 | 1713 | binary_upgrade=> 1, |
1712 | 1714 | clean=> 1, |
|
2423 | 2425 | regexp=> |
2424 | 2426 | qr/^ |
2425 | 2427 | \QCREATE COLLATION test0 (lc_collate = 'C', lc_ctype = 'C');\E/xm, |
| 2428 | +collation=> 1, |
2426 | 2429 | like=> { |
2427 | 2430 | binary_upgrade=> 1, |
2428 | 2431 | clean=> 1, |
|
6090 | 6093 |
|
6091 | 6094 | my$port =$node->port; |
6092 | 6095 |
|
| 6096 | +# We need to see if this system supports CREATE COLLATION or not |
| 6097 | +# If it doesn't then we will skip all the COLLATION-related tests. |
| 6098 | +my$collation_support = 0; |
| 6099 | +my$collation_check_stderr; |
| 6100 | +$node->psql('postgres',"CREATE COLLATION testing FROM\"C\"; DROP COLLATION testing;", on_error_stop => 0, stderr =>\$collation_check_stderr); |
| 6101 | +
|
| 6102 | +if ($collation_check_stderr !~ /ERROR: /) |
| 6103 | +{ |
| 6104 | +$collation_support = 1; |
| 6105 | +} |
| 6106 | +
|
6093 | 6107 | # Start with number of command_fails_like()*2 tests below (each |
6094 | 6108 | # command_fails_like is actually 2 tests) |
6095 | 6109 | my$num_tests = 12; |
|
6115 | 6129 | # Then count all the tests run against each run |
6116 | 6130 | foreach my$test (sort keys%tests) |
6117 | 6131 | { |
| 6132 | +# Skip any collation-related commands if there is no collation support |
| 6133 | +if (!$collation_support && defined($tests{$test}->{collation})) { |
| 6134 | +next; |
| 6135 | +} |
| 6136 | +
|
6118 | 6137 | if ($tests{$test}->{like}->{$test_key}) |
6119 | 6138 | { |
6120 | 6139 | $num_tests++; |
|
6181 | 6200 | { |
6182 | 6201 | if ($tests{$test}->{create_sql}) |
6183 | 6202 | { |
| 6203 | +# Skip any collation-related commands if there is no collation support |
| 6204 | +if (!$collation_support && defined($tests{$test}->{collation})) { |
| 6205 | +next; |
| 6206 | +} |
| 6207 | +
|
6184 | 6208 | $create_sql .=$tests{$test}->{create_sql}; |
6185 | 6209 | } |
6186 | 6210 | } |
|
6258 | 6282 |
|
6259 | 6283 | foreach my$test (sort keys%tests) |
6260 | 6284 | { |
| 6285 | +# Skip any collation-related commands if there is no collation support |
| 6286 | +if (!$collation_support && defined($tests{$test}->{collation})) { |
| 6287 | +next; |
| 6288 | +} |
| 6289 | +
|
6261 | 6290 | if ($tests{$test}->{like}->{$test_key}) |
6262 | 6291 | { |
6263 | 6292 | like($output_file,$tests{$test}->{regexp}, "$run: dumps$test"); |
|