Skip to content

Commit

Permalink
Remove tokudb_dir_cmd variable
Browse files Browse the repository at this point in the history
The feature is too dangerous for a stable version.
  • Loading branch information
cvicentiu committed May 16, 2017
1 parent 4cdae9c commit dfeff40
Showing 1 changed file with 0 additions and 71 deletions.
71 changes: 0 additions & 71 deletions storage/tokudb/tokudb_sysvars.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ namespace sysvars {
#define TOKUDB_VERSION_STR NULL
#endif

const size_t error_buffer_max_size = 1024;

ulonglong cache_size = 0;
uint cachetable_pool_threads = 0;
Expand Down Expand Up @@ -923,73 +922,6 @@ static MYSQL_THDVAR_BOOL(
true);
#endif

static int dir_cmd_check(THD* thd, struct st_mysql_sys_var* var,
void* save, struct st_mysql_value* value) ;

static MYSQL_THDVAR_INT(dir_cmd_last_error,
PLUGIN_VAR_THDLOCAL,
"error from the last dir command. 0 is success",
NULL, NULL, 0, 0, 0, 1);

static MYSQL_THDVAR_STR(dir_cmd_last_error_string,
PLUGIN_VAR_THDLOCAL + PLUGIN_VAR_MEMALLOC,
"error string from the last dir command",
NULL, NULL, NULL);

static MYSQL_THDVAR_STR(dir_cmd,
PLUGIN_VAR_THDLOCAL + PLUGIN_VAR_MEMALLOC,
"name of the directory where the backup is stored",
dir_cmd_check, NULL, NULL);

static void dir_cmd_set_error(THD *thd,
int error,
const char *error_fmt,
...) {
char buff[error_buffer_max_size];
va_list varargs;

assert(thd);
assert(error_fmt);

va_start(varargs, error_fmt);
vsnprintf(buff, sizeof(buff), error_fmt, varargs);
va_end(varargs);

#if 0 // Disable macros unavailable in MariaDB.
THDVAR_SET(thd, dir_cmd_last_error, &error);
THDVAR_SET(thd, dir_cmd_last_error_string, buff);
#endif
}

static int dir_cmd_check(THD* thd, struct st_mysql_sys_var* var,
void* save, struct st_mysql_value* value) {
int error = 0;
dir_cmd_set_error(thd, error, "");

if (check_global_access(thd, SUPER_ACL)) {
return 1;
}

char buff[STRING_BUFFER_USUAL_SIZE];
int length = sizeof(buff);
const char *str = value->val_str(value, buff, &length);
if (str) {
str = thd->strmake(str, length);
*(const char**)save = str;
}

if (str) {
dir_cmd_callbacks callbacks { .set_error = dir_cmd_set_error };
process_dir_cmd(thd, str, callbacks);

error = THDVAR(thd, dir_cmd_last_error);
} else {
error = EINVAL;
}

return error;
}

//******************************************************************************
// all system variables
//******************************************************************************
Expand Down Expand Up @@ -1077,9 +1009,6 @@ st_mysql_sys_var* system_variables[] = {
#if TOKUDB_DEBUG
MYSQL_SYSVAR(debug_pause_background_job_manager),
#endif // TOKUDB_DEBUG
MYSQL_SYSVAR(dir_cmd_last_error),
MYSQL_SYSVAR(dir_cmd_last_error_string),
MYSQL_SYSVAR(dir_cmd),

NULL
};
Expand Down

0 comments on commit dfeff40

Please sign in to comment.