Skip to content

Instantly share code, notes, and snippets.

@greenlion
Created December 29, 2018 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greenlion/d7bbc560d8681863f8f4c89474ef5f3e to your computer and use it in GitHub Desktop.
Save greenlion/d7bbc560d8681863f8f4c89474ef5f3e to your computer and use it in GitHub Desktop.
user var service
#include "mysql/service_my_plugin_user_var.h"
SERVICE_VERSION *user_var_service= (void*)VERSION_user_var;;
bool get_var(THD* thd, const String name, String* value) {
return false;
}
bool set_var(THD* thd, const String name, const String value) my_plugin_user_var_service->set_var(thd, name, value) {
return false;
}
#ifndef MYSQL_SERVICE_USER_VAR_INCLUDED
#include "sql/sql_class.h"
#include "sql/item.h"
#include "sql/item_func.h"
#include "service_versions.h"
/**
@file
*exhaustive* description of the interface you provide.
This file is the main user documentation of the new service
*/
#ifdef __cplusplus
extern "C" {
#endif
extern struct my_plugin_user_var_service_st {
bool (*get_var)(THD* thd, const String name, String* value);
bool (*set_var)(THD* thd, const String name, const String value);
} *my_plugin_user_var_service;
#ifdef MYSQL_DYNAMIC_PLUGIN
#define get_var(THD* thd, const String name, String* value) my_plugin_user_var_service->get_var(thd, name, value)
#define set_var(THD* thd, const String name, const String value) my_plugin_user_var_service->set_var(thd, name, value)
#else
#endif
#ifdef __cplusplus
}
#endif
#define MYSQL_SERVICE_USER_VAR_INCLUDED
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment