MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / plan_parameter

Function plan_parameter

src/sql/src/plan/query.rs:4168–4183  ·  view source on GitHub ↗
(ecx: &ExprContext, n: usize)

Source from the content-addressed store, hash-verified

4166}
4167
4168fn plan_parameter(ecx: &ExprContext, n: usize) -> Result<CoercibleScalarExpr, PlanError> {
4169 if !ecx.allow_parameters {
4170 // It might be clearer to return an error like "cannot use parameter
4171 // here", but this is how PostgreSQL does it, and so for now we follow
4172 // PostgreSQL.
4173 return Err(PlanError::UnknownParameter(n));
4174 }
4175 if n == 0 || n > 65536 {
4176 return Err(PlanError::UnknownParameter(n));
4177 }
4178 if ecx.param_types().borrow().contains_key(&n) {
4179 Ok(HirScalarExpr::parameter(n).into())
4180 } else {
4181 Ok(CoercibleScalarExpr::Parameter(n))
4182 }
4183}
4184
4185fn plan_row(ecx: &ExprContext, exprs: &[Expr<Aug>]) -> Result<CoercibleScalarExpr, PlanError> {
4186 let mut out = vec![];

Callers 1

plan_expr_innerFunction · 0.85

Calls 4

parameterFunction · 0.85
contains_keyMethod · 0.80
param_typesMethod · 0.80
borrowMethod · 0.45

Tested by

no test coverage detected