MySQL:如何编写daemon plugin(6)
((struct st_mysql_sys_var *)&(MYSQL_SYSVAR_NAME(name)))
那么MYSQL_SYSVAR(my_var)被转换为:
((struct st_mysql_sys_var *)mysql_sysvar_my_var
因此,在这之前,我们首先要先创建好结构体。针对不同的数据类型,提供了许多宏来创建,分为两种:一种以MYSQL_SYSVAR开头的全局变量(可以set global),另外一种是MYSQL_THDVAR开头的session变量
MYSQL_SYSVAR_BOOL(name, varname, opt, comment, check, update, def) |
char |
MYSQL_SYSVAR_STR(name, varname, opt, comment, check, update, def) |
char* |
MYSQL_SYSVAR_INT(name, varname, opt, comment, check, update, def, min, max, blk) |
int |
MYSQL_SYSVAR_UINT(name, varname, opt, comment, check, update, def, min, max, blk) |
unsigned int |
MYSQL_SYSVAR_LONG(name, varname, opt, comment, check, update, def, min, max, blk) |
long |
MYSQL_SYSVAR_ULONG(name, varname, opt, comment, check, update, def, min, max, blk) |
unsigned long |
MYSQL_SYSVAR_LONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) |
long long |
MYSQL_SYSVAR_ULONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) |
unsigned long long |
MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, typelib) |
unsigned long |
MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, typelib) |
unsigned long long |
以下是session变量定义宏 |
|
MYSQL_THDVAR_BOOL(name, opt, comment, check, update, def) |
char |
MYSQL_THDVAR_STR(name, opt, comment, check, update, def) |
char* |
MYSQL_THDVAR_INT(name, opt, comment, check, update, def, min, max, blk) |
int |
MYSQL_THDVAR_UINT(name, opt, comment, check, update, def, min, max, blk) |
unsigned int |
MYSQL_THDVAR_LONG(name, opt, comment, check, update, def, min, max, blk) |
long |
MYSQL_THDVAR_ULONG(name, opt, comment, check, update, def, min, max, blk) |
unsigned long |
MYSQL_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, max, blk) |
long long |
MYSQL_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, max, blk) |
unsigned long long |
MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) |
unsigned long |
MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) |
unsigned long long |
相关新闻>>
- 发表评论
-
- 最新评论 更多>>