1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge branch '10.6' into 10.11

This commit is contained in:
Oleksandr Byelkin
2024-07-20 08:16:24 +02:00
362 changed files with 7658 additions and 3804 deletions

View File

@@ -1015,6 +1015,31 @@ Jeans
SELECT 1 FROM JSON_TABLE (row(1,2), '$' COLUMNS (o FOR ORDINALITY)) AS j;
ERROR 21000: Operand should contain 1 column(s)
#
# MDEV-30623 JSON_TABLE in subquery not correctly marked as correlated
# update_correlated_cache() fails to take JSON_TABLE functions in
# subqueries into account.
#
create table t1(c json);
insert into t1 values ('[{"x":"1"},{"x":"2"}]'),
('[{"x":"10"},{"x":"20"}]'),
('[{"x":"100"},{"x":"200"}]');
select c,
(SELECT sum(x) FROM json_table(c, "$[*]" columns( x int path "$.x"))
AS jt) as SUBQ
from t1;
c SUBQ
[{"x":"1"},{"x":"2"}] 3
[{"x":"10"},{"x":"20"}] 30
[{"x":"100"},{"x":"200"}] 300
explain select c,
(SELECT sum(x) FROM json_table(c, "$[*]" columns( x int path "$.x"))
AS jt) as SUBQ
from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
2 DEPENDENT SUBQUERY jt ALL NULL NULL NULL NULL 40 Table function: json_table
drop table t1;
#
# End of 10.6 tests
#
#