]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Kluge slot_compile_deform() to ignore incorrect attnotnull markings.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 20 Jul 2020 19:54:24 +0000 (15:54 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 20 Jul 2020 19:54:24 +0000 (15:54 -0400)
commit855195a7ba9875648f958c42aba91ad382e82edd
tree515be2f2c669c388b7dda9704e1d3db90b0dc42c
parente8de627a3e05e201ffb78ad7792d14fd25c857c8
Kluge slot_compile_deform() to ignore incorrect attnotnull markings.

Since we mustn't force an initdb in released branches, there is no
simple way to correct the markings of pg_subscription.subslotname
and pg_subscription_rel.srsublsn as attnotnull in existing pre-v13
installations.

Fortunately, released branches don't rely on attnotnull being correct
for much.  The planner looks at it in relation_excluded_by_constraints,
but it'd be difficult to get that to matter for a query on a system
catalog.  The only place where it's really problematic is in JIT's
slot_compile_deform(), which can produce incorrect code that crashes
if there are NULLs in an allegedly not-null column.

Hence, hack up slot_compile_deform() to be specifically aware of
these two incorrect markings and not trust them.

This applies to v11 and v12; the JIT code didn't exist before that,
and we've fixed the markings in v13.

Discussion: https://postgr.es/m/229396.1595191345@sss.pgh.pa.us
src/backend/jit/llvm/llvmjit_deform.c
src/test/regress/expected/subscription.out
src/test/regress/sql/subscription.sql