MySQL 9.1.0
Source Code Documentation
plugin_example.cc File Reference
#include "my_config.h"
#include <ctype.h>
#include <mysql/plugin_ftparser.h>
#include <stdlib.h>
#include "my_compiler.h"
#include "mysql/strings/m_ctype.h"

Functions

static int simple_parser_plugin_init (void *arg)
 
static int simple_parser_plugin_deinit (void *arg)
 
static int simple_parser_init (MYSQL_FTPARSER_PARAM *param)
 
static int simple_parser_deinit (MYSQL_FTPARSER_PARAM *param)
 
static void add_word (MYSQL_FTPARSER_PARAM *param, char *word, size_t len)
 
static int simple_parser_parse (MYSQL_FTPARSER_PARAM *param)
 
static MYSQL_SYSVAR_LONG (simple_sysvar_one, sysvar_one_value, PLUGIN_VAR_RQCMDARG, "Simple fulltext parser example system variable number one. Give a number.", nullptr, nullptr, 77L, 7L, 777L, 0)
 
static MYSQL_SYSVAR_STR (simple_sysvar_two, sysvar_two_value, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_MEMALLOC, "Simple fulltext parser example system variable number two. Give a string.", nullptr, nullptr, "simple sysvar two default")
 
static MYSQL_THDVAR_LONG (simple_thdvar_one, PLUGIN_VAR_RQCMDARG, "Simple fulltext parser example thread variable number one. Give a number.", nullptr, nullptr, 88L, 8L, 888L, 0)
 
static MYSQL_THDVAR_STR (simple_thdvar_two, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_MEMALLOC, "Simple fulltext parser example thread variable number two. Give a string.", nullptr, nullptr, "simple thdvar two default")
 
 mysql_declare_plugin (ftexample)
 

Variables

static long number_of_calls = 0
 
static struct st_mysql_ftparser simple_parser_descriptor
 
static SHOW_VAR simple_status []
 
static long sysvar_one_value
 
static char * sysvar_two_value
 
static SYS_VARsimple_system_variables []
 
 mysql_declare_plugin_end
 

Function Documentation

◆ add_word()

static void add_word ( MYSQL_FTPARSER_PARAM param,
char *  word,
size_t  len 
)
static

◆ mysql_declare_plugin()

mysql_declare_plugin ( ftexample  )

◆ MYSQL_SYSVAR_LONG()

static MYSQL_SYSVAR_LONG ( simple_sysvar_one  ,
sysvar_one_value  ,
PLUGIN_VAR_RQCMDARG  ,
"Simple fulltext parser example system variable number one. Give a number."  ,
nullptr  ,
nullptr  ,
77L  ,
7L  ,
777L  ,
 
)
static

◆ MYSQL_SYSVAR_STR()

static MYSQL_SYSVAR_STR ( simple_sysvar_two  ,
sysvar_two_value  ,
PLUGIN_VAR_RQCMDARG PLUGIN_VAR_MEMALLOC,
"Simple fulltext parser example system variable number two. Give a string."  ,
nullptr  ,
nullptr  ,
"simple sysvar two default"   
)
static

◆ MYSQL_THDVAR_LONG()

static MYSQL_THDVAR_LONG ( simple_thdvar_one  ,
PLUGIN_VAR_RQCMDARG  ,
"Simple fulltext parser example thread variable number one. Give a number."  ,
nullptr  ,
nullptr  ,
88L  ,
8L  ,
888L  ,
 
)
static

◆ MYSQL_THDVAR_STR()

static MYSQL_THDVAR_STR ( simple_thdvar_two  ,
PLUGIN_VAR_RQCMDARG PLUGIN_VAR_MEMALLOC,
"Simple fulltext parser example thread variable number two. Give a string."  ,
nullptr  ,
nullptr  ,
"simple thdvar two default"   
)
static

◆ simple_parser_deinit()

static int simple_parser_deinit ( MYSQL_FTPARSER_PARAM param)
static

◆ simple_parser_init()

static int simple_parser_init ( MYSQL_FTPARSER_PARAM param)
static

◆ simple_parser_parse()

static int simple_parser_parse ( MYSQL_FTPARSER_PARAM param)
static

◆ simple_parser_plugin_deinit()

static int simple_parser_plugin_deinit ( void *  arg)
static

◆ simple_parser_plugin_init()

static int simple_parser_plugin_init ( void *  arg)
static

Variable Documentation

◆ mysql_declare_plugin_end

mysql_declare_plugin_end

◆ number_of_calls

long number_of_calls = 0
static

◆ simple_parser_descriptor

struct st_mysql_ftparser simple_parser_descriptor
static
Initial value:
= {
}
#define MYSQL_FTPARSER_INTERFACE_VERSION
Definition: plugin.h:658
static int simple_parser_deinit(MYSQL_FTPARSER_PARAM *param)
Definition: plugin_example.cc:124
static int simple_parser_parse(MYSQL_FTPARSER_PARAM *param)
Definition: plugin_example.cc:170
static int simple_parser_init(MYSQL_FTPARSER_PARAM *param)
Definition: plugin_example.cc:106

◆ simple_status

SHOW_VAR simple_status[]
static
Initial value:
= {
{"static", const_cast<char *>("just a static text"), SHOW_CHAR,
{nullptr, nullptr, SHOW_UNDEF, SHOW_SCOPE_GLOBAL}}
static long number_of_calls
Definition: plugin_example.cc:33
@ SHOW_LONG
shown as unsigned long
Definition: status_var.h:34
@ SHOW_CHAR
Definition: status_var.h:36
@ SHOW_UNDEF
Definition: status_var.h:31
@ SHOW_SCOPE_GLOBAL
Definition: status_var.h:70

◆ simple_system_variables

SYS_VAR* simple_system_variables[]
static
Initial value:
= {
MYSQL_SYSVAR(simple_sysvar_one), MYSQL_SYSVAR(simple_sysvar_two),
MYSQL_SYSVAR(simple_thdvar_one), MYSQL_SYSVAR(simple_thdvar_two), nullptr}
#define MYSQL_SYSVAR(name)
Definition: plugin.h:255

◆ sysvar_one_value

long sysvar_one_value
static

◆ sysvar_two_value

char* sysvar_two_value
static