MySQL  8.0.27
Source Code Documentation
udf_handler Class Reference

#include <sql_udf.h>

Public Member Functions

 udf_handler (udf_func *udf_arg)
 
 udf_handler (const udf_handler &)=default
 
 udf_handler (udf_handler &&)=default
 
udf_handleroperator= (const udf_handler &)=default
 
udf_handleroperator= (udf_handler &&)=default
 
void clean_buffers ()
 
void free_handler ()
 
bool is_initialized () const
 
const char * name () const
 
Item_result result_type () const
 
bool fix_fields (THD *thd, Item_result_field *item, uint arg_count, Item **args)
 
void cleanup ()
 
bool call_init_func ()
 
double val_real (bool *null_value)
 
longlong val_int (bool *null_value)
 
my_decimalval_decimal (bool *null_value, my_decimal *dec_buf)
 
Stringval_str (String *str, String *save_str)
 
void clear ()
 
void add (bool *null_value)
 

Public Attributes

table_map used_tables_cache {0}
 
bool m_original {true}
 

Protected Attributes

udf_funcu_d
 
Stringbuffers {nullptr}
 
UDF_ARGS f_args
 
UDF_INIT initid
 
char * num_buffer {nullptr}
 
uchar error {0}
 
uchar is_null {0}
 
bool m_initialized {false}
 True when handler has been initialized and use count incremented. More...
 
bool m_init_func_called {false}
 True when init function has been called. More...
 
Item ** args
 
Udf_args_extension m_args_extension
 A struct that holds the extension arguments for each UDF argument. More...
 
Udf_return_value_extension m_return_value_extension
 A struct that holds the extension arguments for return value. More...
 

Private Member Functions

bool get_arguments ()
 
Stringresult_string (const char *res, size_t res_length, String *str, String *save_str)
 Process the result string returned by the udf() method. More...
 
void get_string (uint index)
 Get the details of the input String arguments. More...
 
bool get_and_convert_string (uint index)
 Get the details of the input String argument. More...
 

Constructor & Destructor Documentation

◆ udf_handler() [1/3]

udf_handler::udf_handler ( udf_func udf_arg)

◆ udf_handler() [2/3]

udf_handler::udf_handler ( const udf_handler )
default

◆ udf_handler() [3/3]

udf_handler::udf_handler ( udf_handler &&  )
default

Member Function Documentation

◆ add()

void udf_handler::add ( bool *  null_value)

◆ call_init_func()

bool udf_handler::call_init_func ( )

◆ clean_buffers()

void udf_handler::clean_buffers ( )

◆ cleanup()

void udf_handler::cleanup ( void  )

◆ clear()

void udf_handler::clear ( )

◆ fix_fields()

bool udf_handler::fix_fields ( THD thd,
Item_result_field item,
uint  arg_count,
Item **  args 
)

◆ free_handler()

void udf_handler::free_handler ( )

◆ get_and_convert_string()

bool udf_handler::get_and_convert_string ( uint  index)
private

Get the details of the input String argument.

If the charset of the input argument is not same as specified by the user then convert the String.

Parameters
[in]indexof the argument to be looked in the arguments array
Return values
falseAble to fetch the argument details
trueOtherwise

◆ get_arguments()

bool udf_handler::get_arguments ( )
private

◆ get_string()

void udf_handler::get_string ( uint  index)
private

Get the details of the input String arguments.

Parameters
[in]indexof the argument to be looked in the arguments array

◆ is_initialized()

bool udf_handler::is_initialized ( ) const
inline

◆ name()

const char* udf_handler::name ( ) const
inline

◆ operator=() [1/2]

udf_handler& udf_handler::operator= ( const udf_handler )
default

◆ operator=() [2/2]

udf_handler& udf_handler::operator= ( udf_handler &&  )
default

◆ result_string()

String * udf_handler::result_string ( const char *  res,
size_t  res_length,
String str,
String save_str 
)
private

Process the result string returned by the udf() method.

The charset info might have changed therefore updates the same String. If user used the input String as result string then return the same.

Parameters
[in]resthe result string returned by the udf() method.
[in]res_lengthlength of the string
[out]strThe input result string passed to the udf() method
[out]save_strKeeps copy of the returned String
Returns
A pointer to either the str or save_str that points to final result String

◆ result_type()

Item_result udf_handler::result_type ( ) const
inline

◆ val_decimal()

my_decimal * udf_handler::val_decimal ( bool *  null_value,
my_decimal dec_buf 
)

◆ val_int()

longlong udf_handler::val_int ( bool *  null_value)

◆ val_real()

double udf_handler::val_real ( bool *  null_value)

◆ val_str()

String * udf_handler::val_str ( String str,
String save_str 
)
Returns
(String*)NULL in case of NULL values

Member Data Documentation

◆ args

Item** udf_handler::args
protected

◆ buffers

String* udf_handler::buffers {nullptr}
protected

◆ error

uchar udf_handler::error {0}
protected

◆ f_args

UDF_ARGS udf_handler::f_args
protected

◆ initid

UDF_INIT udf_handler::initid
protected

◆ is_null

uchar udf_handler::is_null {0}
protected

◆ m_args_extension

Udf_args_extension udf_handler::m_args_extension
protected

A struct that holds the extension arguments for each UDF argument.

◆ m_init_func_called

bool udf_handler::m_init_func_called {false}
protected

True when init function has been called.

◆ m_initialized

bool udf_handler::m_initialized {false}
protected

True when handler has been initialized and use count incremented.

◆ m_original

bool udf_handler::m_original {true}

◆ m_return_value_extension

Udf_return_value_extension udf_handler::m_return_value_extension
protected

A struct that holds the extension arguments for return value.

◆ num_buffer

char* udf_handler::num_buffer {nullptr}
protected

◆ u_d

udf_func* udf_handler::u_d
protected

◆ used_tables_cache

table_map udf_handler::used_tables_cache {0}

The documentation for this class was generated from the following files: