postgresql/src
Andres Freund ac00ff1c96 Add test of various escape functions
As highlighted by the prior commit, writing correct escape functions is less
trivial than one might hope.

This test module tries to verify that different escaping functions behave
reasonably. It e.g. tests:

- Invalidly encoded input to an escape function leads to invalidly encoded
  output

- Trailing incomplete multi-byte characters are handled sensibly

- Escaped strings are parsed as single statement by psql's parser (which
  derives from the backend parser)

There are further tests that would be good to add. But even in the current
state it was rather useful for writing the fix in the prior commit.

Reviewed-by: Noah Misch <noah@leadboat.com>
Backpatch-through: 13
Security: CVE-2025-1094
2025-02-10 10:03:37 -05:00
..
backend Cache NO ACTION foreign keys separately from RESTRICT foreign keys 2025-02-09 13:43:56 +01:00
bin Specify the encoding of input to fmtId() 2025-02-10 10:03:37 -05:00
common Add pg_encoding_set_invalid() 2025-02-10 10:03:37 -05:00
fe_utils Fix handling of invalidly encoded data in escaping functions 2025-02-10 10:03:37 -05:00
include Specify the encoding of input to fmtId() 2025-02-10 10:03:37 -05:00
interfaces Fix handling of invalidly encoded data in escaping functions 2025-02-10 10:03:37 -05:00
makefiles Update copyright for 2025 2025-01-01 11:21:55 -05:00
pl Virtual generated columns 2025-02-07 09:46:59 +01:00
port Avoid breaking SJIS encoding while de-backslashing Windows paths. 2025-01-29 14:24:36 -05:00
template thread-safety: gmtime_r(), localtime_r() 2024-08-23 07:43:04 +02:00
test Add test of various escape functions 2025-02-10 10:03:37 -05:00
timezone Update time zone data files to tzdata release 2025a. 2025-01-20 16:49:15 -05:00
tools Add test of various escape functions 2025-02-10 10:03:37 -05:00
tutorial Doc: simplify the tutorial's window-function examples. 2025-01-21 14:43:21 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Convert sepgsql tests to TAP 2025-01-24 12:39:47 +01:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00