MySQL 8.0.40
Source Code Documentation
clone_handler.cc File Reference
#include "sql/clone_handler.h"
#include <assert.h>
#include <string.h>
#include <cctype>
#include <chrono>
#include <cstdlib>
#include <string>
#include <thread>
#include "my_dir.h"
#include "my_inttypes.h"
#include "my_sys.h"
#include "mysql/components/services/log_builtins.h"
#include "mysql/plugin.h"
#include "mysql/plugin_clone.h"
#include "mysql/psi/mysql_file.h"
#include "mysql/psi/mysql_mutex.h"
#include "mysqld_error.h"
#include "sql/dd/upgrade_57/upgrade.h"
#include "sql/mysqld.h"
#include "sql/sql_class.h"
#include "sql/sql_parse.h"
#include "sql/sql_plugin.h"
#include "sql/srv_session.h"
#include "sql_string.h"
#include "violite.h"

Functions

THDthd_get_current_thd ()
 Get current THD object from thread local data. More...
 
int clone_handle_create (const char *plugin_name)
 Create clone handle to access the clone interfaces from server. More...
 
int clone_handle_check_drop (MYSQL_PLUGIN plugin_info)
 Check if it is safe to uninstall clone plugin. More...
 
int clone_handle_drop ()
 Drop clone handle. More...
 
Clone_handlerclone_plugin_lock (THD *thd, plugin_ref *plugin)
 Check if the clone plugin is installed and lock. More...
 
void clone_plugin_unlock (THD *thd, plugin_ref plugin)
 Unlock the clone plugin. More...
 

Variables

Clone_handlerclone_handle = nullptr
 Clone handler global. More...
 
const char * clone_plugin_nm = "clone"
 Clone plugin name. More...
 

Function Documentation

◆ clone_handle_check_drop()

int clone_handle_check_drop ( MYSQL_PLUGIN  plugin_info)

Check if it is safe to uninstall clone plugin.

Parameters
[in,out]plugin_infoplugin
Returns
error code

◆ clone_handle_create()

int clone_handle_create ( const char *  plugin_name)

Create clone handle to access the clone interfaces from server.

Called when Clone plugin is installed.

Parameters
[in]plugin_nameclone plugin name
Returns
error code

◆ clone_handle_drop()

int clone_handle_drop ( )

Drop clone handle.

Called when Clone plugin is uninstalled.

Returns
error code

◆ clone_plugin_lock()

Clone_handler * clone_plugin_lock ( THD thd,
plugin_ref plugin 
)

Check if the clone plugin is installed and lock.

If the plugin is ready, return the handler to caller.

Parameters
[in]thdserver thread handle
[out]pluginplugin reference
Returns
clone handler on success otherwise NULL

◆ clone_plugin_unlock()

void clone_plugin_unlock ( THD thd,
plugin_ref  plugin 
)

Unlock the clone plugin.

Parameters
[in]thdserver thread handle
[out]pluginplugin reference

◆ thd_get_current_thd()

THD * thd_get_current_thd ( )

Get current THD object from thread local data.

Return values
TheTHD object for the thread, NULL if not connection thread

Variable Documentation

◆ clone_handle

Clone_handler* clone_handle = nullptr

Clone handler global.

◆ clone_plugin_nm

const char* clone_plugin_nm = "clone"

Clone plugin name.