summaryrefslogtreecommitdiff
path: root/src/test/regress/input/create_function_1.source
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2025-02-10 10:03:40 -0500
committerAndres Freund <andres@anarazel.de>2025-02-10 10:03:40 -0500
commitdb3eb0e8256a7089d16cb6ed1ea7a65654c0e105 (patch)
tree0ec4af31c90820568052d53b49ed0e31d7f7f5d9 /src/test/regress/input/create_function_1.source
parent00f1a1f665f078f5abadbf8baddc5c187fba80f8 (diff)
Add pg_encoding_set_invalid()
There are cases where we cannot / do not want to error out for invalidly encoded input. In such cases it can be useful to replace e.g. an incomplete multi-byte characters with bytes that will trigger an error when getting validated as part of a larger string. Unfortunately, until now, for some encoding no such sequence existed. For those encodings this commit removes one previously accepted input combination - we consider that to be ok, as the chosen bytes are outside of the valid ranges for the encodings, we just previously failed to detect that. As we cannot add a new field to pg_wchar_table without breaking ABI, this is implemented "in-line" in the newly added function. Author: Noah Misch <noah@leadboat.com> Reviewed-by: Andres Freund <andres@anarazel.de> Backpatch-through: 13 Security: CVE-2025-1094
Diffstat (limited to 'src/test/regress/input/create_function_1.source')
-rw-r--r--src/test/regress/input/create_function_1.source4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/regress/input/create_function_1.source b/src/test/regress/input/create_function_1.source
index 412e339fcf2..b230a8a6a81 100644
--- a/src/test/regress/input/create_function_1.source
+++ b/src/test/regress/input/create_function_1.source
@@ -62,6 +62,10 @@ CREATE FUNCTION test_atomic_ops()
AS '@libdir@/regress@DLSUFFIX@'
LANGUAGE C;
+CREATE FUNCTION test_enc_setup() RETURNS void
+ AS '@libdir@/regress@DLSUFFIX@', 'test_enc_setup'
+ LANGUAGE C STRICT;
+
-- Tests creating a FDW handler
CREATE FUNCTION test_fdw_handler()
RETURNS fdw_handler