postgresql/src/include
Tom Lane 5f28e6ba7f Avoid assertion due to disconnected NFA sub-graphs in regex parsing.
In commit 08c0d6ad6 which introduced "rainbow" arcs in regex NFAs,
I didn't think terribly hard about what to do when creating the color
complement of a rainbow arc.  Clearly, the complement cannot match any
characters, and I took the easy way out by just not building any arcs
at all in the complement arc set.  That mostly works, but Nikolay
Shaplov found a case where it doesn't: if we decide to delete that
sub-NFA later because it's inside a "{0}" quantifier, delsub()
suffered an assertion failure.  That's because delsub() relies on
the target sub-NFA being fully connected.  That was always true
before, and the best fix seems to be to restore that property.
Hence, invent a new arc type CANTMATCH that can be generated in
place of an empty color complement, and drop it again later when we
start NFA optimization.  (At that point we don't need to do delsub()
any more, and besides there are other cases where NFA optimization can
lead to disconnected subgraphs.)

It appears that this bug has no consequences in a non-assert-enabled
build: there will be some transiently leaked NFA states/arcs, but
they'll get cleaned up eventually.  Still, we don't like assertion
failures, so back-patch to v14 where rainbow arcs were introduced.

Per bug #18708 from Nikolay Shaplov.

Discussion: https://postgr.es/m/18708-f94f2599c9d2c005@postgresql.org
2024-11-15 18:23:38 -05:00
..
access Unpin buffer before inplace update waits for an XID to end. 2024-10-29 09:39:58 -07:00
archive Add macro for customizing an archiving WARNING message. 2024-03-04 15:41:42 -06:00
backup Align blocks in incremental backups to BLCKSZ 2024-04-05 16:30:01 +02:00
bootstrap Update copyright for 2024 2024-01-03 20:49:05 -05:00
catalog Do not summarize WAL if generated with wal_level=minimal. 2024-07-18 12:19:29 -04:00
commands doc: Add better description for rewrite functions in event triggers 2024-10-29 15:35:14 +09:00
common parse_manifest: Use const char * 2024-06-21 07:53:30 +02:00
datatype Update copyright for 2024 2024-01-03 20:49:05 -05:00
executor SQL/JSON: Fix casting for integer EXISTS columns in JSON_TABLE 2024-07-30 10:39:28 +09:00
fe_utils Allow dbname to be written as part of connstring via pg_basebackup's -R option. 2024-03-21 10:50:33 +05:30
foreign Clean up more indent breakage from 6377e12a5. 2024-04-16 13:00:40 -04:00
jit Monkey-patch LLVM code to fix ARM relocation bug. 2024-11-06 23:07:34 +13:00
lib Prevent access of uninitialized memory in radix tree nodes 2024-06-21 17:29:39 +07:00
libpq Use PqMsg_* macros in more places. 2024-07-17 10:51:00 -05:00
mb Inline basic UTF-8 functions. 2024-03-20 09:40:57 -07:00
nodes SQL/JSON: Fix some oversights in commit b6e1157e7 2024-10-20 12:21:12 +09:00
optimizer Fix asymmetry in setting EquivalenceClass.ec_sortref 2024-06-06 13:41:34 +03:00
parser Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands 2024-08-24 19:18:24 +03:00
partitioning Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands 2024-08-24 19:18:24 +03:00
pch Update copyright for 2024 2024-01-03 20:49:05 -05:00
port Fix sign-compare warnings in pg_iovec.h. 2024-11-08 16:11:08 -06:00
portability Update copyright for 2024 2024-01-03 20:49:05 -05:00
postmaster Wait for WAL summarization to catch up before creating .partial file. 2024-07-26 14:51:10 -04:00
regex Avoid assertion due to disconnected NFA sub-graphs in regex parsing. 2024-11-15 18:23:38 -05:00
replication Fix possibility of logical decoding partial transaction changes. 2024-07-11 22:48:21 +09:00
rewrite Support MERGE into updatable views. 2024-02-29 15:56:59 +00:00
snowball Update copyright for 2024 2024-01-03 20:49:05 -05:00
statistics Update copyright for 2024 2024-01-03 20:49:05 -05:00
storage At end of recovery, reset all sinval-managed caches. 2024-10-25 06:51:06 -07:00
tcop Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:30 -07:00
tsearch Update copyright for 2024 2024-01-03 20:49:05 -05:00
utils Fix race conditions with drop of reused pgstats entries 2024-11-15 11:32:13 +09:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Add macro to disable address safety instrumentation 2024-04-06 12:20:40 +07:00
fmgr.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
funcapi.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
getopt_long.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
Makefile Put genbki.pl output into src/include/catalog/ directly 2024-03-14 07:11:21 +01:00
meson.build meson: Restore implicit warning/debug/optimize flags for extensions 2024-06-07 09:36:26 +02:00
miscadmin.h Fix improper interactions between session_authorization and role. 2024-11-11 10:29:54 -05:00
pg_config.h.in Fix macro placement in pg_config.h.in 2024-07-26 16:25:56 +02:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.meson meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_config_manual.h Introduce a non-recursive JSON parser 2024-04-04 06:46:40 -04:00
pg_getopt.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_trace.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pgstat.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pgtar.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pgtime.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
port.h Replace calls to pg_qsort() with the qsort() macro. 2024-02-16 11:37:50 -06:00
postgres.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
postgres_ext.h Move RelFileNumber declarations to common/relpath.h. 2022-09-27 12:01:57 -04:00
postgres_fe.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
varatt.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
windowapi.h Update copyright for 2024 2024-01-03 20:49:05 -05:00