1
#include <drizzled/server_includes.h>
2
#include <drizzled/errmsg.h>
4
int errmsg_initializer(st_plugin_int *plugin)
8
fprintf(stderr, "MRA %s plugin:%s dl:%s\n",
9
__func__, plugin->name.str, plugin->plugin_dl->dl.str);
11
p= (errmsg_t *) malloc(sizeof(errmsg_t));
12
if (p == NULL) return 1;
13
memset(p, 0, sizeof(errmsg_t));
15
plugin->data= (void *)p;
17
if (plugin->plugin->init)
19
if (plugin->plugin->init((void *)p))
21
sql_print_error("Errmsg plugin '%s' init function returned error.",
33
int errmsg_finalizer(st_plugin_int *plugin)
35
errmsg_t *p = (errmsg_t *) plugin->data;
37
fprintf(stderr, "MRA %s plugin:%s dl:%s\n",
38
__func__, plugin->name.str, plugin->plugin_dl->dl.str);
40
if (plugin->plugin->deinit)
42
if (plugin->plugin->deinit((void *)p))
44
sql_print_error("Errmsg plugin '%s' deinit function returned error.",
54
static bool errmsg_iterate (THD *thd, plugin_ref plugin,
55
void *stuff __attribute__ ((__unused__)))
57
errmsg_t *l= plugin_data(plugin, errmsg_t *);
59
if (l && l->errmsg_pre)
61
if (l->errmsg_pre(thd))
67
void errmsg_vprintf (THD *thd, int priority, const char *format, va_list ap)
71
void errmsg_pre_do (THD *thd)
73
if (plugin_foreach(thd, errmsg_pre_iterate, DRIZZLE_LOGGER_PLUGIN, NULL))
75
sql_print_error("Errmsg plugin pre had an error.");