| 179 | } |
| 180 | |
| 181 | pub fn describe_declare( |
| 182 | scx: &StatementContext, |
| 183 | DeclareStatement { stmt, .. }: DeclareStatement<Aug>, |
| 184 | param_types_in: &[Option<SqlScalarType>], |
| 185 | ) -> Result<StatementDesc, PlanError> { |
| 186 | let (stmt_resolved, _) = names::resolve(scx.catalog, *stmt)?; |
| 187 | // Get the desc for the inner statement, but only for its parameters. The outer DECLARE doesn't |
| 188 | // return any rows itself when executed. |
| 189 | let desc = describe(scx.pcx()?, scx.catalog, stmt_resolved, param_types_in)?; |
| 190 | // The outer describe fn calls scx.finalize_param_types, so we need to transfer the inner desc's |
| 191 | // params to this scx. |
| 192 | for (i, ty) in desc.param_types.into_iter().enumerate() { |
| 193 | scx.param_types.borrow_mut().insert(i + 1, ty); |
| 194 | } |
| 195 | Ok(StatementDesc::new(None)) |
| 196 | } |
| 197 | |
| 198 | pub fn plan_declare( |
| 199 | _: &StatementContext, |