postgresql/src/include
Tom Lane b7103bbe34 Avoid direct C access to possibly-null pg_subscription_rel.srsublsn.
This coding technique is unsafe, since we'd be accessing off the end
of the tuple if the field is null.  SIGSEGV is pretty improbable, but
perhaps not impossible.  Also, returning garbage for the LSN doesn't
seem like a great idea, even if callers aren't looking at it today.

Also update docs to point out explicitly that
pg_subscription.subslotname and pg_subscription_rel.srsublsn
can be null.

Perhaps we should mark these two fields BKI_FORCE_NULL, so that
they'd be correctly labeled in databases that are initdb'd in the
future.  But we can't force that for existing databases, and on
balance it's not too clear that having a mix of different catalog
contents in the field would be wise.

Apply to v10 (where this code came in) through v12.  Already
fixed in v13 and HEAD.

Discussion: https://postgr.es/m/732838.1595278439@sss.pgh.pa.us
2020-07-21 11:40:46 -04:00
..
access Fix comments related to table AMs 2020-07-14 13:17:34 +09:00
bootstrap Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
catalog Avoid direct C access to possibly-null pg_subscription_rel.srsublsn. 2020-07-21 11:40:46 -04:00
commands Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
common Update unicode_norm_table.h to Unicode 12.1.0 2019-06-24 22:50:56 +02:00
datatype Update copyright for 2019 2019-01-02 12:44:25 -05:00
executor Minor code review for tuple slot rewrite. 2019-11-06 12:00:17 -05:00
fe_utils Fix parallel restore of FKs to partitioned tables 2019-10-17 09:58:01 +02:00
foreign Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
jit Fix duplicated words in comments 2019-05-14 09:37:35 +09:00
lib Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
libpq Switch position of some declarations in libpq.h 2019-06-09 11:33:52 +09:00
mb Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
nodes Revert "Skip WAL for new relfilenodes, under wal_level=minimal." 2020-03-22 09:24:13 -07:00
optimizer Generate EquivalenceClass members for partitionwise child join rels. 2019-11-05 11:42:25 -05:00
parser Fill in extraUpdatedCols in logical replication 2020-02-17 15:21:12 +01:00
partitioning Improve pruning of a default partition 2019-08-04 11:18:45 -04:00
port Avoid need for valgrind suppressions for pg_atomic_init_u64 on some platforms. 2020-06-08 20:02:52 -07:00
portability Update copyright for 2019 2019-01-02 12:44:25 -05:00
postmaster Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
regex Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
replication Don't call palloc() while holding a spinlock, either. 2020-06-03 12:36:24 -04:00
rewrite Defend against self-referential views in relation_is_updatable(). 2019-11-21 16:21:43 -05:00
snowball Update copyright for 2019 2019-01-02 12:44:25 -05:00
statistics Fix choose_best_statistics to check clauses individually 2019-11-28 22:26:25 +01:00
storage Revert "Skip WAL for new relfilenodes, under wal_level=minimal." 2020-03-22 09:24:13 -07:00
tcop Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
tsearch Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
utils Use query collation, not column's collation, while examining statistics. 2020-06-05 16:18:50 -04:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Fix integer-overflow edge case detection in interval_mul and pgbench. 2019-11-07 11:22:59 -05:00
fmgr.h Fix minor violations of FunctionCallInvoke usage protocol. 2020-04-21 14:23:58 -04:00
funcapi.h Avoid holding a directory FD open across assorted SRF calls. 2020-03-16 21:05:53 -04:00
getaddrinfo.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
getopt_long.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
Makefile Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
miscadmin.h Add unlikely() to CHECK_FOR_INTERRUPTS() 2020-06-05 16:49:28 -04:00
pg_config.h.in Stamp 12.2. 2020-02-10 17:14:51 -05:00
pg_config.h.win32 Stamp 12.3. 2020-05-11 17:08:58 -04: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.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pg_getopt.h Use our own getopt() on OpenBSD. 2019-01-18 15:06:26 -05:00
pg_trace.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
pgstat.h Add GUC variables for stat tracking and timeout as PGDLLIMPORT 2020-01-21 13:46:55 +09:00
pgtar.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
pgtime.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
port.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
postgres.h Change function call information to be variable length. 2019-01-26 14:17:52 -08:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
rusagestub.h Update copyright for 2019 2019-01-02 12:44:25 -05:00
windowapi.h Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00