MySQL 8.4.3
Source Code Documentation
udf_example.cc File Reference
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <mutex>
#include <new>
#include <regex>
#include <string>
#include <vector>
#include "mysql.h"
#include "mysql/udf_registration_types.h"
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>

Classes

struct  avgcost_data
 
struct  My_median_data
 

Macros

#define MAXMETAPH   8
 
#define ISVOWEL(x)   (codes[(x) - 'A'] & 1) /* AEIOU */
 
#define NOCHANGE(x)   (codes[(x) - 'A'] & 2) /* FJLMNR */
 
#define AFFECTH(x)   (codes[(x) - 'A'] & 4) /* CGPST */
 
#define MAKESOFT(x)   (codes[(x) - 'A'] & 8) /* EIY */
 
#define NOGHTOF(x)   (codes[(x) - 'A'] & 16) /* BDH */
 

Functions

bool metaphon_init (UDF_INIT *initid, UDF_ARGS *args, char *message)
 
void metaphon_deinit (UDF_INIT *)
 
char * metaphon (UDF_INIT *, UDF_ARGS *args, char *result, unsigned long *length, unsigned char *is_null, unsigned char *)
 
bool myfunc_double_init (UDF_INIT *initid, UDF_ARGS *args, char *message)
 
double myfunc_double (UDF_INIT *, UDF_ARGS *args, unsigned char *is_null, unsigned char *)
 
long long myfunc_int (UDF_INIT *, UDF_ARGS *args, unsigned char *, unsigned char *)
 
bool myfunc_int_init (UDF_INIT *, UDF_ARGS *, char *)
 
bool sequence_init (UDF_INIT *initid, UDF_ARGS *args, char *message)
 
void sequence_deinit (UDF_INIT *initid)
 
long long sequence (UDF_INIT *initid, UDF_ARGS *args, unsigned char *, unsigned char *)
 
bool lookup_init (UDF_INIT *initid, UDF_ARGS *args, char *message)
 
void lookup_deinit (UDF_INIT *)
 
char * lookup (UDF_INIT *, UDF_ARGS *args, char *result, unsigned long *res_length, unsigned char *null_value, unsigned char *)
 
bool reverse_lookup_init (UDF_INIT *initid, UDF_ARGS *args, char *message)
 
void reverse_lookup_deinit (UDF_INIT *)
 
char * reverse_lookup (UDF_INIT *, UDF_ARGS *args, char *result, unsigned long *res_length, unsigned char *null_value, unsigned char *)
 
bool avgcost_init (UDF_INIT *initid, UDF_ARGS *args, char *message)
 
void avgcost_deinit (UDF_INIT *initid)
 
void avgcost_clear (UDF_INIT *initid, unsigned char *, unsigned char *)
 
void avgcost_add (UDF_INIT *initid, UDF_ARGS *args, unsigned char *, unsigned char *)
 
double avgcost (UDF_INIT *initid, UDF_ARGS *, unsigned char *is_null, unsigned char *)
 
bool myfunc_argument_name_init (UDF_INIT *initid, UDF_ARGS *args, char *message)
 
char * myfunc_argument_name (UDF_INIT *, UDF_ARGS *args, char *result, unsigned long *length, unsigned char *null_value, unsigned char *)
 
bool is_const_init (UDF_INIT *initid, UDF_ARGS *args, char *message)
 
char * is_const (UDF_INIT *initid, UDF_ARGS *, char *result, unsigned long *length, unsigned char *is_null, unsigned char *)
 
bool check_const_len_init (UDF_INIT *initid, UDF_ARGS *args, char *message)
 
char * check_const_len (UDF_INIT *initid, UDF_ARGS *, char *result, unsigned long *length, unsigned char *is_null, unsigned char *)
 
bool my_median_init (UDF_INIT *initid, UDF_ARGS *, char *message)
 
void my_median_deinit (UDF_INIT *initid)
 
void my_median_add (UDF_INIT *initid, UDF_ARGS *args, unsigned char *, unsigned char *)
 
void my_median_clear (UDF_INIT *initid, unsigned char *, unsigned char *)
 
long long my_median (UDF_INIT *initid, UDF_ARGS *, unsigned char *is_null, unsigned char *)
 

Variables

static std::mutex * LOCK_hostname {nullptr}
 
static char codes [26]
 

Macro Definition Documentation

◆ AFFECTH

#define AFFECTH (   x)    (codes[(x) - 'A'] & 4) /* CGPST */

◆ ISVOWEL

#define ISVOWEL (   x)    (codes[(x) - 'A'] & 1) /* AEIOU */

◆ MAKESOFT

#define MAKESOFT (   x)    (codes[(x) - 'A'] & 8) /* EIY */

◆ MAXMETAPH

#define MAXMETAPH   8

◆ NOCHANGE

#define NOCHANGE (   x)    (codes[(x) - 'A'] & 2) /* FJLMNR */

◆ NOGHTOF

