We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa068e7 commit 8f68671Copy full SHA for 8f68671
src/hooks.c
@@ -498,9 +498,13 @@ pathman_rel_pathlist_hook(PlannerInfo *root,
498
irange_len * sizeof(RangeTblEntry *));
499
500
#if PG_VERSION_NUM >= 110000
501
- /* Make sure append_rel_array is wide enough */
+ /*
502
+ * Make sure append_rel_array is wide enough; if it hasn't been
503
+ * allocated previously, care to zero out [0; current_len) part.
504
+ */
505
if (root->append_rel_array == NULL)
- root->append_rel_array = (AppendRelInfo **) palloc0(0);
506
+ root->append_rel_array = (AppendRelInfo **)
507
+ palloc0(current_len * sizeof(AppendRelInfo *));
508
root->append_rel_array = (AppendRelInfo **)
509
repalloc(root->append_rel_array,
510
new_len * sizeof(AppendRelInfo *));
0 commit comments