21
21
#define DRIZZLE_SERVER_SQL_ALLOC_H
23
23
#include <libdrizzle/net_serv.h>
25
void init_sql_alloc(MEM_ROOT *root, uint32_t block_size, uint32_t pre_alloc_size);
24
#include <mysys/my_alloc.h>
25
#include <mystrings/m_ctype.h>
29
void init_sql_alloc(MEM_ROOT *root, size_t block_size, size_t pre_alloc_size);
26
30
void *sql_alloc(size_t);
27
31
void *sql_calloc(size_t);
28
32
char *sql_strdup(const char *str);
34
38
size_t max_res_length,
35
39
const CHARSET_INFO * const to_cs,
36
40
size_t *result_length);
37
void sql_kill(THD *thd, ulong id, bool only_kill_query);
41
void sql_kill(Session *session, ulong id, bool only_kill_query);
38
42
bool net_request_file(NET* net, const char* fname);
39
char* query_table_status(THD *thd,const char *db,const char *table_name);
43
char* query_table_status(Session *session,const char *db,const char *table_name);
45
/* mysql standard class memory allocator */
49
static void *operator new(size_t size) throw ()
51
return sql_alloc(size);
53
static void *operator new[](size_t size)
55
return sql_alloc(size);
57
static void *operator new[](size_t size, MEM_ROOT *mem_root) throw ()
58
{ return alloc_root(mem_root, size); }
59
static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
60
{ return alloc_root(mem_root, size); }
61
static void operator delete(void *, size_t)
63
static void operator delete(void *, MEM_ROOT *)
64
{ /* never called */ }
65
static void operator delete[](void *, MEM_ROOT *)
66
{ /* never called */ }
67
static void operator delete[](void *, size_t)
71
inline Sql_alloc() :dummy(0) {}
72
inline ~Sql_alloc() {}
75
inline ~Sql_alloc() {}
41
80
#endif /* DRIZZLE_SERVER_SQL_ALLOC_H */