1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-25397: JSON_TABLE: Unexpected ER_MIX_OF_GROUP_FUNC_AND_FIELDS

When doing name resolution, do the same what WHERE/ON clauses do:
they don't count in select_lex->non_agg_field_used().
This commit is contained in:
Sergei Petrunia
2021-04-13 12:34:14 +03:00
committed by Alexey Botchkov
parent f82947e48d
commit a96408092c
3 changed files with 28 additions and 0 deletions

View File

@@ -803,5 +803,16 @@ SELECT * FROM v;
b
DROP VIEW v;
#
# MDEV-25397: JSON_TABLE: Unexpected ER_MIX_OF_GROUP_FUNC_AND_FIELDS upon query with JOIN
#
set @save_sql_mode= @@sql_mode;
SET sql_mode='ONLY_FULL_GROUP_BY';
CREATE TABLE t1 (a TEXT);
SELECT SUM(o) FROM t1 JOIN JSON_TABLE(t1.a, '$' COLUMNS(o FOR ORDINALITY)) jt;
SUM(o)
NULL
set sql_mode=@save_sql_mode;
drop table t1;
#
# End of 10.6 tests
#