From 6bc7eab161508115168359460b9d52aff153dbaf Mon Sep 17 00:00:00 2001 From: Alexander Ivanov Date: Fri, 16 Oct 2009 15:20:09 +0400 Subject: MWL#36: Add a mysqlbinlog option to change the used database. Make sql_alloc() declaration "public" for a client context. The reason is that sql_alloc() is used in definition of some common purpose stuff (e.g. sql_list.*). To make this stuff available for a client context we declare sql_alloc() as a "virtual function", i.e. as a function that is already declared but must be defined in this context (note that definition of sql_alloc() in thr_malloc.cc is #ifndef'ed for MYSQL_CLIENT). Also make sql_string.h repeatedly includable. --- sql/thr_malloc.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/thr_malloc.cc') diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc index 0764fe8be33..83c4a8ee2a0 100644 --- a/sql/thr_malloc.cc +++ b/sql/thr_malloc.cc @@ -59,11 +59,13 @@ void init_sql_alloc(MEM_ROOT *mem_root, uint block_size, uint pre_alloc) } +#ifndef MYSQL_CLIENT void *sql_alloc(size_t Size) { MEM_ROOT *root= *my_pthread_getspecific_ptr(MEM_ROOT**,THR_MALLOC); return alloc_root(root,Size); } +#endif void *sql_calloc(size_t size) -- cgit v1.2.1