Make maria_data_root const char*
This allow one to remove some casts like: maria_data_root= (char *)"."; It also removes warnings from icc.
This commit is contained in:
parent
5d6ad2ad66
commit
bd5ac03896
@ -313,6 +313,12 @@ typedef void (*mysql_var_update_func)(MYSQL_THD thd,
|
|||||||
const type def_val; \
|
const type def_val; \
|
||||||
} MYSQL_SYSVAR_NAME(name)
|
} MYSQL_SYSVAR_NAME(name)
|
||||||
|
|
||||||
|
#define DECLARE_MYSQL_SYSVAR_CONST_BASIC(name, type) struct { \
|
||||||
|
MYSQL_PLUGIN_VAR_HEADER; \
|
||||||
|
const type *value; \
|
||||||
|
const type def_val; \
|
||||||
|
} MYSQL_SYSVAR_NAME(name)
|
||||||
|
|
||||||
#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) struct { \
|
#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) struct { \
|
||||||
MYSQL_PLUGIN_VAR_HEADER; \
|
MYSQL_PLUGIN_VAR_HEADER; \
|
||||||
type *value; type def_val; \
|
type *value; type def_val; \
|
||||||
@ -367,6 +373,11 @@ DECLARE_MYSQL_SYSVAR_BASIC(name, char *) = { \
|
|||||||
PLUGIN_VAR_STR | ((opt) & PLUGIN_VAR_MASK), \
|
PLUGIN_VAR_STR | ((opt) & PLUGIN_VAR_MASK), \
|
||||||
#name, comment, check, update, &varname, def}
|
#name, comment, check, update, &varname, def}
|
||||||
|
|
||||||
|
#define MYSQL_SYSVAR_CONST_STR(name, varname, opt, comment, check, update, def) \
|
||||||
|
DECLARE_MYSQL_SYSVAR_CONST_BASIC(name, char *) = { \
|
||||||
|
PLUGIN_VAR_STR | ((opt) & PLUGIN_VAR_MASK), \
|
||||||
|
#name, comment, check, update, &varname, def}
|
||||||
|
|
||||||
#define MYSQL_SYSVAR_INT(name, varname, opt, comment, check, update, def, min, max, blk) \
|
#define MYSQL_SYSVAR_INT(name, varname, opt, comment, check, update, def, min, max, blk) \
|
||||||
DECLARE_MYSQL_SYSVAR_SIMPLE(name, int) = { \
|
DECLARE_MYSQL_SYSVAR_SIMPLE(name, int) = { \
|
||||||
PLUGIN_VAR_INT | ((opt) & PLUGIN_VAR_MASK), \
|
PLUGIN_VAR_INT | ((opt) & PLUGIN_VAR_MASK), \
|
||||||
|
@ -128,7 +128,7 @@ int main(int argc, char **argv)
|
|||||||
MY_INIT(argv[0]);
|
MY_INIT(argv[0]);
|
||||||
|
|
||||||
my_setup_stacktrace();
|
my_setup_stacktrace();
|
||||||
default_log_dir= opt_log_dir= maria_data_root= (char *)".";
|
default_log_dir= opt_log_dir= maria_data_root= ".";
|
||||||
maria_chk_init(&check_param);
|
maria_chk_init(&check_param);
|
||||||
check_param.opt_lock_memory= 1; /* Lock memory if possible */
|
check_param.opt_lock_memory= 1; /* Lock memory if possible */
|
||||||
check_param.using_global_keycache = 0;
|
check_param.using_global_keycache = 0;
|
||||||
@ -322,7 +322,7 @@ static struct my_option my_long_options[] =
|
|||||||
0, GET_ULL, REQUIRED_ARG, -1, 0, 0, 0, 0, 0},
|
0, GET_ULL, REQUIRED_ARG, -1, 0, 0, 0, 0, 0},
|
||||||
{"datadir", 'h',
|
{"datadir", 'h',
|
||||||
"Path for control file (and logs if --logdir not used).",
|
"Path for control file (and logs if --logdir not used).",
|
||||||
&maria_data_root, 0, 0, GET_STR, REQUIRED_ARG,
|
(char**) &maria_data_root, 0, 0, GET_STR, REQUIRED_ARG,
|
||||||
0, 0, 0, 0, 0, 0},
|
0, 0, 0, 0, 0, 0},
|
||||||
{"logdir", OPT_LOG_DIR,
|
{"logdir", OPT_LOG_DIR,
|
||||||
"Path for log files.",
|
"Path for log files.",
|
||||||
|
@ -143,7 +143,7 @@ int main(int argc, char **argv)
|
|||||||
translog_table_init();
|
translog_table_init();
|
||||||
translog_fill_overhead_table();
|
translog_fill_overhead_table();
|
||||||
|
|
||||||
maria_data_root= (char *)".";
|
maria_data_root= ".";
|
||||||
|
|
||||||
if ((handler= my_open(opt_file, O_RDONLY, MYF(MY_WME))) < 0)
|
if ((handler= my_open(opt_file, O_RDONLY, MYF(MY_WME))) < 0)
|
||||||
{
|
{
|
||||||
|
@ -229,7 +229,7 @@ int main(int argc, char **argv)
|
|||||||
my_bool no_control_file= 0;
|
my_bool no_control_file= 0;
|
||||||
MY_INIT(argv[0]);
|
MY_INIT(argv[0]);
|
||||||
|
|
||||||
maria_data_root= (char *)".";
|
maria_data_root= ".";
|
||||||
load_defaults_or_exit("my", load_default_groups, &argc, &argv);
|
load_defaults_or_exit("my", load_default_groups, &argc, &argv);
|
||||||
default_argv= argv;
|
default_argv= argv;
|
||||||
get_options(&argc,&argv);
|
get_options(&argc,&argv);
|
||||||
@ -316,7 +316,7 @@ static struct my_option my_long_options[] =
|
|||||||
(char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
(char**) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"datadir", 'h',
|
{"datadir", 'h',
|
||||||
"Path for control file (and logs if --logdir not used).",
|
"Path for control file (and logs if --logdir not used).",
|
||||||
&maria_data_root, 0, 0, GET_STR, REQUIRED_ARG,
|
(char**) &maria_data_root, 0, 0, GET_STR, REQUIRED_ARG,
|
||||||
0, 0, 0, 0, 0, 0},
|
0, 0, 0, 0, 0, 0},
|
||||||
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
|
{"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.",
|
||||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
|
@ -83,7 +83,7 @@ int main(int argc, char **argv)
|
|||||||
uint warnings_count;
|
uint warnings_count;
|
||||||
MY_INIT(argv[0]);
|
MY_INIT(argv[0]);
|
||||||
|
|
||||||
maria_data_root= (char *)".";
|
maria_data_root= ".";
|
||||||
sf_leaking_memory=1; /* don't report memory leaks on early exits */
|
sf_leaking_memory=1; /* don't report memory leaks on early exits */
|
||||||
load_defaults_or_exit("my", load_default_groups, &argc, &argv);
|
load_defaults_or_exit("my", load_default_groups, &argc, &argv);
|
||||||
default_argv= argv;
|
default_argv= argv;
|
||||||
@ -248,7 +248,7 @@ static struct my_option my_long_options[] =
|
|||||||
0, 0, 0, 0 },
|
0, 0, 0, 0 },
|
||||||
{"aria-log-dir-path", 'h',
|
{"aria-log-dir-path", 'h',
|
||||||
"Path to the directory where to store transactional log",
|
"Path to the directory where to store transactional log",
|
||||||
(uchar **) &maria_data_root, (uchar **) &maria_data_root, 0,
|
(char **) &maria_data_root, (char **) &maria_data_root, 0,
|
||||||
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{ "page-buffer-size", 'P',
|
{ "page-buffer-size", 'P',
|
||||||
"The size of the buffer used for index blocks for Aria tables",
|
"The size of the buffer used for index blocks for Aria tables",
|
||||||
|
@ -187,12 +187,11 @@ static MYSQL_SYSVAR_BOOL(page_checksum, maria_page_checksums, 0,
|
|||||||
"with PAGE_CHECKSUM clause in CREATE TABLE)", 0, 0, 1);
|
"with PAGE_CHECKSUM clause in CREATE TABLE)", 0, 0, 1);
|
||||||
|
|
||||||
/* It is only command line argument */
|
/* It is only command line argument */
|
||||||
static MYSQL_SYSVAR_STR(log_dir_path, maria_data_root,
|
static MYSQL_SYSVAR_CONST_STR(log_dir_path, maria_data_root,
|
||||||
PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
|
PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
|
||||||
"Path to the directory where to store transactional log",
|
"Path to the directory where to store transactional log",
|
||||||
NULL, NULL, mysql_real_data_home);
|
NULL, NULL, mysql_real_data_home);
|
||||||
|
|
||||||
|
|
||||||
static MYSQL_SYSVAR_ULONG(log_file_size, log_file_size,
|
static MYSQL_SYSVAR_ULONG(log_file_size, log_file_size,
|
||||||
PLUGIN_VAR_RQCMDARG,
|
PLUGIN_VAR_RQCMDARG,
|
||||||
"Limit for transaction log size",
|
"Limit for transaction log size",
|
||||||
|
@ -95,7 +95,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
char buff[FN_REFLEN];
|
char buff[FN_REFLEN];
|
||||||
MY_INIT(argv[0]);
|
MY_INIT(argv[0]);
|
||||||
maria_data_root= (char *)".";
|
maria_data_root= ".";
|
||||||
get_options(argc, argv);
|
get_options(argc, argv);
|
||||||
/* Maria requires that we always have a page cache */
|
/* Maria requires that we always have a page cache */
|
||||||
if (maria_init() ||
|
if (maria_init() ||
|
||||||
@ -616,8 +616,8 @@ static struct my_option my_long_options[] =
|
|||||||
#endif
|
#endif
|
||||||
{"help", '?', "Display help and exit",
|
{"help", '?', "Display help and exit",
|
||||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"datadir", 'h', "Path to the database root.", &maria_data_root,
|
{"datadir", 'h', "Path to the database root.", (char**) &maria_data_root,
|
||||||
&maria_data_root, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
(char**) &maria_data_root, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"row-fixed-size", 'S', "Fixed size records",
|
{"row-fixed-size", 'S', "Fixed size records",
|
||||||
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"rows-in-block", 'M', "Store rows in block format",
|
{"rows-in-block", 'M', "Store rows in block format",
|
||||||
|
@ -62,7 +62,7 @@ PAGECACHE *maria_pagecache= &maria_pagecache_var;
|
|||||||
PAGECACHE maria_log_pagecache_var;
|
PAGECACHE maria_log_pagecache_var;
|
||||||
PAGECACHE *maria_log_pagecache= &maria_log_pagecache_var;
|
PAGECACHE *maria_log_pagecache= &maria_log_pagecache_var;
|
||||||
MY_TMPDIR *maria_tmpdir; /* Tempdir for redo */
|
MY_TMPDIR *maria_tmpdir; /* Tempdir for redo */
|
||||||
char *maria_data_root;
|
const char *maria_data_root;
|
||||||
HASH maria_stored_state;
|
HASH maria_stored_state;
|
||||||
int (*maria_create_trn_hook)(MARIA_HA *);
|
int (*maria_create_trn_hook)(MARIA_HA *);
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "trnman.h"
|
#include "trnman.h"
|
||||||
|
|
||||||
extern PAGECACHE *maria_log_pagecache;
|
extern PAGECACHE *maria_log_pagecache;
|
||||||
extern char *maria_data_root;
|
extern const char *maria_data_root;
|
||||||
|
|
||||||
#define MAX_REC_LENGTH 1024
|
#define MAX_REC_LENGTH 1024
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ int main(int argc,char *argv[])
|
|||||||
safe_mutex_deadlock_detector= 1;
|
safe_mutex_deadlock_detector= 1;
|
||||||
#endif
|
#endif
|
||||||
MY_INIT(argv[0]);
|
MY_INIT(argv[0]);
|
||||||
maria_data_root= (char *)".";
|
maria_data_root= ".";
|
||||||
get_options(argc,argv);
|
get_options(argc,argv);
|
||||||
/* Maria requires that we always have a page cache */
|
/* Maria requires that we always have a page cache */
|
||||||
if (maria_init() ||
|
if (maria_init() ||
|
||||||
@ -739,8 +739,8 @@ static struct my_option my_long_options[] =
|
|||||||
{"debug", '#', "Undocumented",
|
{"debug", '#', "Undocumented",
|
||||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
#endif
|
#endif
|
||||||
{"datadir", 'h', "Path to the database root.", &maria_data_root,
|
{"datadir", 'h', "Path to the database root.", (char**) &maria_data_root,
|
||||||
&maria_data_root, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
(char**) &maria_data_root, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"delete-rows", 'd', "Abort after this many rows has been deleted",
|
{"delete-rows", 'd', "Abort after this many rows has been deleted",
|
||||||
(uchar**) &remove_count, (uchar**) &remove_count, 0, GET_UINT, REQUIRED_ARG,
|
(uchar**) &remove_count, (uchar**) &remove_count, 0, GET_UINT, REQUIRED_ARG,
|
||||||
1000, 0, 0, 0, 0, 0},
|
1000, 0, 0, 0, 0, 0},
|
||||||
|
@ -76,7 +76,7 @@ int main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
MY_INIT(argv[0]);
|
MY_INIT(argv[0]);
|
||||||
|
|
||||||
maria_data_root= (char *)".";
|
maria_data_root= ".";
|
||||||
get_options(argc,argv);
|
get_options(argc,argv);
|
||||||
fn_format(filename, "test2", maria_data_root, "", MYF(0));
|
fn_format(filename, "test2", maria_data_root, "", MYF(0));
|
||||||
|
|
||||||
|
@ -1238,7 +1238,7 @@ extern uchar maria_file_magic[], maria_pack_file_magic[];
|
|||||||
extern uchar maria_uuid[MY_UUID_SIZE];
|
extern uchar maria_uuid[MY_UUID_SIZE];
|
||||||
extern uint32 maria_read_vec[], maria_readnext_vec[];
|
extern uint32 maria_read_vec[], maria_readnext_vec[];
|
||||||
extern uint maria_quick_table_bits;
|
extern uint maria_quick_table_bits;
|
||||||
extern char *maria_data_root;
|
extern const char *maria_data_root;
|
||||||
extern uchar maria_zero_string[];
|
extern uchar maria_zero_string[];
|
||||||
extern my_bool maria_inited, maria_in_ha_maria, maria_recovery_changed_data;
|
extern my_bool maria_inited, maria_in_ha_maria, maria_recovery_changed_data;
|
||||||
extern my_bool maria_recovery_verbose, maria_checkpoint_disabled;
|
extern my_bool maria_recovery_verbose, maria_checkpoint_disabled;
|
||||||
|
@ -41,7 +41,7 @@ int main(int argc __attribute__((unused)), char *argv[])
|
|||||||
safe_mutex_deadlock_detector= 1;
|
safe_mutex_deadlock_detector= 1;
|
||||||
#endif
|
#endif
|
||||||
MY_INIT(argv[0]);
|
MY_INIT(argv[0]);
|
||||||
maria_data_root= (char *)".";
|
maria_data_root= ".";
|
||||||
|
|
||||||
/* Maria requires that we always have a page cache */
|
/* Maria requires that we always have a page cache */
|
||||||
if (maria_init() ||
|
if (maria_init() ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user