aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-09-16 11:10:41 +0200
committerPeter Eisentraut <peter@eisentraut.org>2022-09-16 11:15:55 +0200
commit8135d0bd455217bd345090bae085b2bbcf62bdb0 (patch)
treeafe3a429eaf031c361f6cfec1f9eb16e4eb9e329 /src
parent148f66d59e2c2fa8bc79918973874e2803892664 (diff)
downloadpostgresql-8135d0bd455217bd345090bae085b2bbcf62bdb0.tar.gz
postgresql-8135d0bd455217bd345090bae085b2bbcf62bdb0.zip
Fix createdb tests for C locale
If the createdb tests run under the C locale, the database cluster will be initialized with encoding SQL_ASCII. With the checks added in c7db01e325a530ec38ec7ba57cd3ed32e123e33c, this will cause several ICU-related tests to fail because SQL_ASCII is not supported by ICU. To work around that, use initdb option -E UTF8 for those tests to get past that check.
Diffstat (limited to 'src')
-rw-r--r--src/bin/scripts/t/020_createdb.pl10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/bin/scripts/t/020_createdb.pl b/src/bin/scripts/t/020_createdb.pl
index e95f200d0b9..b87d8fc63b5 100644
--- a/src/bin/scripts/t/020_createdb.pl
+++ b/src/bin/scripts/t/020_createdb.pl
@@ -31,13 +31,16 @@ if ($ENV{with_icu} eq 'yes')
# locale set. It would succeed if template0 used the icu
# provider. XXX Maybe split into multiple tests?
$node->command_fails(
- [ 'createdb', '-T', 'template0', '--locale-provider=icu', 'foobar4' ],
+ [
+ 'createdb', '-T', 'template0', '-E', 'UTF8',
+ '--locale-provider=icu', 'foobar4'
+ ],
'create database with ICU fails without ICU locale specified');
$node->issues_sql_like(
[
'createdb', '-T',
- 'template0', '--locale-provider=icu',
+ 'template0', '-E', 'UTF8', '--locale-provider=icu',
'--icu-locale=en', 'foobar5'
],
qr/statement: CREATE DATABASE foobar5 .* LOCALE_PROVIDER icu ICU_LOCALE 'en'/,
@@ -45,7 +48,8 @@ if ($ENV{with_icu} eq 'yes')
$node->command_fails(
[
- 'createdb', '-T', 'template0', '--locale-provider=icu',
+ 'createdb', '-T', 'template0', '-E', 'UTF8',
+ '--locale-provider=icu',
'--icu-locale=@colNumeric=lower', 'foobarX'
],
'fails for invalid ICU locale');