adding mysql.proc to table list if view contains stored procedures (BUG#5151)

mysql-test/r/view.result:
  fixed test
  VIEW over droped function
mysql-test/t/view.test:
  VIEW over droped function
sql/item_func.cc:
  after review fix
sql/sp.cc:
  hint to find mysql.proc
sql/sql_lex.h:
  hint to find mysql.proc
sql/sql_parse.cc:
  hint to find mysql.proc
sql/sql_view.cc:
  adding mysql.proc to table list if view contains stored procedures
This commit is contained in:
unknown 2004-09-01 19:00:41 +03:00
commit c33897765f
7 changed files with 79 additions and 13 deletions

View file

@ -93,10 +93,15 @@ db_find_routine_aux(THD *thd, int type, sp_name *name,
key[128]= type;
keylen= sizeof(key);
for (table= thd->open_tables ; table ; table= table->next)
if (strcmp(table->table_cache_key, "mysql") == 0 &&
strcmp(table->real_name, "proc") == 0)
break;
if (thd->lex->proc_table)
table= thd->lex->proc_table->table;
else
{
for (table= thd->open_tables ; table ; table= table->next)
if (strcmp(table->table_cache_key, "mysql") == 0 &&
strcmp(table->real_name, "proc") == 0)
break;
}
if (table)
*opened= FALSE;
else
@ -954,6 +959,7 @@ sp_cache_functions(THD *thd, LEX *lex)
LEX *newlex= new st_lex;
thd->lex= newlex;
newlex->proc_table= oldlex->proc_table; // hint if mysql.oper is opened
name.m_name.str= strchr(name.m_qname.str, '.');
name.m_db.length= name.m_name.str - name.m_qname.str;
name.m_db.str= strmake_root(&thd->mem_root,