#define NOGHTOF (   x)    (codes[(x) - 'A'] & 16) /* BDH */

Function Documentation

◆ avgcost()

double avgcost ( UDF_INIT initid,
UDF_ARGS ,
unsigned char *  is_null,
unsigned char *   
)

◆ avgcost_add()

void avgcost_add ( UDF_INIT initid,
UDF_ARGS args,
unsigned char *  ,
unsigned char *   
)

◆ avgcost_clear()

void avgcost_clear ( UDF_INIT initid,
unsigned char *  ,
unsigned char *   
)

◆ avgcost_deinit()

void avgcost_deinit ( UDF_INIT initid)

◆ avgcost_init()

bool avgcost_init ( UDF_INIT initid,
UDF_ARGS args,
char *  message 
)

◆ check_const_len()

char * check_const_len ( UDF_INIT initid,
UDF_ARGS ,
char *  result,
unsigned long *  length,
unsigned char *  is_null,
unsigned char *   
)

◆ check_const_len_init()

bool check_const_len_init ( UDF_INIT initid,
UDF_ARGS args,
char *  message 
)

◆ is_const()

char * is_const ( UDF_INIT initid,
UDF_ARGS ,
char *  result,
unsigned long *  length,
unsigned char *  is_null,
unsigned char *   
)

◆ is_const_init()

bool is_const_init ( UDF_INIT initid,
UDF_ARGS args,
char *  message 
)

◆ lookup()

char * lookup ( UDF_INIT ,
UDF_ARGS args,
char *  result,
unsigned long *  res_length,
unsigned char *  null_value,
unsigned char *   
)

◆ lookup_deinit()

void lookup_deinit ( UDF_INIT )

◆ lookup_init()

bool lookup_init ( UDF_INIT initid,
UDF_ARGS args,
char *  message 
)

◆ metaphon()

char * metaphon ( UDF_INIT ,
UDF_ARGS args,
char *  result,
unsigned long *  length,
unsigned char *  is_null,
unsigned char *   
)

◆ metaphon_deinit()

void metaphon_deinit ( UDF_INIT )

◆ metaphon_init()

bool metaphon_init ( UDF_INIT initid,
UDF_ARGS args,
char *  message 
)

◆ my_median()

long long my_median ( UDF_INIT initid,
UDF_ARGS ,
unsigned char *  is_null,
unsigned char *   
)

◆ my_median_add()

void my_median_add ( UDF_INIT initid,
UDF_ARGS args,
unsigned char *  ,
unsigned char *   
)

◆ my_median_clear()

void my_median_clear ( UDF_INIT initid,
unsigned char *  ,
unsigned char *   
)

◆ my_median_deinit()

void my_median_deinit ( UDF_INIT initid)

◆ my_median_init()

bool my_median_init ( UDF_INIT initid,
UDF_ARGS ,
char *  message 
)

◆ myfunc_argument_name()

char * myfunc_argument_name ( UDF_INIT ,
UDF_ARGS args,
char *  result,
unsigned long *  length,
unsigned char *  null_value,
unsigned char *   
)

◆ myfunc_argument_name_init()

bool myfunc_argument_name_init ( UDF_INIT initid,
UDF_ARGS args,
char *  message 
)

◆ myfunc_double()

double myfunc_double ( UDF_INIT ,
UDF_ARGS args,
unsigned char *  is_null,
unsigned char *   
)

◆ myfunc_double_init()

bool myfunc_double_init ( UDF_INIT initid,
UDF_ARGS args,
char *  message 
)

◆ myfunc_int()

long long myfunc_int ( UDF_INIT ,
UDF_ARGS args,
unsigned char *  ,
unsigned char *   
)

◆ myfunc_int_init()

bool myfunc_int_init ( UDF_INIT ,
UDF_ARGS ,
char *   
)

◆ reverse_lookup()

char * reverse_lookup ( UDF_INIT ,
UDF_ARGS args,
char *  result,
unsigned long *  res_length,
unsigned char *  null_value,
unsigned char *   
)

◆ reverse_lookup_deinit()

void reverse_lookup_deinit ( UDF_INIT )

◆ reverse_lookup_init()

bool reverse_lookup_init ( UDF_INIT initid,
UDF_ARGS args,
char *  message 
)

◆ sequence()

long long sequence ( UDF_INIT initid,
UDF_ARGS args,
unsigned char *  ,
unsigned char *   
)

◆ sequence_deinit()

void sequence_deinit ( UDF_INIT initid)

◆ sequence_init()

bool sequence_init ( UDF_INIT initid,
UDF_ARGS args,
char *  message 
)

Variable Documentation

◆ codes

char codes[26]
static
Initial value:
= {
1, 16, 4, 16, 9, 2, 4, 16, 9, 2, 0, 2, 2, 2,
1, 4, 0, 2, 4, 4, 1, 0, 0, 0, 8, 0
}

◆ LOCK_hostname

std::mutex* LOCK_hostname {nullptr}
static