summaryrefslogtreecommitdiff
path: root/sql/thr_malloc.cc
diff options
context:
space:
mode:
authorAlexander Ivanov <alexi1952@yandex.ru>2009-10-16 15:20:09 +0400
committerAlexander Ivanov <alexi1952@yandex.ru>2009-10-16 15:20:09 +0400
commit6bc7eab161508115168359460b9d52aff153dbaf (patch)
tree51ca9db10993d7cc1a7697149266bbaf702e0657 /sql/thr_malloc.cc
parent8ea19fa73e86a3c27917a92affd6a9e43763c7ce (diff)
downloadmariadb-git-6bc7eab161508115168359460b9d52aff153dbaf.tar.gz
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.
Diffstat (limited to 'sql/thr_malloc.cc')
-rw-r--r--sql/thr_malloc.cc2
1 files changed, 2 insertions, 0 deletions
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)