SELECT * FROM (SELECT COUNT(*) FROM users) AS t works in standalone tests but may return NULL instead of the correct count in certain contexts. The root cause is likely related to arena memory lifecycle when the inner PlanExecutor for derived table aggregates is built within the outer executor's operator tree.
Needs investigation of arena ownership across nested plan executions.
SELECT * FROM (SELECT COUNT(*) FROM users) AS tworks in standalone tests but may return NULL instead of the correct count in certain contexts. The root cause is likely related to arena memory lifecycle when the inner PlanExecutor for derived table aggregates is built within the outer executor's operator tree.Needs investigation of arena ownership across nested plan executions.