1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Fix the BY {REF,VALUE} clause of XMLEXISTS/XMLTABLE

This clause is used to indicate the passing mode of a XML document, but
we were doing it wrong: we accepted BY REF and ignored it, and rejected
BY VALUE as a syntax error.  The reality, however, is that documents are
always passed BY VALUE, so rejecting that clause was silly.  Change
things so that we accept BY VALUE.

BY REF continues to be accepted, and continues to be ignored.

Author: Chapman Flack
Reviewed-by: Pavel Stehule
Discussion: https://postgr.es/m/5C297BB7.9070509@anastigmatix.net
This commit is contained in:
Alvaro Herrera
2019-03-07 11:17:09 -03:00
parent cb706ec4b6
commit eaaa5986ad
3 changed files with 37 additions and 21 deletions

View File

@ -13951,20 +13951,25 @@ xmlexists_argument:
{
$$ = $2;
}
| PASSING c_expr BY REF
| PASSING c_expr xml_passing_mech
{
$$ = $2;
}
| PASSING BY REF c_expr
| PASSING xml_passing_mech c_expr
{
$$ = $4;
$$ = $3;
}
| PASSING BY REF c_expr BY REF
| PASSING xml_passing_mech c_expr xml_passing_mech
{
$$ = $4;
$$ = $3;
}
;
xml_passing_mech:
BY REF
| BY VALUE_P
;
/*
* Aggregate decoration clauses