mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-03 02:07:20 +02:00
Adjust createdb TAP tests to work on recent OpenBSD.
We found last February that the error-case tests added by commit008cf0409
failed on OpenBSD, because that platform doesn't really check locale names. At the time it seemed that that was only an issue for LC_CTYPE, but testing on a more recent version of OpenBSD shows that it's now equally lax about LC_COLLATE. Rather than dropping the LC_COLLATE test too, put back LC_CTYPE (revertingc4b0edb07
), and adjust these tests to accept the different error message that we get if setlocale() doesn't reject a bogus locale name. The point of these tests is not really what the backend does with the locale name, but to show that createdb quotes funny locale names safely; so we're not losing test reliability this way. Back-patch as appropriate. Discussion: https://postgr.es/m/231373.1610058324@sss.pgh.pa.us
This commit is contained in:
parent
a112efa6a0
commit
c67fea09da
@ -3,7 +3,7 @@ use warnings;
|
|||||||
|
|
||||||
use PostgresNode;
|
use PostgresNode;
|
||||||
use TestLib;
|
use TestLib;
|
||||||
use Test::More tests => 19;
|
use Test::More tests => 22;
|
||||||
|
|
||||||
program_help_ok('createdb');
|
program_help_ok('createdb');
|
||||||
program_version_ok('createdb');
|
program_version_ok('createdb');
|
||||||
@ -31,12 +31,20 @@ $node->command_checks_all(
|
|||||||
1,
|
1,
|
||||||
[qr/^$/],
|
[qr/^$/],
|
||||||
[qr/^createdb: "foo'; SELECT '1" is not a valid encoding name/s],
|
[qr/^createdb: "foo'; SELECT '1" is not a valid encoding name/s],
|
||||||
'createdb with incorrect --lc-collate');
|
'createdb with incorrect --encoding');
|
||||||
$node->command_checks_all(
|
$node->command_checks_all(
|
||||||
[ 'createdb', '--lc-collate', "foo'; SELECT '1", 'foobar2' ],
|
[ 'createdb', '--lc-collate', "foo'; SELECT '1", 'foobar2' ],
|
||||||
1,
|
1,
|
||||||
[qr/^$/],
|
[qr/^$/],
|
||||||
[
|
[
|
||||||
qr/^createdb: database creation failed: ERROR: invalid locale name/s
|
qr/^createdb: database creation failed: ERROR: invalid locale name|^createdb: database creation failed: ERROR: new collation \(foo'; SELECT '1\) is incompatible with the collation of the template database/s
|
||||||
],
|
],
|
||||||
'createdb with incorrect --lc-collate');
|
'createdb with incorrect --lc-collate');
|
||||||
|
$node->command_checks_all(
|
||||||
|
[ 'createdb', '--lc-ctype', "foo'; SELECT '1", 'foobar2' ],
|
||||||
|
1,
|
||||||
|
[qr/^$/],
|
||||||
|
[
|
||||||
|
qr/^createdb: database creation failed: ERROR: invalid locale name|^createdb: database creation failed: ERROR: new LC_CTYPE \(foo'; SELECT '1\) is incompatible with the LC_CTYPE of the template database/s
|
||||||
|
],
|
||||||
|
'createdb with incorrect --lc-ctype');
|
||||||
|
Loading…
Reference in New Issue
Block a user