mirror of
https://github.com/postgres/postgres.git
synced 2025-06-01 14:21:49 +03:00
Suppress Coverity warnings about Asserts in get_name_for_var_field.
Coverity thinks dpns->plan could be null at these points. That shouldn't really be possible, but it's easy enough to modify the Asserts so they'd not core-dump if it were true. These are new in b919a97a6. Back-patch to v13; the v12 version of the patch didn't have these Asserts.
This commit is contained in:
parent
2b8d33f66c
commit
aed881386a
@ -7914,11 +7914,11 @@ get_name_for_var_field(Var *var, int fieldno,
|
|||||||
{
|
{
|
||||||
char *dummy_name = palloc(32);
|
char *dummy_name = palloc(32);
|
||||||
|
|
||||||
Assert(IsA(dpns->plan, Result));
|
Assert(dpns->plan && IsA(dpns->plan, Result));
|
||||||
snprintf(dummy_name, 32, "f%d", fieldno);
|
snprintf(dummy_name, 32, "f%d", fieldno);
|
||||||
return dummy_name;
|
return dummy_name;
|
||||||
}
|
}
|
||||||
Assert(IsA(dpns->plan, SubqueryScan));
|
Assert(dpns->plan && IsA(dpns->plan, SubqueryScan));
|
||||||
|
|
||||||
tle = get_tle_by_resno(dpns->inner_tlist, attnum);
|
tle = get_tle_by_resno(dpns->inner_tlist, attnum);
|
||||||
if (!tle)
|
if (!tle)
|
||||||
@ -8045,12 +8045,12 @@ get_name_for_var_field(Var *var, int fieldno,
|
|||||||
{
|
{
|
||||||
char *dummy_name = palloc(32);
|
char *dummy_name = palloc(32);
|
||||||
|
|
||||||
Assert(IsA(dpns->plan, Result));
|
Assert(dpns->plan && IsA(dpns->plan, Result));
|
||||||
snprintf(dummy_name, 32, "f%d", fieldno);
|
snprintf(dummy_name, 32, "f%d", fieldno);
|
||||||
return dummy_name;
|
return dummy_name;
|
||||||
}
|
}
|
||||||
Assert(IsA(dpns->plan, CteScan) ||
|
Assert(dpns->plan && (IsA(dpns->plan, CteScan) ||
|
||||||
IsA(dpns->plan, WorkTableScan));
|
IsA(dpns->plan, WorkTableScan)));
|
||||||
|
|
||||||
tle = get_tle_by_resno(dpns->inner_tlist, attnum);
|
tle = get_tle_by_resno(dpns->inner_tlist, attnum);
|
||||||
if (!tle)
|
if (!tle)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user