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