aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_expr.c
diff options
context:
space:
mode:
authorAmit Langote <amitlan@postgresql.org>2024-06-19 15:22:06 +0900
committerAmit Langote <amitlan@postgresql.org>2024-06-19 15:22:06 +0900
commit0f271e8e8d9c8db0ea86c0d12b3221009b81d8bf (patch)
tree4890052933a315ad69089aff7c38fbc532367196 /src/backend/parser/parse_expr.c
parent5e05a0e9924e97c24be13c75e4ba12c60bd0e4ad (diff)
downloadpostgresql-0f271e8e8d9c8db0ea86c0d12b3221009b81d8bf.tar.gz
postgresql-0f271e8e8d9c8db0ea86c0d12b3221009b81d8bf.zip
SQL/JSON: Correct jsonpath variable name matching
Previously, GetJsonPathVar() allowed a jsonpath expression to reference any prefix of a PASSING variable's name. For example, the following query would incorrectly work: SELECT JSON_QUERY(context_item, jsonpath '$xy' PASSING val AS xyz); The fix ensures that the length of the variable name mentioned in a jsonpath expression matches exactly with the name of the PASSING variable before comparing the strings using strncmp(). Reported-by: Alvaro Herrera (off-list) Discussion: https://postgr.es/m/CA+HiwqFGkLWMvELBH6E4SQ45qUHthgcRH6gCJL20OsYDRtFx_w@mail.gmail.com
Diffstat (limited to 'src/backend/parser/parse_expr.c')
0 files changed, 0 insertions, 0 deletions