mysql-server/mysql-test/t/subquery_hypergraph.test
2025-03-05 14:31:37 +07:00

17 lines
550 B
Text

--source include/have_hypergraph.inc
--echo #
--echo # Bug#33280189: Hypergraph: Some subqueries are evaluated
--echo # during optimization
--echo #
CREATE TABLE t(x INTEGER);
INSERT INTO t VALUES (1), (2);
ANALYZE TABLE t;
# Used to evaluate the subquery and fail. Should only produce the plan.
--replace_regex / *\(cost=.*//
EXPLAIN FORMAT=TREE SELECT * FROM t WHERE (SELECT x FROM t);
# The error should not be raised until the query is executed.
--error ER_SUBQUERY_NO_1_ROW
SELECT * FROM t WHERE (SELECT x FROM t);
DROP TABLE t;