summaryrefslogtreecommitdiff
path: root/sql/sp.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-09-01 19:00:41 +0300
committerunknown <bell@sanja.is.com.ua>2004-09-01 19:00:41 +0300
commitc33897765f0bd4af57d23afad665788c12b774e4 (patch)
tree67613b6f60c6d89cf45f8cdb36805d3e37719a93 /sql/sp.cc
parentd3423ca699ef20de336cbed8574df63f1970d278 (diff)
downloadmariadb-git-c33897765f0bd4af57d23afad665788c12b774e4.tar.gz
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
Diffstat (limited to 'sql/sp.cc')
-rw-r--r--sql/sp.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/sql/sp.cc b/sql/sp.cc
index b881eeb78d9..a69f18e10be 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -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,