Commit db20c777 authored by Sergei Golubchik's avatar Sergei Golubchik

mariabackup: rename encryption_plugin -> xb_plugin

because plugin code is not only about encryption anymore
(also loads provider plugins), and xb_ prefix prevents name
clashes with the server code (that mariabackup links with).
parent 8c806c41
......@@ -68,7 +68,7 @@ MYSQL_ADD_EXECUTABLE(mariadb-backup
xbstream_write.cc
backup_mysql.cc
backup_copy.cc
encryption_plugin.cc
xb_plugin.cc
${PROJECT_BINARY_DIR}/sql/sql_builtin.cc
${PROJECT_SOURCE_DIR}/sql/net_serv.cc
${PROJECT_SOURCE_DIR}/libmysqld/libmysql.c
......
......@@ -54,7 +54,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
#include "backup_copy.h"
#include "backup_mysql.h"
#include "mysqld.h"
#include "encryption_plugin.h"
#include "xb_plugin.h"
#include <sstream>
#include <sql_error.h>
#include "page0zip.h"
......@@ -1621,7 +1621,7 @@ bool write_backup_config_file()
"innodb_buffer_pool_filename=" : "",
innobase_buffer_pool_filename ?
innobase_buffer_pool_filename : "",
encryption_plugin_get_config());
xb_plugin_get_config());
return rc;
}
......
#include <mysql.h>
#include <string>
extern void encryption_plugin_backup_init(MYSQL *mysql);
extern const char* encryption_plugin_get_config();
extern void encryption_plugin_prepare_init(int argc, char **argv, const char *dir);
//extern void encryption_plugin_init(int argc, char **argv);
......@@ -17,7 +17,7 @@
#include <mysqld.h>
#include <mysql.h>
#include <xtrabackup.h>
#include <encryption_plugin.h>
#include <xb_plugin.h>
#include <sql_plugin.h>
#include <sstream>
#include <vector>
......@@ -28,7 +28,7 @@
extern struct st_maria_plugin *mysql_optional_plugins[];
extern struct st_maria_plugin *mysql_mandatory_plugins[];
static void encryption_plugin_init(int argc, char **argv);
static void xb_plugin_init(int argc, char **argv);
extern char *xb_plugin_load;
extern char *xb_plugin_dir;
......@@ -42,7 +42,7 @@ const char *QUERY_PLUGIN =
" OR (plugin_type = 'DAEMON' AND plugin_name LIKE 'provider\\_%')"
" AND plugin_status='ACTIVE'";
std::string encryption_plugin_config;
std::string xb_plugin_config;
static void add_to_plugin_load_list(const char *plugin_def)
{
......@@ -55,7 +55,7 @@ static char XTRABACKUP_EXE[] = "xtrabackup";
Read "plugin-load" value from backup-my.cnf during prepare phase.
The value is stored during backup phase.
*/
static std::string get_encryption_plugin_from_cnf(const char *dir)
static std::string get_plugin_from_cnf(const char *dir)
{
std::string path = dir + std::string("/backup-my.cnf");
FILE *f = fopen(path.c_str(), "r");
......@@ -80,7 +80,7 @@ static std::string get_encryption_plugin_from_cnf(const char *dir)
}
void encryption_plugin_backup_init(MYSQL *mysql)
void xb_plugin_backup_init(MYSQL *mysql)
{
MYSQL_RES *result;
MYSQL_ROW row;
......@@ -163,7 +163,7 @@ void encryption_plugin_backup_init(MYSQL *mysql)
mysql_free_result(result);
}
encryption_plugin_config = oss.str();
xb_plugin_config = oss.str();
argc = 0;
argv[argc++] = XTRABACKUP_EXE;
......@@ -175,20 +175,20 @@ void encryption_plugin_backup_init(MYSQL *mysql)
}
argv[argc] = 0;
encryption_plugin_init(argc, argv);
xb_plugin_init(argc, argv);
}
const char *encryption_plugin_get_config()
const char *xb_plugin_get_config()
{
return encryption_plugin_config.c_str();
return xb_plugin_config.c_str();
}
extern int finalize_encryption_plugin(st_plugin_int *plugin);
void encryption_plugin_prepare_init(int argc, char **argv, const char *dir)
void xb_plugin_prepare_init(int argc, char **argv, const char *dir)
{
std::string plugin_load= get_encryption_plugin_from_cnf(dir ? dir : ".");
std::string plugin_load= get_plugin_from_cnf(dir ? dir : ".");
if (plugin_load.size())
{
msg("Loading plugins from %s", plugin_load.c_str());
......@@ -211,12 +211,12 @@ void encryption_plugin_prepare_init(int argc, char **argv, const char *dir)
new_argv[0] = XTRABACKUP_EXE;
memcpy(&new_argv[1], argv, argc*sizeof(char *));
encryption_plugin_init(argc+1, new_argv);
xb_plugin_init(argc+1, new_argv);
delete[] new_argv;
}
static void encryption_plugin_init(int argc, char **argv)
static void xb_plugin_init(int argc, char **argv)
{
/* Patch optional and mandatory plugins, we only need to load the one in xb_plugin_load. */
mysql_optional_plugins[0] = mysql_mandatory_plugins[0] = 0;
......
#include <mysql.h>
#include <string>
extern void xb_plugin_backup_init(MYSQL *mysql);
extern const char* xb_plugin_get_config();
extern void xb_plugin_prepare_init(int argc, char **argv, const char *dir);
......@@ -106,7 +106,7 @@ Street, Fifth Floor, Boston, MA 02110-1335 USA
#include "backup_mysql.h"
#include "backup_copy.h"
#include "backup_mysql.h"
#include "encryption_plugin.h"
#include "xb_plugin.h"
#include <sql_plugin.h>
#include <srv0srv.h>
#include <log.h>
......@@ -4391,7 +4391,7 @@ static bool xtrabackup_backup_func()
return(false);
}
msg("cd to %s", mysql_real_data_home);
encryption_plugin_backup_init(mysql_connection);
xb_plugin_backup_init(mysql_connection);
msg("open files limit requested %lu, set to %lu",
xb_open_files_limit,
xb_set_max_open_files(xb_open_files_limit));
......@@ -5774,7 +5774,7 @@ static bool xtrabackup_prepare_func(char** argv)
}
int argc; for (argc = 0; argv[argc]; argc++) {}
encryption_plugin_prepare_init(argc, argv, xtrabackup_incremental_dir);
xb_plugin_prepare_init(argc, argv, xtrabackup_incremental_dir);
xtrabackup_target_dir= mysql_data_home_buff;
xtrabackup_target_dir[0]=FN_CURLIB; // all paths are relative from here
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment