From 0eda81e4d964898db271e08a68ef9ea1760913e0 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 22 Mar 2021 16:07:25 +0400 Subject: [PATCH] MDEV-25186 JSON_TABLE: ASAN global-buffer-overflow in my_strnncoll_binary upon inserting query with join into query cache. --- sql/sql_cache.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index f65466115df..80681eee44a 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -3388,9 +3388,10 @@ Query_cache::register_tables_from_list(THD *thd, TABLE_LIST *tables_used, tables_used; tables_used= tables_used->next_global, n++, (*block_table)++) { - if (tables_used->is_anonymous_derived_table()) + if (tables_used->is_anonymous_derived_table() || + tables_used->table_function) { - DBUG_PRINT("qcache", ("derived table skipped")); + DBUG_PRINT("qcache", ("derived table or table function skipped")); n--; (*block_table)--; continue;