Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9ffe227

Browse files
committed
Adjust createdb TAP tests to work on recent OpenBSD.
We found last February that the error-case tests added by commit008cf04 failed on OpenBSD, because that platform doesn't reallycheck locale names. At the time it seemed that that was only an issuefor LC_CTYPE, but testing on a more recent version of OpenBSD showsthat it's now equally lax about LC_COLLATE.Rather than dropping the LC_COLLATE test too, put back LC_CTYPE(revertingc4b0edb), and adjust these tests to accept the differenterror message that we get if setlocale() doesn't reject a bogus localename. The point of these tests is not really what the backend doeswith the locale name, but to show that createdb quotes funny localenames 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
1 parentb8d0cda commit9ffe227

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

‎src/bin/scripts/t/020_createdb.pl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use PostgresNode;
55
use TestLib;
6-
use Test::Moretests=>19;
6+
use Test::Moretests=>22;
77

88
program_help_ok('createdb');
99
program_version_ok('createdb');
@@ -31,12 +31,20 @@
3131
1,
3232
[qr/^$/],
3333
[qr/^createdb: error: "foo'; SELECT '1" is not a valid encoding name/s],
34-
'createdb with incorrect --lc-collate');
34+
'createdb with incorrect --encoding');
3535
$node->command_checks_all(
3636
['createdb','--lc-collate',"foo'; SELECT '1",'foobar2' ],
3737
1,
3838
[qr/^$/],
3939
[
40-
qr/^createdb: error: database creation failed: ERROR: invalid locale name/s
40+
qr/^createdb: error: database creation failed: ERROR: invalid locale name|^createdb: error: database creation failed: ERROR: new collation\(foo'; SELECT '1\) is incompatible with the collation of the template database/s
4141
],
4242
'createdb with incorrect --lc-collate');
43+
$node->command_checks_all(
44+
['createdb','--lc-ctype',"foo'; SELECT '1",'foobar2' ],
45+
1,
46+
[qr/^$/],
47+
[
48+
qr/^createdb: error: database creation failed: ERROR: invalid locale name|^createdb: error: database creation failed: ERROR: new LC_CTYPE\(foo'; SELECT '1\) is incompatible with the LC_CTYPE of the template database/s
49+
],
50+
'createdb with incorrect --lc-ctype');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp