29#ifndef MYSQL_CLIENT_EXTENSIONS_MACROS_H_INCLUDED
30#define MYSQL_CLIENT_EXTENSIONS_MACROS_H_INCLUDED
35#define ALLOCATE_EXTENSIONS(OPTS) \
36 (OPTS)->extension = (struct st_mysql_options_extention *)my_malloc( \
37 key_memory_mysql_options, sizeof(struct st_mysql_options_extention), \
38 MYF(MY_WME | MY_ZEROFILL))
40#define ENSURE_EXTENSIONS_PRESENT(OPTS) \
42 if (!(OPTS)->extension) ALLOCATE_EXTENSIONS(OPTS); \
45#define EXTENSION_SET_STRING(OPTS, X, STR) \
47 if ((OPTS)->extension) \
48 my_free((OPTS)->extension->X); \
50 ALLOCATE_EXTENSIONS(OPTS); \
51 (OPTS)->extension->X = \
53 ? my_strdup(key_memory_mysql_options, (STR), MYF(MY_WME)) \
57#define SET_OPTION(opt_var, arg) \
59 if (mysql->options.opt_var) my_free(mysql->options.opt_var); \
60 mysql->options.opt_var = \
61 arg ? my_strdup(key_memory_mysql_options, arg, MYF(MY_WME)) : NULL; \
64#define EXTENSION_SET_SSL_STRING(OPTS, X, STR, mode) \
66 EXTENSION_SET_STRING(OPTS, X, static_cast<const char *>(STR)); \
67 if ((OPTS)->extension->X) (OPTS)->extension->ssl_mode = mode; \
PSI_memory_key key_memory_MYSQL
Definition: client.cc:169
PSI_memory_key key_memory_mysql_options
Definition: client.cc:167
unsigned int PSI_memory_key
Instrumented memory key.
Definition: psi_memory_bits.h:49