MySQL 8.1.0
Source Code Documentation
plugin_clone.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 2023, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23/**
24@file mysql/plugin_clone.h
25API for clone plugin
26*/
27
28#ifndef MYSQL_PLUGIN_CLONE_INCLUDED
29#define MYSQL_PLUGIN_CLONE_INCLUDED
30
31#include "plugin.h"
32#include "violite.h"
33
34/** Clone plugin interface version */
35#define MYSQL_CLONE_INTERFACE_VERSION 0x0100
36
37/**
38 The descriptor structure for the plugin, that is referred from
39 st_mysql_plugin.
40*/
41
43 /** clone plugin interface version */
45
46 /** Clone database from local server.
47 @param[in] thd server thread handle
48 @param[in] data_dir cloned data directory
49 @return error code, 0 on success */
50 int (*clone_local)(THD *thd, const char *data_dir);
51
52 /** Clone database from remote server.
53 @param[in] thd server thread handle
54 @param[in] remote_host remote host IP address
55 @param[in] remote_port remote server port
56 @param[in] remote_user remote user name
57 @param[in] remote_passwd remote user's password
58 @param[in] data_dir cloned data directory
59 @param[in] ssl_mode ssl mode for remote connection
60 @return error code, 0 on success */
61 int (*clone_client)(THD *thd, const char *remote_host, uint remote_port,
62 const char *remote_user, const char *remote_passwd,
63 const char *data_dir, int ssl_mode);
64
65 /** Clone database and send to remote clone client.
66 @param[in] thd server thread handle
67 @param[in] socket network socket to remote client
68 @return error code, 0 on success */
70};
71
72/** Create clone handle to access the clone interfaces from server.
73Called when Clone plugin is installed.
74@param[in] plugin_name clone plugin name
75@return error code */
76int clone_handle_create(const char *plugin_name);
77
78/** Drop clone handle. Called when Clone plugin is uninstalled.
79@return error code */
81
82/** Check if it is safe to uninstall clone plugin.
83@param[in,out] plugin_info plugin
84@return error code */
86
87#endif
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
void * MYSQL_PLUGIN
Definition: plugin.h:81
stdx::expected< native_handle_type, error_type > socket(int family, int sock_type, int protocol)
Definition: socket.h:62
int clone_handle_drop()
Drop clone handle.
Definition: clone_handler.cc:307
int clone_handle_check_drop(MYSQL_PLUGIN plugin_info)
Check if it is safe to uninstall clone plugin.
Definition: clone_handler.cc:293
int clone_handle_create(const char *plugin_name)
Create clone handle to access the clone interfaces from server.
Definition: clone_handler.cc:277
static MYSQL_PLUGIN plugin_info
Definition: rewriter_plugin.cc:88
LEX_CSTRING * plugin_name(st_plugin_int **ref)
Definition: sql_plugin_ref.h:94
An instrumented socket.
Definition: mysql_socket_bits.h:34
The descriptor structure for the plugin, that is referred from st_mysql_plugin.
Definition: plugin_clone.h:42
int interface_version
clone plugin interface version
Definition: plugin_clone.h:44
int(* clone_server)(THD *thd, MYSQL_SOCKET socket)
Clone database and send to remote clone client.
Definition: plugin_clone.h:69
int(* clone_client)(THD *thd, const char *remote_host, uint remote_port, const char *remote_user, const char *remote_passwd, const char *data_dir, int ssl_mode)
Clone database from remote server.
Definition: plugin_clone.h:61
int(* clone_local)(THD *thd, const char *data_dir)
Clone database from local server.
Definition: plugin_clone.h:50
Vio Lite.