@@ -5285,30 +5285,6 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
52855285 uint table_open_method= tables->table_open_method ;
52865286 bool can_deadlock;
52875287 MEM_ROOT tmp_mem_root;
5288- /*
5289- We're going to open FRM files for tables.
5290- In case of VIEWs that contain stored function calls,
5291- these stored functions will be parsed and put to the SP cache.
5292-
5293- Suppose we have a view containing a stored function call:
5294- CREATE VIEW v1 AS SELECT f1() AS c1;
5295- and now we're running:
5296- SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME=f1();
5297- If a parallel thread invalidates the cache,
5298- e.g. by creating or dropping some stored routine,
5299- the SELECT query will re-parse f1() when processing "v1"
5300- and replace the outdated cached version of f1() to a new one.
5301- But the old version of f1() is referenced from the m_sp member
5302- of the Item_func_sp instances used in the WHERE condition.
5303- We cannot destroy it. To avoid such clashes, let's remember
5304- all old routines into a temporary SP cache collection
5305- and process tables with a new empty temporary SP cache collection.
5306- Then restore to the old SP cache collection at the end.
5307- */
5308- Sp_caches old_sp_caches;
5309-
5310- old_sp_caches.sp_caches_swap (*thd);
5311-
53125288 bzero (&tmp_mem_root, sizeof (tmp_mem_root));
53135289
53145290 /*
@@ -5481,14 +5457,6 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
54815457err:
54825458 thd->restore_backup_open_tables_state (&open_tables_state_backup);
54835459 free_root (&tmp_mem_root, 0 );
5484-
5485- /*
5486- Now restore to the saved SP cache collection
5487- and clear the temporary SP cache collection.
5488- */
5489- old_sp_caches.sp_caches_swap (*thd);
5490- old_sp_caches.sp_caches_clear ();
5491-
54925460 DBUG_RETURN (error);
54935461}
54945462
0 commit comments