Commit 624888b4 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: inherit from Sql_alloc

instead of copy-pasting its methods into a new class
parent 43d1f0b6
......@@ -2887,20 +2887,8 @@ class Parser_state
};
struct st_lex_local: public LEX
struct st_lex_local: public LEX, public Sql_alloc
{
static void *operator new(size_t size) throw()
{
return sql_alloc(size);
}
static void *operator new(size_t size, MEM_ROOT *mem_root) throw()
{
return (void*) alloc_root(mem_root, (uint) size);
}
static void operator delete(void *ptr,size_t size)
{ TRASH(ptr, size); }
static void operator delete(void *ptr, MEM_ROOT *mem_root)
{ /* Never called */ }
};
extern void lex_init(void);
......
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