Closed
Description
Describe the bug
Discovered in #15482.
When a statement causes a plan_err, running EXPLAIN
on that statement produces only an empty plan result.
To Reproduce
Run the following statements:
-- Create a table with an INT column
> CREATE TABLE t AS SELECT CAST(123 AS int) a;
0 row(s) fetched.
Elapsed 0.072 seconds.
-- This query triggers a type coercion error
> SELECT * FROM t WHERE a = '9999999999';
type_coercion
caused by
Error during planning: Cannot coerce '9999999999' to type 'Int32'
-- But explain just returns an empty plan
> EXPLAIN SELECT * FROM t WHERE a = '9999999999';
+-----------+------+
| plan_type | plan |
+-----------+------+
+-----------+------+
0 row(s) fetched.
Elapsed 0.004 seconds.
Expected behavior
provide a meaningful error message or indicate that planning failed
Additional context
No response