MySQL  8.0.17
Source Code Documentation
plugin_clone.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
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
25 API 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 
42 struct Mysql_clone {
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 */
69  int (*clone_server)(THD *thd, MYSQL_SOCKET socket);
70 };
71 
72 /** Create clone handle to access the clone interfaces from server.
73 Called when Clone plugin is installed.
74 @param[in] plugin_name clone plugin name
75 @return error code */
76 int clone_handle_create(const char *plugin_name);
77 
78 /** Drop clone handle. Called when Clone plugin is uninstalled.
79 @return error code */
80 int clone_handle_drop();
81 
82 #endif
LEX_STRING * plugin_name(st_plugin_int **ref)
Definition: sql_plugin_ref.h:94
int interface_version
clone plugin interface version
Definition: plugin_clone.h:44
int clone_handle_create(const char *plugin_name)
Create clone handle to access the clone interfaces from server.
Definition: clone_handler.cc:204
The descriptor structure for the plugin, that is referred from st_mysql_plugin.
Definition: plugin_clone.h:42
int(* clone_local)(THD *thd, const char *data_dir)
Clone database from local server.
Definition: plugin_clone.h:50
unsigned int uint
Definition: uca-dump.cc:29
int clone_handle_drop()
Drop clone handle.
Definition: clone_handler.cc:220
An instrumented socket.
Definition: mysql_socket_bits.h:34
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
Vio Lite.
int(* clone_server)(THD *thd, MYSQL_SOCKET socket)
Clone database and send to remote clone client.
Definition: plugin_clone.h:69
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:777