* 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
| 2008 | * constructName does not affect the semantics, but is used in error messages |
| 2009 | */ |
| 2010 | static void |
| 2011 | checkExprIsVarFree(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 | /* |
no test coverage detected