Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
6adbda3
Clone Plugin - Oracle 9.1.0 Innovation
mariadb-DebarunBanerjee Oct 29, 2024
6ec37ac
Clone Plugin - Compile plugin part-I
mariadb-DebarunBanerjee Nov 5, 2024
7d798e6
Clone Plugin - Compile plugin part-II
mariadb-DebarunBanerjee Nov 5, 2024
199ab4c
Clone Plugin - Services: Exccuding configs and validation
mariadb-DebarunBanerjee Nov 15, 2024
132c029
Clone Plugin - Syntax and server changes to interface with Clone Plugin
mariadb-DebarunBanerjee Dec 2, 2024
db78e9c
Clone Plugin - Fix Plugin load issue
mariadb-DebarunBanerjee Dec 2, 2024
5376f84
Clone Plugin - Fix PFS initialization issue
mariadb-DebarunBanerjee Dec 2, 2024
02011da
Clone Plugin - Donor List Validation, NO SSL
mariadb-DebarunBanerjee Dec 2, 2024
cbad4d8
Clone Innodb - Oracle 9.1.0 Innovation
mariadb-DebarunBanerjee Dec 3, 2024
c6c717d
Clone Innodb Archive - Compile part-I
mariadb-DebarunBanerjee Dec 16, 2024
c29f565
Clone Innodb Archive - Compile part-II
mariadb-DebarunBanerjee Jan 10, 2025
888acaa
Clone Innodb Log Archive - Compile part-I
mariadb-DebarunBanerjee Jan 15, 2025
88c18f3
Clone Innodb Log Archive - Compile part-II
mariadb-DebarunBanerjee Jan 16, 2025
6929845
Clone Innodb - Compile part-I
mariadb-DebarunBanerjee Jan 19, 2025
26004ed
Clone Innodb - Compile part-II
mariadb-DebarunBanerjee Jan 23, 2025
12001aa
Clone Innodb - Compile part-III
mariadb-DebarunBanerjee Jan 24, 2025
b03c092
Clone Innodb - Compile part-IV
mariadb-DebarunBanerjee Jan 28, 2025
f878d83
Clone Plugin - Services: Configs and validation
mariadb-DebarunBanerjee Jan 30, 2025
3b657ea
Clone Innodb - Compile part-V
mariadb-DebarunBanerjee Feb 13, 2025
c3f1edf
Clone - Key flow part-I
mariadb-DebarunBanerjee Feb 19, 2025
adda516
Clone - Fix compilation issues after 12.0 merge
mariadb-DebarunBanerjee Feb 20, 2025
d891e81
Clone - Key flow part-II: Archiver Background
mariadb-DebarunBanerjee Feb 28, 2025
40aecac
Clone - Key flow part-III: Page Archiver Duplicate Detection
mariadb-DebarunBanerjee Mar 3, 2025
a7d81f7
Clone - Key flow part-IV: Log Archiver Synchronization
mariadb-DebarunBanerjee Mar 19, 2025
869fc5a
Clone - Key flow part-V: Remote Clone
mariadb-DebarunBanerjee Apr 18, 2025
270e292
Clone - Multiple SE: Remote Protocol and Concurrency
mariadb-DebarunBanerjee Apr 23, 2025
396cf4f
Clone - Multiple SE: Handler Interface Multi-Phase
mariadb-DebarunBanerjee Apr 23, 2025
98637bf
Clone - Multiple SE: local/remote synchronization for multi stage
mariadb-DebarunBanerjee Apr 25, 2025
8a5f74d
Clone - Multiple SE: Common SE handlerton
mariadb-DebarunBanerjee May 15, 2025
dc2e27e
Clone - Multiple SE: Common SE FRM and related files
mariadb-DebarunBanerjee May 17, 2025
f1017a9
Clone - Multiple SE: ARIA
mariadb-DebarunBanerjee May 23, 2025
7db18f8
Clone Innodb - Fix redo header LSN & checkpoint LSN
mariadb-DebarunBanerjee May 26, 2025
176ab2b
Clone Final Integration: Various fixes
mariadb-DebarunBanerjee May 30, 2025
7b122d1
Clone Binary Log GTID
mariadb-DebarunBanerjee Jun 2, 2025
bcae5ae
Archiver: LSN related changes to cope with
mariadb-DebarunBanerjee Aug 11, 2025
59fa7f9
Clone Tests - Oracle 9.4.0 Innovation
mariadb-DebarunBanerjee Aug 12, 2025
df1fcd3
- Implemented BACKUP STAGE command service from CLONE plugin
Thirunarayanan Aug 6, 2025
7130387
- Handled free page while doing PAGE_APPLY phase
Thirunarayanan Aug 12, 2025
d08c41a
- Addressed clone_start_statement failure when multiple worker
Thirunarayanan Aug 12, 2025
f5015ae
Added 4 test case so far:
Thirunarayanan Aug 13, 2025
8a18baf
- Removed XA related code in clone plugin
Thirunarayanan Aug 14, 2025
8b39ba2
- Failed to include .opt for create schema and local_file_extend test…
Thirunarayanan Aug 14, 2025
be3d4b2
- Made changes in clone.local_boundary
Thirunarayanan Aug 14, 2025
be93c48
- Disable page_compressed and encrypted tablespace for clone operation
Thirunarayanan Aug 14, 2025
78f1d31
- Removed page_compressed test case
Thirunarayanan Aug 14, 2025
6979c81
Clone Page Copy: Free Page
mariadb-DebarunBanerjee Aug 18, 2025
b3ea309
Redo Archiver PMEM: Prevent overwrite
mariadb-DebarunBanerjee Aug 18, 2025
8e819ab
Clone redo copy: Multiple archiver files to single file
mariadb-DebarunBanerjee Aug 18, 2025
24845e2
- Block remote clone and remote replace clone
Thirunarayanan Aug 18, 2025
8ec30b5
- Added clone.monitor_progress test case
Thirunarayanan Aug 18, 2025
dc10fae
- Removed the remote related test case.
Thirunarayanan Aug 18, 2025
6df9a77
- Added the test case to check proper permission before doing clone o…
Thirunarayanan Aug 19, 2025
7d3f173
- Removed the ddl related test case
Thirunarayanan Aug 19, 2025
a29a14c
- Removed unused test and unused result file
Thirunarayanan Aug 19, 2025
8cc42df
- Made some test case changes to consistently print restart_parameters
Thirunarayanan Aug 19, 2025
0c2afac
- Made the changes in mysql-test-run.pl to run the clone suite by def…
Thirunarayanan Aug 19, 2025
00cb719
Fix clone.local_boundary
mariadb-DebarunBanerjee Aug 18, 2025
f82f5e2
Fix Execution State: Error handling
mariadb-DebarunBanerjee Aug 18, 2025
a9dd74f
Fix clone.error_archival
mariadb-DebarunBanerjee Aug 19, 2025
8caf907
Log Archiver: LSN alignment to start_lsn
mariadb-DebarunBanerjee Aug 20, 2025
f8edeec
- Change in backup_stage_and_lock test case
Thirunarayanan Aug 21, 2025
1bcf1c6
- Abort redo log resizing when clone is in progress.
Thirunarayanan Aug 21, 2025
7b16875
- Added Aria based clone testcase
Thirunarayanan Aug 21, 2025
dedc81e
Fixing compilation failure
Thirunarayanan Aug 21, 2025
0dc178d
- Fixed mariabackup, perfschema and sysschema suite test case failures
Thirunarayanan Aug 21, 2025
05f4462
- Added have_debug.inc for clone.aria_basic
Thirunarayanan Aug 21, 2025
ef85e78
Fixing few more test case failure
Thirunarayanan Aug 21, 2025
2c0819e
- Fixed the compilation for embedded build
Thirunarayanan Aug 21, 2025
1c99fe4
- Fixing compilation failure
Thirunarayanan Aug 21, 2025
916577f
- Few more compilation issue
Thirunarayanan Aug 21, 2025
2912e76
- Fixed clone.aria_basic test case
Thirunarayanan Aug 22, 2025
e29d405
Fix clone recovery with redo file larger than configured size
mariadb-DebarunBanerjee Aug 21, 2025
b072ae1
Innodb Clone: Implement HA_CLONE_STAGE_SNAPSHOT
mariadb-DebarunBanerjee Aug 22, 2025
c791b48
- Fixed msan failure and few more compilation issues
Thirunarayanan Aug 22, 2025
5a8d59b
- Few more compilation on other build
Thirunarayanan Aug 22, 2025
d2826d7
- Fix compilation issue for windows
Thirunarayanan Aug 22, 2025
cabb54d
- Fixed windows compilation
Thirunarayanan Aug 22, 2025
7f61989
- Fixing windows compilation
Thirunarayanan Aug 23, 2025
e53df6b
- Fixing wstring compilation issue
Thirunarayanan Aug 25, 2025
16a4492
- Fixing debian build failure
Thirunarayanan Aug 25, 2025
543ae83
- Fixing windows build
Thirunarayanan Aug 25, 2025
84f1d5e
- Trying to fix debian build
Thirunarayanan Aug 25, 2025
e3c758e
- Fixed ps-protocol failure and few warnings
Thirunarayanan Aug 25, 2025
80bbba3
- Suppress warning
Thirunarayanan Aug 26, 2025
3b92be0
- Suppress few more warning
Thirunarayanan Aug 27, 2025
e497a7e
- Fix some warning
Thirunarayanan Aug 27, 2025
360d8ff
MDEV-37520 Failure to detect corruption during backups of Aria table
Thirunarayanan Aug 28, 2025
b5b84e5
- More aria test case
Thirunarayanan Aug 29, 2025
c229b31
- Clone should stop executing when redo log resizing, undo log trunca…
Thirunarayanan Aug 29, 2025
b518b81
- Add filesystem library for maria storage cmake
Thirunarayanan Aug 29, 2025
c82accc
- Make it compile on few platforms
Thirunarayanan Aug 29, 2025
f7f7ffb
- Fixing 32bit build.
Thirunarayanan Sep 1, 2025
61bfca8
- Use experimental::filesystem for the compiler less than GNU 9
Thirunarayanan Sep 2, 2025
72edd92
- Fixing compilation issue
Thirunarayanan Sep 2, 2025
8ea38e1
- Fixing more compilation
Thirunarayanan Sep 2, 2025
c05dba2
- Fixing more compilation issue
Thirunarayanan Sep 2, 2025
da42154
MDEV-36739: Porting test from Maria Backup to Clone
mariadb-satishkumar Aug 25, 2025
7cc113f
- Fixed few test case result changes.
Thirunarayanan Sep 2, 2025
6234b1f
- Compilation for embedded build without clone related code
Thirunarayanan Sep 2, 2025
b3dbab4
Link filesystem library for compiler less than gnu-9 version
Thirunarayanan Sep 2, 2025
1f64eef
- Fixing few more test case failures
Thirunarayanan Sep 2, 2025
d15ab64
- Removing all unused test case
Thirunarayanan Sep 4, 2025
4fd2564
- Removed few unused code
Thirunarayanan Sep 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions debian/mariadb-server.install
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ usr/lib/mysql/plugin/simple_password_check.so
usr/lib/mysql/plugin/sql_errlog.so
usr/lib/mysql/plugin/type_mysql_json.so
usr/lib/mysql/plugin/wsrep_info.so
usr/lib/mysql/plugin/mariadb_clone.so

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sigabrt found on debug build whilee testing main-MDEV-36733


