Neil Conway <neilc@samurai.com> writes:
> BTW, should I take your lack of comment on linitial() as "no objection"?
Make it "no better idea" ;-)
A couple hours' poking at the patch yielded the attached two diffs
and the realization that list_difference_private cannot work, because
its first call to list_append_auto will crash due to new_list being NIL.
We had already talked about getting rid of the _auto functions, and I'd
now say that's a must not just cosmetic cleanup.
regards, tom lane
*** src/backend/nodes/list.c~ Sun May 23 23:20:34 2004
--- src/backend/nodes/list.c Sun May 23 23:56:39 2004
***************
*** 433,439 ****
if (n == list->length - 1)
return list->tail;
! for (match = list->head; --n > 0; match = match->next)
;
return match;
--- 433,439 ----
if (n == list->length - 1)
return list->tail;
! for (match = list->head; n-- > 0; match = match->next)
;
return match;
*** src/backend/optimizer/plan/createplan.c~ Sun May 23 23:20:34 2004
--- src/backend/optimizer/plan/createplan.c Mon May 24 00:19:32 2004
***************
*** 1273,1279 ****
* Now, determine which index attribute this is, change the
* indexkey operand as needed, and get the index opclass.
*/
! lfirst(newclause->args) = fix_indxqual_operand(lfirst(list_head(newclause->args)),
baserelid,
index,
&opclass);
--- 1273,1279 ----
* Now, determine which index attribute this is, change the
* indexkey operand as needed, and get the index opclass.
*/
! lfirst(list_head(newclause->args)) = fix_indxqual_operand(lfirst(list_head(newclause->args)),
baserelid,
index,
&opclass);