Fix having clause bug for complex joins

We update column attributes of various clauses for a query
inluding target columns, select clauses when we introduce
new range table entries in the query.

It seems having clause column attributes were not updated.

This fix resolves the issue
release-8.0
Murat Tuncer 2018-12-24 22:31:51 +03:00 committed by Hanefi Onaldi
parent c5371965f6
commit ba00e930ea
No known key found for this signature in database
GPG Key ID: 95177DABDC09D1F5
1 changed files with 12 additions and 0 deletions

View File

@ -691,6 +691,18 @@ BuildJobQuery(MultiNode *multiNode, List *dependedJobList)
}
}
/* set correct column attributes for having columns */
if (updateColumnAttributes)
{
columnCell = NULL;
columnList = pull_var_clause_default((Node *) havingQual);
foreach(columnCell, columnList)
{
Var *column = (Var *) lfirst(columnCell);
UpdateColumnAttributes(column, rangeTableList, dependedJobList);
}
}
/*
* Build the From/Where construct. We keep the where-clause list implicitly
* AND'd, since both partition and join pruning depends on the clauses being