main-MDEV-36733, origin/main-MDEV-36733 7cc113f555cecc6ade9cadd3e3ebae3c9129e0aa 2025-09-02T18:48:45+05:30

#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=139922541356608) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=139922541356608) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=139922541356608, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  __GI_abort () at ./stdlib/abort.c:79
#5  safe_mutex_destroy (mp=<myclone::Client::s_table_mutex>, file=<optimized out>, line=<optimized out>) at /data/Server/MDEV-36733/mysys/thr_mutex.c:597
#6  inline_mysql_mutex_destroy (src_line=712, src_file="/data/Server/MDEV-36733/plugin/clone/src/clone_client.cc", that=<optimized out>)
    at /data/Server/MDEV-36733/include/mysql/psi/mysql_thread.h:724
#7  myclone::Client::uninit_pfs () at /data/Server/MDEV-36733/plugin/clone/src/clone_client.cc:712
#8  myclone::Table_pfs::drop_proxy_tables () at /data/Server/MDEV-36733/plugin/clone/src/clone_status.cc:139
#9  myclone::Table_pfs::release_services () at /data/Server/MDEV-36733/plugin/clone/src/clone_status.cc:225
#10 plugin_clone_deinit (plugin_info=<optimized out>) at /data/Server/MDEV-36733/plugin/clone/src/clone_plugin.cc:408
#11 plugin_deinitialize (plugin=, ref_check=ref_check@entry=true) at /data/Server/MDEV-36733/sql/sql_plugin.cc:1279
#12 reap_plugins () at /data/Server/MDEV-36733/sql/sql_plugin.cc:1350
#13 mysql_uninstall_plugin (thd=thd@entry=, name=<optimized out>, dl_arg=<optimized out>) at /data/Server/MDEV-36733/sql/sql_plugin.cc:2494
#14 mysql_execute_command (thd=thd@entry=, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/Server/MDEV-36733/sql/sql_parse.cc:5790
#15 mysql_parse (thd=thd@entry=, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=) at /data/Server/MDEV-36733/sql/sql_parse.cc:7914
#16 dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=, packet=packet@entry="UNINSTALL PLUGIN IF EXISTS clone /* E_R Thread6 QNO 2774 CON_ID 23 */ ", 
    packet_length=packet_length@entry=70, blocking=blocking@entry=true) at /data/Server/MDEV-36733/sql/sql_parse.cc:1896
