diff --git a/src/query/sql/src/planner/binder/table.rs b/src/query/sql/src/planner/binder/table.rs index 8ff180b34cf4..1fcc54eba75e 100644 --- a/src/query/sql/src/planner/binder/table.rs +++ b/src/query/sql/src/planner/binder/table.rs @@ -154,6 +154,7 @@ impl Binder { mut bind_context: BindContext, ) -> Result<(SExpr, BindContext)> { let blocks = Arc::new(RwLock::new(vec![])); + self.ctx .set_materialized_cte((cte_info.cte_idx, cte_info.used_count), blocks)?; // Get the fields in the cte