B库下insert、upsert的用户变量与列名相同时,取用户变量优先级最高,与MySQL保持一致
This commit is contained in:
@ -966,10 +966,15 @@ Node* transformColumnRef(ParseState* pstate, ColumnRef* cref)
|
||||
if (node == NULL) {
|
||||
node = hookresult;
|
||||
} else if (hookresult != NULL) {
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_AMBIGUOUS_COLUMN),
|
||||
errmsg("column reference \"%s\" is ambiguous", NameListToString(cref->fields)),
|
||||
parser_errposition(pstate, cref->location)));
|
||||
if (IS_SUPPORT_RIGHT_REF(pstate->rightRefState)) {
|
||||
node = hookresult;
|
||||
} else {
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_AMBIGUOUS_COLUMN),
|
||||
errmsg("column reference \"%s\" is ambiguous", NameListToString(cref->fields)),
|
||||
parser_errposition(pstate, cref->location)));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user