#17 do_command (thd=thd@entry=, blocking=blocking@entry=true) at /data/Server/MDEV-36733/sql/sql_parse.cc:1419
#18 do_handle_one_connection (connect=<optimized out>, connect@entry=, put_in_cache=put_in_cache@entry=true) at /data/Server/MDEV-36733/sql/sql_connect.cc:1414
#19 handle_one_connection (arg=) at /data/Server/MDEV-36733/sql/sql_connect.cc:1326
#20 start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#21 clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100

RR trace is present at pluto:-
/data/results/1756833677/TBR-2326
Raised the bug:-
https://jira.mariadb.org/browse/MDEV-37551

usr/share/doc/mariadb-server/mariadbd.sym.gz
usr/share/man/man1/aria_chk.1
usr/share/man/man1/aria_dump_log.1
Expand Down
18 changes: 10 additions & 8 deletions extra/mariabackup/aria_backup_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -400,16 +400,18 @@ bool Table::copy(ds_ctxt_t *ds, bool is_index, unsigned thread_num) {
for (ulonglong block= 0 ; ; block++) {
size_t length = m_cap.block_size;
if (is_index) {
if ((error= aria_read_index(
partition.m_index_file, &m_cap, block, copy_buffer) ==
HA_ERR_END_OF_FILE))
break;
error= aria_read_index(partition.m_index_file,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assertion found on main-MDEV-36733 on debug build


main-MDEV-36733, origin/main-MDEV-36733 7cc113f555cecc6ade9cadd3e3ebae3c9129e0aa 2025-09-02T18:48:45+05:30

# 2025-09-02T17:29:54 [2496309] | mariadbd: /data/Server/MDEV-36733/sql/sql_plugin.cc:1396: void intern_plugin_unlock(LEX*, plugin_ref): Assertion `pi->ref_count' failed.


Stacktrace

#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140442117543488) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140442117543488) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140442117543488, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  __GI_abort () at ./stdlib/abort.c:79
#5  __assert_fail_base (fmt="%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion="pi->ref_count", file="/data/Server/MDEV-36733/sql/sql_plugin.cc", line=1396, 
    function=<optimized out>) at ./assert/assert.c:92
#6  __GI___assert_fail (assertion="pi->ref_count", file="/data/Server/MDEV-36733/sql/sql_plugin.cc", line=1396, function="void intern_plugin_unlock(LEX*, plugin_ref)")
    at ./assert/assert.c:101
#7  intern_plugin_unlock (lex=lex@entry=, plugin=) at /data/Server/MDEV-36733/sql/sql_plugin.cc:1396
#8  plugin_unlock_list (thd=thd@entry=, list=, list@entry=, count=0, count@entry=86) at /data/Server/MDEV-36733/sql/sql_plugin.cc:1438
#9  plugin_foreach_with_mask (thd=<optimized out>, func=func@entry=<show_plugins(THD*, plugin_ref, void*)>, type=type@entry=-1, state_mask=state_mask@entry=4294967294, 
    arg=<optimized out>) at /data/Server/MDEV-36733/sql/sql_plugin.cc:2555
#10 fill_plugins (thd=<optimized out>, tables=<optimized out>, cond=<optimized out>) at /data/Server/MDEV-36733/sql/sql_show.cc:346
#11 get_schema_tables_result (join=join@entry=, executed_place=executed_place@entry=PROCESSED_BY_JOIN_EXEC) at /data/Server/MDEV-36733/sql/sql_show.cc:9740
#12 JOIN::exec_inner (this=this@entry=) at /data/Server/MDEV-36733/sql/sql_select.cc:5047
#13 JOIN::exec (this=this@entry=) at /data/Server/MDEV-36733/sql/sql_select.cc:4874
#14 mysql_select (thd=thd@entry=, tables=, fields=..., conds=, og_num=0, order=, group=, having=, proc_param=, select_options=2701396736, result=, unit=, select_lex=)
    at /data/Server/MDEV-36733/sql/sql_select.cc:5402
#15 handle_select (thd=thd@entry=, lex=lex@entry=, result=result@entry=, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/Server/MDEV-36733/sql/sql_select.cc:634
#16 execute_sqlcom_select (thd=thd@entry=, all_tables=) at /data/Server/MDEV-36733/sql/sql_parse.cc:6198
#17 mysql_execute_command (thd=thd@entry=, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/Server/MDEV-36733/sql/sql_parse.cc:3975
#18 mysql_parse (thd=thd@entry=, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=) at /data/Server/MDEV-36733/sql/sql_parse.cc:7914
#19 dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=, 
    packet=packet@entry="SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'clone' /* E_R Thread10 QNO 469 CON_ID 26 */ ", 
    packet_length=packet_length@entry=131, blocking=blocking@entry=true) at /data/Server/MDEV-36733/sql/sql_parse.cc:1896
#20 do_command (thd=thd@entry=, blocking=blocking@entry=true) at /data/Server/MDEV-36733/sql/sql_parse.cc:1419
#21 do_handle_one_connection (connect=<optimized out>, connect@entry=, put_in_cache=put_in_cache@entry=true) at /data/Server/MDEV-36733/sql/sql_connect.cc:1414
#22 handle_one_connection (arg=) at /data/Server/MDEV-36733/sql/sql_connect.cc:1326
#23 start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#24 clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100

RR trace is present on pluto:
/data/results/1756833677/TBR-2327

Raised the bug:-
https://jira.mariadb.org/browse/MDEV-37552

&m_cap, block,
copy_buffer);
Comment thread
dr-m marked this conversation as resolved.
} else {
if ((error= aria_read_data(
partition.m_data_file, &m_cap, block, copy_buffer, &length) ==
HA_ERR_END_OF_FILE))
break;
error= aria_read_data(partition.m_data_file,
&m_cap, block,
copy_buffer, &length);
}

if (error == HA_ERR_END_OF_FILE)
break;

if (error) {
msg(thread_num, "error: aria_read %s failed: %d",
is_index ? "index" : "data", error);
Expand Down
4 changes: 3 additions & 1 deletion include/mysql/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ typedef struct st_mysql_xid MYSQL_XID;
#define MYSQL_AUDIT_PLUGIN 5
#define MYSQL_REPLICATION_PLUGIN 6
#define MYSQL_AUTHENTICATION_PLUGIN 7
#define MYSQL_MAX_PLUGIN_TYPE_NUM 12 /**< The number of plugin types */
#define MYSQL_MAX_PLUGIN_TYPE_NUM 13 /**< The number of plugin types */

/* MariaDB plugin types */
/** Client and server password validation */
Expand All @@ -108,6 +108,8 @@ typedef struct st_mysql_xid MYSQL_XID;
#define MariaDB_DATA_TYPE_PLUGIN 10
/**< Plugins for new native SQL functions */
#define MariaDB_FUNCTION_PLUGIN 11
/** Plugin for cloning storage engine data */
#define MariaDB_CLONE_PLUGIN 12

/* We use the following strings to define licenses for plugins */
#define PLUGIN_LICENSE_PROPRIETARY 0
Expand Down
77 changes: 77 additions & 0 deletions include/mysql/plugin_audit.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,83 @@
void *dst, const char **end_ptr, int flags);
}
extern "C" {
typedef struct st_net_server NET_SERVER;
typedef struct st_mysql MYSQL;
typedef struct st_mysql_socket MYSQL_SOCKET;
typedef struct mysql_clone_ssl_context_t {
int m_ssl_mode;
const char *m_ssl_key;
const char *m_ssl_cert;
const char *m_ssl_ca;
bool m_enable_compression;
NET_SERVER *m_server_extn;
} mysql_clone_ssl_context;
extern struct clone_protocol_service_st {
THD* (*start_statement_fn)(THD* thd, unsigned int thread_key,
unsigned int statement_key,
const char* thd_name);
void (*finish_statement_fn)(THD* thd);
int (*get_charsets_fn)(THD* thd, void *char_sets);
int (*validate_charsets_fn)(THD* thd, void *char_sets);
int (*get_configs_fn)(THD* thd, void *configs);
int (*validate_configs_fn)(THD* thd, void *configs);
MYSQL* (*connect_fn)(THD* thd, const char *host, uint32_t port,
const char *user, const char *passwd,
mysql_clone_ssl_context *ssl_ctx,
MYSQL_SOCKET *socket);
int (*send_command_fn)(THD* thd, MYSQL *connection, bool set_active,
unsigned char command, unsigned char *com_buffer,
size_t buffer_length);
int (*get_response_fn)(THD* thd, MYSQL *connection, bool set_active,
uint32_t timeout, unsigned char **packet,
size_t *length, size_t *net_length);
int (*kill_fn)(MYSQL *connection, MYSQL *kill_connection);
void (*disconnect_fn)(THD* thd, MYSQL *connection, bool is_fatal,
bool clear_error);
void (*get_error_fn)(THD* thd, uint32_t *err_num,
const char **err_mesg);
int (*get_command_fn)(THD* thd, unsigned char *command,
unsigned char **com_buffer, size_t *buffer_length);
int (*send_response_fn)(THD* thd, bool secure, unsigned char *packet,
size_t length);
int (*send_error_fn)(THD* thd, unsigned char err_cmd, bool is_fatal);
int (*set_backup_stage_fn)(THD* thd, unsigned char stage);
int (*backup_lock_fn)(THD* thd, const char *db, const char *tbl);
int (*backup_unlock_fn)(THD* thd);
} *clone_protocol_service;
THD* clone_start_statement(THD* thd, unsigned int thread_key,
unsigned int statement_key,
const char* thd_name);
void clone_finish_statement(THD* thd);
int clone_get_charsets(THD* thd, void *char_sets);
int clone_validate_charsets(THD* thd, void *char_sets);
int clone_get_configs(THD* thd, void *configs);
int clone_validate_configs(THD* thd, void *configs);
MYSQL* clone_connect(THD* thd, const char *host, uint32_t port,
const char *user, const char *passwd,
mysql_clone_ssl_context *ssl_ctx,
MYSQL_SOCKET *socket);
int clone_send_command(THD* thd, MYSQL *connection, bool set_active,
unsigned char command, unsigned char *com_buffer,
size_t buffer_length);
int clone_get_response(THD* thd, MYSQL *connection, bool set_active,
uint32_t timeout, unsigned char **packet,
size_t *length, size_t *net_length);
int clone_kill(MYSQL *connection, MYSQL *kill_connection);
void clone_disconnect(THD* thd, MYSQL *connection, bool is_fatal,
bool clear_error);
void clone_get_error(THD* thd, uint32_t *err_num,
const char **err_mesg);
int clone_get_command(THD* thd, unsigned char *command,
unsigned char **com_buffer, size_t *buffer_length);
int clone_send_response(THD* thd, bool secure, unsigned char *packet,
size_t length);
int clone_send_error(THD* thd, unsigned char err_cmd, bool is_fatal);
int clone_set_backup_stage(THD* thd, unsigned char stage);
int clone_backup_lock(THD* thd, const char* db, const char* tbl);
int clone_backup_unlock(THD* thd);
}
extern "C" {
extern void (*debug_sync_C_callback_ptr)(THD*, const char *, size_t);
}
extern "C" {
Expand Down
77 changes: 77 additions & 0 deletions include/mysql/plugin_auth.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,83 @@
void *dst, const char **end_ptr, int flags);
}
extern "C" {
typedef struct st_net_server NET_SERVER;
typedef struct st_mysql MYSQL;
typedef struct st_mysql_socket MYSQL_SOCKET;
typedef struct mysql_clone_ssl_context_t {
int m_ssl_mode;
const char *m_ssl_key;
const char *m_ssl_cert;
const char *m_ssl_ca;
bool m_enable_compression;
NET_SERVER *m_server_extn;
} mysql_clone_ssl_context;
extern struct clone_protocol_service_st {
THD* (*start_statement_fn)(THD* thd, unsigned int thread_key,
unsigned int statement_key,
const char* thd_name);
void (*finish_statement_fn)(THD* thd);
int (*get_charsets_fn)(THD* thd, void *char_sets);
int (*validate_charsets_fn)(THD* thd, void *char_sets);
int (*get_configs_fn)(THD* thd, void *configs);
int (*validate_configs_fn)(THD* thd, void *configs);
MYSQL* (*connect_fn)(THD* thd, const char *host, uint32_t port,
const char *user, const char *passwd,
mysql_clone_ssl_context *ssl_ctx,
MYSQL_SOCKET *socket);
int (*send_command_fn)(THD* thd, MYSQL *connection, bool set_active,
unsigned char command, unsigned char *com_buffer,
size_t buffer_length);
int (*get_response_fn)(THD* thd, MYSQL *connection, bool set_active,
uint32_t timeout, unsigned char **packet,
size_t *length, size_t *net_length);
int (*kill_fn)(MYSQL *connection, MYSQL *kill_connection);
void (*disconnect_fn)(THD* thd, MYSQL *connection, bool is_fatal,
bool clear_error);
void (*get_error_fn)(THD* thd, uint32_t *err_num,
const char **err_mesg);
int (*get_command_fn)(THD* thd, unsigned char *command,
unsigned char **com_buffer, size_t *buffer_length);
int (*send_response_fn)(THD* thd, bool secure, unsigned char *packet,
size_t length);
int (*send_error_fn)(THD* thd, unsigned char err_cmd, bool is_fatal);
int (*set_backup_stage_fn)(THD* thd, unsigned char stage);
int (*backup_lock_fn)(THD* thd, const char *db, const char *tbl);
int (*backup_unlock_fn)(THD* thd);
} *clone_protocol_service;
THD* clone_start_statement(THD* thd, unsigned int thread_key,
unsigned int statement_key,
const char* thd_name);
void clone_finish_statement(THD* thd);
int clone_get_charsets(THD* thd, void *char_sets);
int clone_validate_charsets(THD* thd, void *char_sets);
int clone_get_configs(THD* thd, void *configs);
int clone_validate_configs(THD* thd, void *configs);
MYSQL* clone_connect(THD* thd, const char *host, uint32_t port,
const char *user, const char *passwd,
mysql_clone_ssl_context *ssl_ctx,
MYSQL_SOCKET *socket);
int clone_send_command(THD* thd, MYSQL *connection, bool set_active,
unsigned char command, unsigned char *com_buffer,
size_t buffer_length);
int clone_get_response(THD* thd, MYSQL *connection, bool set_active,
uint32_t timeout, unsigned char **packet,
size_t *length, size_t *net_length);
int clone_kill(MYSQL *connection, MYSQL *kill_connection);
void clone_disconnect(THD* thd, MYSQL *connection, bool is_fatal,
bool clear_error);
void clone_get_error(THD* thd, uint32_t *err_num,
const char **err_mesg);
int clone_get_command(THD* thd, unsigned char *command,
unsigned char **com_buffer, size_t *buffer_length);
int clone_send_response(THD* thd, bool secure, unsigned char *packet,
size_t length);
int clone_send_error(THD* thd, unsigned char err_cmd, bool is_fatal);
int clone_set_backup_stage(THD* thd, unsigned char stage);
int clone_backup_lock(THD* thd, const char* db, const char* tbl);
int clone_backup_unlock(THD* thd);
}
extern "C" {
extern void (*debug_sync_C_callback_ptr)(THD*, const char *, size_t);
}
extern "C" {
Expand Down
89 changes: 89 additions & 0 deletions include/mysql/plugin_clone.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/* Copyright (c) 2017, 2024, Oracle and/or its affiliates.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.

This program is designed to work with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have either included with
the program or referenced in the documentation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License, version 2.0, for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */

/**
@file mysql/plugin_clone.h
API for clone plugin
*/

#ifndef MYSQL_PLUGIN_CLONE_INCLUDED
#define MYSQL_PLUGIN_CLONE_INCLUDED

#include "my_global.h"
#include "violite.h"
#include "plugin.h"

/** Clone plugin interface version */
#define MariaDB_CLONE_INTERFACE_VERSION 0x0100

/**
The descriptor structure for the plugin, that is referred from
st_mysql_plugin.
*/

struct Mysql_clone {
/** clone plugin interface version */
int interface_version;

/** Clone database from local server.
@param[in] thd server thread handle
@param[in] data_dir cloned data directory
@return error code, 0 on success */
int (*clone_local)(THD *thd, const char *data_dir);

/** Clone database from remote server.
@param[in] thd server thread handle
@param[in] remote_host remote host IP address
@param[in] remote_port remote server port
@param[in] remote_user remote user name
@param[in] remote_passwd remote user's password
@param[in] data_dir cloned data directory
@param[in] ssl_mode ssl mode for remote connection
@return error code, 0 on success */
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 and send to remote clone client.
@param[in] thd server thread handle
@param[in] socket network socket to remote client
@return error code, 0 on success */
int (*clone_server)(THD *thd, MYSQL_SOCKET socket);
};

/** Create clone handle to access the clone interfaces from server.
Called when Clone plugin is installed.
@param[in] plugin_name clone plugin name
@return error code */
int clone_handle_create(const char *plugin_name);

/** Drop clone handle. Called when Clone plugin is uninstalled.
@return error code */
int clone_handle_drop();

/** Check if it is safe to uninstall clone plugin.
@param[in,out] plugin_info plugin
@return error code */
int clone_handle_check_drop(MYSQL_PLUGIN plugin_info);

#endif
77 changes: 77 additions & 0 deletions include/mysql/plugin_data_type.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,83 @@
void *dst, const char **end_ptr, int flags);
}
extern "C" {
typedef struct st_net_server NET_SERVER;
typedef struct st_mysql MYSQL;
typedef struct st_mysql_socket MYSQL_SOCKET;
typedef struct mysql_clone_ssl_context_t {
int m_ssl_mode;
const char *m_ssl_key;
const char *m_ssl_cert;
const char *m_ssl_ca;
bool m_enable_compression;
NET_SERVER *m_server_extn;
} mysql_clone_ssl_context;
extern struct clone_protocol_service_st {
THD* (*start_statement_fn)(THD* thd, unsigned int thread_key,
unsigned int statement_key,
const char* thd_name);
void (*finish_statement_fn)(THD* thd);
int (*get_charsets_fn)(THD* thd, void *char_sets);
int (*validate_charsets_fn)(THD* thd, void *char_sets);
int (*get_configs_fn)(THD* thd, void *configs);
int (*validate_configs_fn)(THD* thd, void *configs);
MYSQL* (*connect_fn)(THD* thd, const char *host, uint32_t port,
const char *user, const char *passwd,
mysql_clone_ssl_context *ssl_ctx,
MYSQL_SOCKET *socket);
int (*send_command_fn)(THD* thd, MYSQL *connection, bool set_active,
unsigned char command, unsigned char *com_buffer,
size_t buffer_length);
int (*get_response_fn)(THD* thd, MYSQL *connection, bool set_active,
uint32_t timeout, unsigned char **packet,
size_t *length, size_t *net_length);
int (*kill_fn)(MYSQL *connection, MYSQL *kill_connection);
void (*disconnect_fn)(THD* thd, MYSQL *connection, bool is_fatal,
bool clear_error);
void (*get_error_fn)(THD* thd, uint32_t *err_num,
const char **err_mesg);
int (*get_command_fn)(THD* thd, unsigned char *command,
unsigned char **com_buffer, size_t *buffer_length);
int (*send_response_fn)(THD* thd, bool secure, unsigned char *packet,
size_t length);
int (*send_error_fn)(THD* thd, unsigned char err_cmd, bool is_fatal);
int (*set_backup_stage_fn)(THD* thd, unsigned char stage);
int (*backup_lock_fn)(THD* thd, const char *db, const char *tbl);
int (*backup_unlock_fn)(THD* thd);
} *clone_protocol_service;
THD* clone_start_statement(THD* thd, unsigned int thread_key,
unsigned int statement_key,
const char* thd_name);
void clone_finish_statement(THD* thd);
int clone_get_charsets(THD* thd, void *char_sets);
int clone_validate_charsets(THD* thd, void *char_sets);
int clone_get_configs(THD* thd, void *configs);
int clone_validate_configs(THD* thd, void *configs);
MYSQL* clone_connect(THD* thd, const char *host, uint32_t port,
const char *user, const char *passwd,
mysql_clone_ssl_context *ssl_ctx,
MYSQL_SOCKET *socket);
int clone_send_command(THD* thd, MYSQL *connection, bool set_active,
unsigned char command, unsigned char *com_buffer,
size_t buffer_length);
int clone_get_response(THD* thd, MYSQL *connection, bool set_active,
uint32_t timeout, unsigned char **packet,
size_t *length, size_t *net_length);
int clone_kill(MYSQL *connection, MYSQL *kill_connection);
void clone_disconnect(THD* thd, MYSQL *connection, bool is_fatal,
bool clear_error);
void clone_get_error(THD* thd, uint32_t *err_num,
const char **err_mesg);
int clone_get_command(THD* thd, unsigned char *command,
unsigned char **com_buffer, size_t *buffer_length);
int clone_send_response(THD* thd, bool secure, unsigned char *packet,
size_t length);
int clone_send_error(THD* thd, unsigned char err_cmd, bool is_fatal);
int clone_set_backup_stage(THD* thd, unsigned char stage);
int clone_backup_lock(THD* thd, const char* db, const char* tbl);
int clone_backup_unlock(THD* thd);
}
extern "C" {
extern void (*debug_sync_C_callback_ptr)(THD*, const char *, size_t);
}
extern "C" {
Expand Down
Loading
Loading