Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9e9c38e

Browse files
committed
postgres_fdw: Fix incorrect NULL handling in join pushdown.
something.* IS NOT NULL means that every attribute of the row is notNULL, not that the row itself is non-NULL (e.g. because it's comingfrom below an outer join. Use (somevar.*)::pg_catalog.text IS NOTNULL instead.Ashutosh Bapat, per a report by Rushabh Lathia. Reviewed byAmit Langote and Etsuro Fujita. Schema-qualification added by me.
1 parent267569b commit9e9c38e

File tree

3 files changed

+50
-25
lines changed

3 files changed

+50
-25
lines changed

‎contrib/postgres_fdw/deparse.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,9 +1599,9 @@ deparseColumnRef(StringInfo buf, int varno, int varattno, PlannerInfo *root,
15991599

16001600
if (qualify_col)
16011601
{
1602-
appendStringInfoString(buf,"CASE WHEN ");
1602+
appendStringInfoString(buf,"CASE WHEN(");
16031603
ADD_REL_QUALIFIER(buf,varno);
1604-
appendStringInfo(buf,"* IS NOT NULL THEN %u END",fetchval);
1604+
appendStringInfo(buf,"*)::pg_catalog.text IS NOT NULL THEN %u END",fetchval);
16051605
}
16061606
else
16071607
appendStringInfo(buf,"%u",fetchval);
@@ -1643,9 +1643,9 @@ deparseColumnRef(StringInfo buf, int varno, int varattno, PlannerInfo *root,
16431643
*/
16441644
if (qualify_col)
16451645
{
1646-
appendStringInfoString(buf,"CASE WHEN ");
1646+
appendStringInfoString(buf,"CASE WHEN(");
16471647
ADD_REL_QUALIFIER(buf,varno);
1648-
appendStringInfo(buf,"* IS NOT NULL THEN ");
1648+
appendStringInfo(buf,"*)::pg_catalog.text IS NOT NULL THEN ");
16491649
}
16501650

16511651
appendStringInfoString(buf,"ROW(");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp