summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/sql_string.cc9
-rw-r--r--sql/mysql_priv.h4
-rw-r--r--sql/sql_string.cc9
-rw-r--r--sql/sql_string.h4
-rw-r--r--sql/thr_malloc.cc2
5 files changed, 10 insertions, 18 deletions
diff --git a/client/sql_string.cc b/client/sql_string.cc
index dc6147b563f..9fa8fae2860 100644
--- a/client/sql_string.cc
+++ b/client/sql_string.cc
@@ -26,15 +26,6 @@
#ifdef HAVE_FCONVERT
#include <floatingpoint.h>
#endif
-
-/*
- The following extern declarations are ok as these are interface functions
- required by the string function
-*/
-
-extern void sql_alloc(size_t size);
-extern void sql_element_free(void *ptr);
-
#include "sql_string.h"
/*****************************************************************************
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 63d5621742e..50399d441a7 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -92,12 +92,16 @@ extern MYSQL_PLUGIN_IMPORT const char *primary_key_name;
#include "unireg.h"
void init_sql_alloc(MEM_ROOT *root, uint block_size, uint pre_alloc_size);
+#endif // MYSQL_CLIENT
+
void *sql_alloc(size_t);
void *sql_calloc(size_t);
char *sql_strdup(const char *str);
char *sql_strmake(const char *str, size_t len);
void *sql_memdup(const void * ptr, size_t size);
void sql_element_free(void *ptr);
+
+#ifndef MYSQL_CLIENT
char *sql_strmake_with_convert(const char *str, size_t arg_length,
CHARSET_INFO *from_cs,
size_t max_res_length,
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index e9927c8e85c..a326e8a7ef0 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -26,15 +26,6 @@
#ifdef HAVE_FCONVERT
#include <floatingpoint.h>
#endif
-
-/*
- The following extern declarations are ok as these are interface functions
- required by the string function
-*/
-
-extern uchar* sql_alloc(unsigned size);
-extern void sql_element_free(void *ptr);
-
#include "sql_string.h"
/*****************************************************************************
diff --git a/sql/sql_string.h b/sql/sql_string.h
index 9e22f7b6a27..fbce21a966a 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -1,3 +1,5 @@
+#ifndef MYSQL_SQL_STRING_H_INCLUDED
+#define MYSQL_SQL_STRING_H_INCLUDED
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
@@ -394,3 +396,5 @@ static inline bool check_if_only_end_space(CHARSET_INFO *cs, char *str,
{
return str+ cs->cset->scan(cs, str, end, MY_SEQ_SPACES) == end;
}
+
+#endif // MYSQL_SQL_STRING_H_INCLUDED
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)