(ecx: &ExprContext, n: usize)
| 4166 | } |
| 4167 | |
| 4168 | fn 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 | |
| 4185 | fn plan_row(ecx: &ExprContext, exprs: &[Expr<Aug>]) -> Result<CoercibleScalarExpr, PlanError> { |
| 4186 | let mut out = vec![]; |
no test coverage detected