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

Commit970583a

Browse files
committed
Several routines in setrefs.c would crash on array refs
due to lack of check for recursing into a null subexpression.
1 parent89cf930 commit970583a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

‎src/backend/optimizer/plan/setrefs.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.42 1999/04/26 00:37:46 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.43 1999/04/29 00:20:27 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -747,6 +747,9 @@ replace_agg_clause(Node *clause, List *subplanTargetList)
747747
List*t;
748748
List*agg_list=NIL;
749749

750+
if (clause==NULL)
751+
returnNIL;
752+
750753
if (IsA(clause,Var))
751754
{
752755
TargetEntry*subplanVar;
@@ -864,6 +867,9 @@ del_agg_clause(Node *clause)
864867
{
865868
List*t;
866869

870+
if (clause==NULL)
871+
returnclause;
872+
867873
if (IsA(clause,Var))
868874
returnclause;
869875
elseif (is_funcclause(clause))
@@ -942,6 +948,9 @@ check_having_qual_for_vars(Node *clause, List *targetlist_so_far)
942948
{
943949
List*t;
944950

951+
if (clause==NULL)
952+
returntargetlist_so_far;
953+
945954
if (IsA(clause,Var))
946955
{
947956
RelOptInfotmp_rel;
@@ -1035,6 +1044,9 @@ check_having_for_ungrouped_vars(Node *clause, List *groupClause)
10351044
{
10361045
List*t;
10371046

1047+
if (clause==NULL)
1048+
return;
1049+
10381050
if (IsA(clause,Var))
10391051
{
10401052
/* Ignore vars elsewhere in the having clause, since the

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp