| From: | Andres Freund <andres(at)anarazel(dot)de> | 
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
| Cc: | Michael Paquier <michael(at)paquier(dot)xyz>, exclusion(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org | 
| Subject: | Re: BUG #17800: ON CONFLICT DO UPDATE fails to detect incompatible fields that leads to a server crash | 
| Date: | 2023-02-24 22:53:57 | 
| Message-ID: | 20230224225357.2orpiokrfpjllfm4@awork3.anarazel.de | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-bugs | 
Hi,
On 2023-02-24 17:12:43 -0500, Tom Lane wrote:
> OK, so this worked out quite well ... it's only about 50 net new lines
> of code, and there's no data structure changes outside the contents of
> compiled expressions, so no reason to fear ABI problems.
Nice.
> I did the renaming you had comments suggesting, but perhaps you want
> to bikeshed those names?
Not really. I guess it'd be mildly nicer to have Expr somewhere in the name,
but whatever.
> @@ -677,20 +680,8 @@ ExecBuildUpdateProjection(List *targetList,
>  	}
>  
>  	/*
> -	 * If we're evaluating the tlist, must evaluate any resjunk columns too.
> -	 * (This matters for things like MULTIEXPR_SUBLINK SubPlans.)
> +	 * We don't bother evaluating any tlist entries that are marked resjunk.
>  	 */
> -	if (evalTargetList)
> -	{
> -		for_each_cell(lc, targetList, lc)
> -		{
> -			TargetEntry *tle = lfirst_node(TargetEntry, lc);
> -
> -			Assert(tle->resjunk);
> -			ExecInitExprRec(tle->expr, state,
> -							&state->resvalue, &state->resnull);
> -		}
> -	}
>  
>  	/*
>  	 * Now generate code to copy over any old columns that were not assigned
The "don't bother" comment looks a bit lonely now :)
Greetings,
Andres Freund
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2023-02-24 23:49:10 | Re: BUG #17800: ON CONFLICT DO UPDATE fails to detect incompatible fields that leads to a server crash | 
| Previous Message | Tom Lane | 2023-02-24 22:12:43 | Re: BUG #17800: ON CONFLICT DO UPDATE fails to detect incompatible fields that leads to a server crash |