1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +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

@ -1055,9 +1055,15 @@ int Table_function_json_table::setup(THD *thd, TABLE_LIST *sql_table,
// table function reference
m_context->ignored_tables= get_disallowed_table_deps(s_lex->join, t->map);
// Do the same what setup_without_group() does: do not count the referred
// fields in non_agg_field_used:
const bool saved_non_agg_field_used= s_lex->non_agg_field_used();
res= m_json->fix_fields_if_needed(thd, &m_json);
thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup;
s_lex->set_non_agg_field_used(saved_non_agg_field_used);
if (res)
return TRUE;
}