MCPcopy Create free account
hub / github.com/apache/cloudberry / checkExprIsVarFree

Function checkExprIsVarFree

src/backend/parser/parse_clause.c:2010–2023  ·  view source on GitHub ↗

* checkExprIsVarFree * Check that given expr has no Vars of the current query level * (aggregates and window functions should have been rejected already). * * This is used to check expressions that have to have a consistent value * across all rows of the query, such as a LIMIT. Arguably it should reject * volatile functions, too, but we don't do that --- whatever value the * function giv

Source from the content-addressed store, hash-verified

2008 * constructName does not affect the semantics, but is used in error messages
2009 */
2010static void
2011checkExprIsVarFree(ParseState *pstate, Node *n, const char *constructName)
2012{
2013 if (contain_vars_of_level(n, 0))
2014 {
2015 ereport(ERROR,
2016 (errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
2017 /* translator: %s is name of a SQL construct, eg LIMIT */
2018 errmsg("argument of %s must not contain variables",
2019 constructName),
2020 parser_errposition(pstate,
2021 locate_var_of_level(n, 0))));
2022 }
2023}
2024
2025
2026/*

Callers 2

transformLimitClauseFunction · 0.85
transformFrameOffsetFunction · 0.85

Calls 5

contain_vars_of_levelFunction · 0.85
parser_errpositionFunction · 0.85
locate_var_of_levelFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by

no test coverage detected