From f7fb35c518f6872315449dc0dcdd2480a0e1d548 Mon Sep 17 00:00:00 2001
From: "ram@gw.mysql.r18.ru" <>
Date: Thu, 16 Dec 2004 16:29:47 +0400
Subject: [PATCH] A fix (Bug #6843: Wrong function name crashes MySQL if
 mysql.proc table is missi

---
 sql/sp.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sql/sp.cc b/sql/sp.cc
index 9eff1655711..4605d49f3ab 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -981,6 +981,7 @@ sp_cache_functions(THD *thd, LEX *lex)
 
       thd->lex= newlex;
       newlex->proc_table= oldlex->proc_table; // hint if mysql.oper is opened
+      newlex->current_select= NULL;
       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,
-- 
2.30.9