mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-25380: JSON_TABLE: Assertion `join->best_read < double(1.797...) fails
The query used a subquery of this form: SELECT ... WHERE EXISTS( SELECT ... FROM JSON_TABLE(outer_ref, ..) as JT WHERE trivial_correlation_cond) EXISTS-to-IN conversion code was unable to see that the subquery will still be correlated after the trivial_correlation is removed, which eventually caused a crash due to inability to construct a query plan. Fixed by making Item_subselect::walk() also walk arguments of Table Functions.
This commit is contained in:
committed by
Alexey Botchkov
parent
eb2550ee78
commit
4a10dd0253
@@ -734,5 +734,21 @@ Shirt blue 20
|
||||
Shirt white 20
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-25380: JSON_TABLE: Assertion `join->best_read < double(1.797...) fails
|
||||
#
|
||||
CREATE TABLE t1 (a INT, b TEXT);
|
||||
INSERT INTO t1 VALUES (1,'{}'),(2,'[]');
|
||||
explain
|
||||
SELECT *
|
||||
FROM t1
|
||||
WHERE
|
||||
EXISTS(SELECT *
|
||||
FROM JSON_TABLE(b, '$' COLUMNS(o FOR ORDINALITY)) AS jt
|
||||
WHERE jt.o = t1.a);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
|
||||
1 PRIMARY jt ALL NULL NULL NULL NULL 40 Table function: json_table; Using where; FirstMatch(t1)
|
||||
drop table t1;
|
||||
#
|
||||
# End of 10.6 tests
|
||||
#
|
||||
|
Reference in New Issue
Block a user