29#ifndef MYSQL_CLIENT_EXTENSIONS_MACROS_H_INCLUDED
30#define MYSQL_CLIENT_EXTENSIONS_MACROS_H_INCLUDED
34#define ALLOCATE_EXTENSIONS(OPTS) \
35 (OPTS)->extension = (struct st_mysql_options_extention *)my_malloc( \
36 key_memory_mysql_options, sizeof(struct st_mysql_options_extention), \
37 MYF(MY_WME | MY_ZEROFILL))
39#define ENSURE_EXTENSIONS_PRESENT(OPTS) \
41 if (!(OPTS)->extension) ALLOCATE_EXTENSIONS(OPTS); \
44#define EXTENSION_SET_STRING(OPTS, X, STR) \
46 if ((OPTS)->extension) \
47 my_free((OPTS)->extension->X); \
49 ALLOCATE_EXTENSIONS(OPTS); \
50 (OPTS)->extension->X = \
52 ? my_strdup(key_memory_mysql_options, (STR), MYF(MY_WME)) \
56#define SET_OPTION(opt_var, arg) \
58 if (mysql->options.opt_var) my_free(mysql->options.opt_var); \
59 mysql->options.opt_var = \
60 arg ? my_strdup(key_memory_mysql_options, arg, MYF(MY_WME)) : NULL; \
63#define EXTENSION_SET_SSL_STRING(OPTS, X, STR, mode) \
65 EXTENSION_SET_STRING(OPTS, X, static_cast<const char *>(STR)); \
66 if ((OPTS)->extension->X) (OPTS)->extension->ssl_mode = mode; \
PSI_memory_key key_memory_mysql_options
Definition: client.cc:161
unsigned int PSI_memory_key
Instrumented memory key.
Definition: psi_memory_bits.h:49