修复了group by后面不能加rownum(或别名)的bug以及where后面接rownum的别名的报错信息

This commit is contained in:
zhouxiongjia
2020-08-07 13:06:45 +08:00
parent 94c0253d15
commit 2962e03482
5 changed files with 70 additions and 1 deletions

View File

@ -444,7 +444,11 @@ static Node* replaceExprAliasIfNecessary(ParseState* pstate, char* colname, Colu
(errcode(ERRCODE_UNDEFINED_COLUMN),
errmsg("Alias \"%s\" reference with window function included is not supported.", colname),
parser_errposition(pstate, cref->location)));
} else if (contain_rownum_expr((Node*)tle->expr)) {
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_COLUMN),
errmsg("Alias \"%s\" reference with ROWNUM included is invalid.", colname),
parser_errposition(pstate, cref->location)));
} else if (contain_volatile_functions((Node*)tle->expr)) {
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_COLUMN),