postgresql/src/backend
Tom Lane bc8393cf27 Further adjust SPITupleTable to provide a public row-count field.
Now that commit fec0778c8 drew a clear line between public and private
fields in SPITupleTable, it seems pretty silly that the count of valid
tuples isn't on the public side of that line.  The reason why not was
that there wasn't such a count.  For reasons lost in the mists of time,
spi.c preferred to keep a count of remaining free entries in the array.
But that seems pretty pointless: it's unlike the way we handle similar
code everywhere else, and it involves extra subtractions that surely
outweigh having to do a comparison rather than test-for-zero to check
for array-full.

Hence, rearrange so that this code does the expansible array logic
the same as everywhere else, with a count of valid entries alongside
the allocated array length.  And document the count as public.

I looked for core-code callers where it would make sense to start
relying on tuptable->numvals rather than the separate SPI_processed
variable.  Right now there don't seem to be places where it'd be
a win to do so without more code restructuring than I care to
undertake today.  In principle, though, having SPITupleTables be
fully self-contained should be helpful down the line.

Discussion: https://postgr.es/m/16852.1563395722@sss.pgh.pa.us
2019-07-18 10:37:13 -04:00
..
access Avoid using lcons and list_delete_first where it's easy to do so. 2019-07-17 11:15:34 -04:00
bootstrap Fix inconsistencies and typos in the tree 2019-07-16 13:23:53 +09:00
catalog Avoid using lcons and list_delete_first where it's easy to do so. 2019-07-17 11:15:34 -04:00
commands Avoid using lcons and list_delete_first where it's easy to do so. 2019-07-17 11:15:34 -04:00
executor Further adjust SPITupleTable to provide a public row-count field. 2019-07-18 10:37:13 -04:00
foreign Update copyright for 2019 2019-01-02 12:44:25 -05:00
jit Fix more typos and inconsistencies in the tree 2019-06-17 16:13:16 +09:00
lib Fix inconsistencies in the code 2019-07-08 13:15:09 +09:00
libpq Represent Lists as expansible arrays, not chains of cons-cells. 2019-07-15 13:41:58 -04:00
main Replace @postgresql.org with @lists.postgresql.org for mailinglists 2019-01-19 19:06:35 +01:00
nodes Avoid using lcons and list_delete_first where it's easy to do so. 2019-07-17 11:15:34 -04:00
optimizer Avoid using lcons and list_delete_first where it's easy to do so. 2019-07-17 11:15:34 -04:00
parser Avoid using lcons and list_delete_first where it's easy to do so. 2019-07-17 11:15:34 -04:00
partitioning Represent Lists as expansible arrays, not chains of cons-cells. 2019-07-15 13:41:58 -04:00
po Translation updates 2019-06-17 15:30:20 +02:00
port Update stale comments, and fix comment typos. 2019-06-08 10:12:26 -07:00
postmaster Fix inconsistencies in the code 2019-07-08 13:15:09 +09:00
regex Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
replication Redesign the API for list sorting (list_qsort becomes list_sort). 2019-07-16 11:51:44 -04:00
rewrite Avoid using lcons and list_delete_first where it's easy to do so. 2019-07-17 11:15:34 -04:00
snowball Sync our Snowball stemmer dictionaries with current upstream 2019-07-04 13:26:48 +02:00
statistics Simplify bitmap updates in multivariate MCV code 2019-07-18 11:29:38 +02:00
storage Move some md.c-specific logic from smgr.c to md.c. 2019-07-17 15:00:22 +12:00
tcop Represent Lists as expansible arrays, not chains of cons-cells. 2019-07-15 13:41:58 -04:00
tsearch Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
utils Avoid using lcons and list_delete_first where it's easy to do so. 2019-07-17 11:15:34 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Translation updates 2019-05-20 16:00:53 +02:00