pgsql: Cosmetic improvements in setup of planner's per-RTE arrays.

2019-08-09 Thread Tom Lane
Cosmetic improvements in setup of planner's per-RTE arrays. Merge setup_append_rel_array into setup_simple_rel_arrays. There's no particularly good reason to keep them separate, and it's inconsistent with the lack of separation in expand_planner_arrays. The only apparent benefit was that the fas

pgsql: Fix SIGSEGV in pruning for ScalarArrayOp with constant-null arra

2019-08-09 Thread Tom Lane
Fix SIGSEGV in pruning for ScalarArrayOp with constant-null array. Not much to be said here: commit 9fdb675fc should have checked constisnull, didn't. Per report from Piotr Włodarczyk. Back-patch to v11 where bug was introduced. Discussion: https://postgr.es/m/cap-dhmr+vrpwizeyjujsiz1vwqpohtm+

pgsql: Fix SIGSEGV in pruning for ScalarArrayOp with constant-null arra

2019-08-09 Thread Tom Lane
Fix SIGSEGV in pruning for ScalarArrayOp with constant-null array. Not much to be said here: commit 9fdb675fc should have checked constisnull, didn't. Per report from Piotr Włodarczyk. Back-patch to v11 where bug was introduced. Discussion: https://postgr.es/m/cap-dhmr+vrpwizeyjujsiz1vwqpohtm+

pgsql: Fix SIGSEGV in pruning for ScalarArrayOp with constant-null arra

2019-08-09 Thread Tom Lane
Fix SIGSEGV in pruning for ScalarArrayOp with constant-null array. Not much to be said here: commit 9fdb675fc should have checked constisnull, didn't. Per report from Piotr Włodarczyk. Back-patch to v11 where bug was introduced. Discussion: https://postgr.es/m/cap-dhmr+vrpwizeyjujsiz1vwqpohtm+

pgsql: Rename tuplesort.c's SortTuple.tupindex field.

2019-08-09 Thread Peter Geoghegan
Rename tuplesort.c's SortTuple.tupindex field. Rename the "tupindex" field from tuplesort.c's SortTuple struct to "srctape", since it can only ever be used to store a source/input tape number when merging external sort runs. This has been the case since commit 8b304b8b72b, which removed replaceme