Commit 46089cfd authored by monty@mysql.com's avatar monty@mysql.com

Simple optimization to avoid a malloc for each query

parent d2d7533e
...@@ -178,11 +178,8 @@ void lex_start(THD *thd, uchar *buf,uint length) ...@@ -178,11 +178,8 @@ void lex_start(THD *thd, uchar *buf,uint length)
lex->trg_table= NULL; lex->trg_table= NULL;
lex->proc_list.first= 0; lex->proc_list.first= 0;
extern byte *sp_lex_spfuns_key(const byte *ptr, uint *plen, my_bool first); if (lex->spfuns.records)
hash_free(&lex->spfuns); hash_reset(&lex->spfuns);
hash_init(&lex->spfuns, system_charset_info, 0, 0, 0,
sp_lex_spfuns_key, 0, 0);
} }
void lex_end(LEX *lex) void lex_end(LEX *lex)
......
...@@ -758,7 +758,8 @@ typedef struct st_lex ...@@ -758,7 +758,8 @@ typedef struct st_lex
st_lex() :result(0) st_lex() :result(0)
{ {
bzero((char *)&spfuns, sizeof(spfuns)); extern byte *sp_lex_spfuns_key(const byte *ptr, uint *plen, my_bool first);
hash_init(&spfuns, system_charset_info, 0, 0, 0, sp_lex_spfuns_key, 0, 0);
} }
~st_lex() ~st_lex()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment