mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
cleanup: CREATE_TYPELIB_FOR() helper
This commit is contained in:
parent
9fa31c1bd9
commit
d046aca0c7
39 changed files with 317 additions and 486 deletions
|
@ -111,8 +111,7 @@ static const char *command_names[]= {
|
|||
NullS
|
||||
};
|
||||
|
||||
static TYPELIB command_typelib=
|
||||
{ array_elements(command_names)-1,"commands", command_names, NULL};
|
||||
static TYPELIB command_typelib= CREATE_TYPELIB_FOR(command_names);
|
||||
|
||||
static struct my_option my_long_options[] =
|
||||
{
|
||||
|
|
|
@ -116,9 +116,7 @@ static bool one_database=0, one_table=0, to_last_remote_log= 0, disable_log_bin=
|
|||
static bool opt_hexdump= 0, opt_version= 0;
|
||||
const char *base64_output_mode_names[]=
|
||||
{"NEVER", "AUTO", "UNSPEC", "DECODE-ROWS", NullS};
|
||||
TYPELIB base64_output_mode_typelib=
|
||||
{ array_elements(base64_output_mode_names) - 1, "",
|
||||
base64_output_mode_names, NULL };
|
||||
TYPELIB base64_output_mode_typelib=CREATE_TYPELIB_FOR(base64_output_mode_names);
|
||||
static enum_base64_output_mode opt_base64_output_mode= BASE64_OUTPUT_UNSPEC;
|
||||
static char *opt_base64_output_mode_str= NullS;
|
||||
static char* database= 0;
|
||||
|
|
|
@ -66,8 +66,7 @@ const char *operation_name[]=
|
|||
typedef enum { DO_VIEWS_NO, DO_VIEWS_YES, DO_UPGRADE, DO_VIEWS_FROM_MYSQL } enum_do_views;
|
||||
const char *do_views_opts[]= {"NO", "YES", "UPGRADE", "UPGRADE_FROM_MYSQL",
|
||||
NullS};
|
||||
TYPELIB do_views_typelib= { array_elements(do_views_opts) - 1, "",
|
||||
do_views_opts, NULL };
|
||||
TYPELIB do_views_typelib= CREATE_TYPELIB_FOR(do_views_opts);
|
||||
static ulong opt_do_views= DO_VIEWS_NO;
|
||||
|
||||
static struct my_option my_long_options[] =
|
||||
|
|
|
@ -140,11 +140,7 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, opt_no_data_m
|
|||
#define OPT_SYSTEM_TIMEZONES 64
|
||||
static const char *opt_system_type_values[]=
|
||||
{"all", "users", "plugins", "udfs", "servers", "stats", "timezones"};
|
||||
static TYPELIB opt_system_types=
|
||||
{
|
||||
array_elements(opt_system_type_values), "system dump options",
|
||||
opt_system_type_values, NULL
|
||||
};
|
||||
static TYPELIB opt_system_types=CREATE_TYPELIB_FOR(opt_system_type_values);
|
||||
static ulonglong opt_system= 0ULL;
|
||||
static my_bool insert_pat_inited= 0, debug_info_flag= 0, debug_check_flag= 0,
|
||||
select_field_names_inited= 0;
|
||||
|
@ -250,8 +246,7 @@ const char *compatible_mode_names[]=
|
|||
(1U<<6) | /* MAXDB */\
|
||||
(1U<<10) /* ANSI */\
|
||||
)
|
||||
TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1,
|
||||
"", compatible_mode_names, NULL};
|
||||
TYPELIB compatible_mode_typelib= CREATE_TYPELIB_FOR(compatible_mode_names);
|
||||
|
||||
#define MED_ENGINES "MRG_MyISAM, MRG_ISAM, CONNECT, OQGRAPH, SPIDER, VP, FEDERATED"
|
||||
|
||||
|
|
|
@ -594,8 +594,7 @@ struct st_command
|
|||
enum enum_commands type;
|
||||
};
|
||||
|
||||
TYPELIB command_typelib= {array_elements(command_names),"",
|
||||
command_names, 0};
|
||||
TYPELIB command_typelib= CREATE_TYPELIB_FOR(command_names);
|
||||
|
||||
DYNAMIC_STRING ds_res;
|
||||
/* Points to ds_warning in run_query, so it can be freed */
|
||||
|
|
|
@ -176,8 +176,7 @@ static enum {MODE_GET, MODE_PUT, MODE_DELETE} opt_mode;
|
|||
static char **file_list = NULL;
|
||||
static int file_list_size = 0;
|
||||
|
||||
TYPELIB storage_typelib =
|
||||
{array_elements(storage_names)-1, "", storage_names, NULL};
|
||||
TYPELIB storage_typelib = CREATE_TYPELIB_FOR(storage_names);
|
||||
|
||||
enum {
|
||||
OPT_STORAGE = 256,
|
||||
|
|
|
@ -385,8 +385,7 @@ static ulong innodb_flush_method;
|
|||
|
||||
static const char *binlog_info_values[] = {"off", "lockless", "on", "auto",
|
||||
NullS};
|
||||
static TYPELIB binlog_info_typelib = {array_elements(binlog_info_values)-1, "",
|
||||
binlog_info_values, NULL};
|
||||
static TYPELIB binlog_info_typelib = CREATE_TYPELIB_FOR(binlog_info_values);
|
||||
ulong opt_binlog_info;
|
||||
|
||||
char *opt_incremental_history_name;
|
||||
|
@ -402,8 +401,7 @@ char *opt_log_bin;
|
|||
|
||||
const char *query_type_names[] = { "ALL", "UPDATE", "SELECT", NullS};
|
||||
|
||||
TYPELIB query_type_typelib= {array_elements(query_type_names) - 1, "",
|
||||
query_type_names, NULL};
|
||||
TYPELIB query_type_typelib= CREATE_TYPELIB_FOR(query_type_names);
|
||||
|
||||
ulong opt_lock_wait_query_type;
|
||||
ulong opt_kill_long_query_type;
|
||||
|
|
|
@ -27,6 +27,8 @@ typedef struct st_typelib { /* Different types saved here */
|
|||
unsigned int *type_lengths;
|
||||
} TYPELIB;
|
||||
|
||||
#define CREATE_TYPELIB_FOR(X) { (unsigned int)(sizeof(X)/sizeof(X[0])) - 1, "", X, NULL }
|
||||
|
||||
extern my_ulonglong find_typeset(const char *x, TYPELIB *typelib,
|
||||
int *error_position);
|
||||
extern int find_type_with_warning(const char *x, TYPELIB *typelib,
|
||||
|
|
|
@ -130,5 +130,4 @@ my_bool my_disable_copystat_in_redel=0;
|
|||
const char *sql_protocol_names_lib[] =
|
||||
{ "TCP", "SOCKET", "PIPE", NullS };
|
||||
|
||||
TYPELIB sql_protocol_typelib ={ array_elements(sql_protocol_names_lib) - 1, "",
|
||||
sql_protocol_names_lib, NULL };
|
||||
TYPELIB sql_protocol_typelib= CREATE_TYPELIB_FOR(sql_protocol_names_lib);
|
||||
|
|
|
@ -265,8 +265,7 @@ TYPELIB *copy_typelib(MEM_ROOT *root, const TYPELIB *from)
|
|||
|
||||
|
||||
static const char *on_off_default_names[]= { "off","on","default", 0};
|
||||
static TYPELIB on_off_default_typelib= {array_elements(on_off_default_names)-1,
|
||||
"", on_off_default_names, 0};
|
||||
static TYPELIB on_off_default_typelib= CREATE_TYPELIB_FOR(on_off_default_names);
|
||||
|
||||
/**
|
||||
Parse a TYPELIB name from the buffer
|
||||
|
|
|
@ -109,12 +109,7 @@ static const char* mech_names[] = {
|
|||
"",
|
||||
NULL
|
||||
};
|
||||
static TYPELIB mech_name_typelib = {
|
||||
3,
|
||||
"mech_name_typelib",
|
||||
mech_names,
|
||||
NULL
|
||||
};
|
||||
static TYPELIB mech_name_typelib = CREATE_TYPELIB_FOR(mech_names);
|
||||
static MYSQL_SYSVAR_ENUM(mech_name, srv_mech,
|
||||
PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY,
|
||||
"GSSAPI mechanism",
|
||||
|
|
|
@ -673,11 +673,7 @@ struct st_mariadb_encryption aws_key_management_plugin= {
|
|||
};
|
||||
|
||||
|
||||
static TYPELIB key_spec_typelib =
|
||||
{
|
||||
array_elements(key_spec_names) - 1, "",
|
||||
key_spec_names, NULL
|
||||
};
|
||||
static TYPELIB key_spec_typelib = CREATE_TYPELIB_FOR(key_spec_names);
|
||||
|
||||
const char *log_level_names[] =
|
||||
{
|
||||
|
@ -691,11 +687,7 @@ const char *log_level_names[] =
|
|||
0
|
||||
};
|
||||
|
||||
static TYPELIB log_level_typelib =
|
||||
{
|
||||
array_elements(log_level_names) - 1, "",
|
||||
log_level_names, NULL
|
||||
};
|
||||
static TYPELIB log_level_typelib = CREATE_TYPELIB_FOR(log_level_names);
|
||||
|
||||
static MYSQL_SYSVAR_STR(master_key_id, master_key_id,
|
||||
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
|
||||
|
|
|
@ -32,12 +32,7 @@ static const char *encryption_algorithm_names[]=
|
|||
0
|
||||
};
|
||||
|
||||
static TYPELIB encryption_algorithm_typelib=
|
||||
{
|
||||
array_elements(encryption_algorithm_names)-1,"",
|
||||
encryption_algorithm_names, NULL
|
||||
};
|
||||
|
||||
static TYPELIB encryption_algorithm_typelib=CREATE_TYPELIB_FOR(encryption_algorithm_names);
|
||||
|
||||
static MYSQL_SYSVAR_STR(filename, filename,
|
||||
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
|
||||
|
|
|
@ -45,8 +45,7 @@ enum session_stat
|
|||
};
|
||||
|
||||
static const char *session_stat_names[]= {"GLOBAL", "ON", "OFF", NullS};
|
||||
static TYPELIB session_stat_typelib= { array_elements(session_stat_names) - 1,
|
||||
"", session_stat_names, NULL};
|
||||
static TYPELIB session_stat_typelib= CREATE_TYPELIB_FOR(session_stat_names);
|
||||
|
||||
|
||||
static MYSQL_SYSVAR_ULONG(range_base, opt_query_response_time_range_base,
|
||||
|
|
|
@ -393,10 +393,7 @@ static const char *event_names[]=
|
|||
"CONNECT", "QUERY", "TABLE", "QUERY_DDL", "QUERY_DML", "QUERY_DCL",
|
||||
"QUERY_DML_NO_SELECT", NULL
|
||||
};
|
||||
static TYPELIB events_typelib=
|
||||
{
|
||||
array_elements(event_names) - 1, "", event_names, NULL
|
||||
};
|
||||
static TYPELIB events_typelib= CREATE_TYPELIB_FOR(event_names);
|
||||
static MYSQL_SYSVAR_SET(events, events, PLUGIN_VAR_RQCMDARG,
|
||||
"Specifies the set of events to monitor. Can be CONNECT, QUERY, TABLE,"
|
||||
" QUERY_DDL, QUERY_DML, QUERY_DML_NO_SELECT, QUERY_DCL",
|
||||
|
@ -415,11 +412,7 @@ static const char *output_type_names[]= {
|
|||
"syslog",
|
||||
#endif
|
||||
"file", 0 };
|
||||
static TYPELIB output_typelib=
|
||||
{
|
||||
array_elements(output_type_names) - 1, "output_typelib",
|
||||
output_type_names, NULL
|
||||
};
|
||||
static TYPELIB output_typelib=CREATE_TYPELIB_FOR(output_type_names);
|
||||
static MYSQL_SYSVAR_ENUM(output_type, output_type, PLUGIN_VAR_RQCMDARG,
|
||||
out_type_desc,
|
||||
0, update_output_type, OUTPUT_FILE,
|
||||
|
@ -487,11 +480,7 @@ static unsigned int syslog_facility_codes[]=
|
|||
LOG_LOCAL4, LOG_LOCAL5, LOG_LOCAL6, LOG_LOCAL7,
|
||||
};
|
||||
#endif
|
||||
static TYPELIB syslog_facility_typelib=
|
||||
{
|
||||
array_elements(syslog_facility_names) - 1, "syslog_facility_typelib",
|
||||
syslog_facility_names, NULL
|
||||
};
|
||||
static TYPELIB syslog_facility_typelib=CREATE_TYPELIB_FOR(syslog_facility_names);
|
||||
static MYSQL_SYSVAR_ENUM(syslog_facility, syslog_facility, PLUGIN_VAR_RQCMDARG,
|
||||
"The 'facility' parameter of the SYSLOG record."
|
||||
" The default is LOG_USER", 0, update_syslog_facility, 0/*LOG_USER*/,
|
||||
|
@ -512,11 +501,7 @@ static unsigned int syslog_priority_codes[]=
|
|||
};
|
||||
#endif
|
||||
|
||||
static TYPELIB syslog_priority_typelib=
|
||||
{
|
||||
array_elements(syslog_priority_names) - 1, "syslog_priority_typelib",
|
||||
syslog_priority_names, NULL
|
||||
};
|
||||
static TYPELIB syslog_priority_typelib=CREATE_TYPELIB_FOR(syslog_priority_names);
|
||||
static MYSQL_SYSVAR_ENUM(syslog_priority, syslog_priority, PLUGIN_VAR_RQCMDARG,
|
||||
"The 'priority' parameter of the SYSLOG record."
|
||||
" The default is LOG_INFO", 0, update_syslog_priority, 6/*LOG_INFO*/,
|
||||
|
|
|
@ -811,8 +811,7 @@ static char *opt_strdup(const char *from, myf my_flags)
|
|||
return my_strdup(key_memory_mysql_options, from, my_flags);
|
||||
}
|
||||
|
||||
static TYPELIB option_types={array_elements(default_options)-1,
|
||||
"options",default_options, NULL};
|
||||
static TYPELIB option_types=CREATE_TYPELIB_FOR(default_options);
|
||||
|
||||
static int add_init_command(struct st_mysql_options *options, const char *cmd)
|
||||
{
|
||||
|
|
|
@ -45,8 +45,7 @@
|
|||
static const char *stage_names[]=
|
||||
{"START", "FLUSH", "BLOCK_DDL", "BLOCK_COMMIT", "END", 0};
|
||||
|
||||
TYPELIB backup_stage_names=
|
||||
{ array_elements(stage_names)-1, "", stage_names, 0 };
|
||||
TYPELIB backup_stage_names= CREATE_TYPELIB_FOR(stage_names);
|
||||
|
||||
static MDL_ticket *backup_flush_ticket;
|
||||
static File volatile backup_log= -1;
|
||||
|
|
|
@ -152,8 +152,7 @@ const LEX_CSTRING ha_row_type[]=
|
|||
const char *tx_isolation_names[]=
|
||||
{ "READ-UNCOMMITTED", "READ-COMMITTED", "REPEATABLE-READ", "SERIALIZABLE",
|
||||
NullS};
|
||||
TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"",
|
||||
tx_isolation_names, NULL};
|
||||
TYPELIB tx_isolation_typelib= CREATE_TYPELIB_FOR(tx_isolation_names);
|
||||
|
||||
static TYPELIB known_extensions= {0,"known_exts", NULL, NULL};
|
||||
uint known_extensions_id= 0;
|
||||
|
|
|
@ -326,7 +326,8 @@ const char *block_encryption_mode_values[]= {
|
|||
"aes-128-cbc", "aes-192-cbc", "aes-256-cbc",
|
||||
"aes-128-ctr", "aes-192-ctr", "aes-256-ctr",
|
||||
NullS };
|
||||
TYPELIB block_encryption_mode_typelib= {9, 0, block_encryption_mode_values, 0};
|
||||
TYPELIB block_encryption_mode_typelib=
|
||||
CREATE_TYPELIB_FOR(block_encryption_mode_values);
|
||||
static inline uint block_encryption_mode_to_key_length(ulong bem)
|
||||
{ return (bem % 3 + 2) * 64; }
|
||||
static inline my_aes_mode block_encryption_mode_to_aes_mode(ulong bem)
|
||||
|
@ -671,10 +672,7 @@ err:
|
|||
|
||||
const char *histogram_types[] =
|
||||
{"SINGLE_PREC_HB", "DOUBLE_PREC_HB", "JSON_HB", 0};
|
||||
static TYPELIB histogram_types_typelib=
|
||||
{ array_elements(histogram_types),
|
||||
"histogram_types",
|
||||
histogram_types, NULL};
|
||||
static TYPELIB histogram_types_typelib= CREATE_TYPELIB_FOR(histogram_types);
|
||||
const char *representation_by_type[]= {"%.3f", "%.5f"};
|
||||
|
||||
String *Item_func_decode_histogram::val_str(String *str)
|
||||
|
|
|
@ -80,13 +80,7 @@ unsigned int binlog_checksum_type_length[]= {
|
|||
0
|
||||
};
|
||||
|
||||
TYPELIB binlog_checksum_typelib=
|
||||
{
|
||||
array_elements(binlog_checksum_type_names) - 1, "",
|
||||
binlog_checksum_type_names,
|
||||
binlog_checksum_type_length
|
||||
};
|
||||
|
||||
TYPELIB binlog_checksum_typelib= CREATE_TYPELIB_FOR(binlog_checksum_type_names);
|
||||
|
||||
#define FLAGSTR(V,F) ((V)&(F)?#F" ":"")
|
||||
|
||||
|
|
|
@ -55,8 +55,7 @@ ulong rpl_status=RPL_NULL;
|
|||
mysql_mutex_t LOCK_rpl_status;
|
||||
|
||||
const char *rpl_role_type[] = {"MASTER","SLAVE",NullS};
|
||||
TYPELIB rpl_role_typelib = {array_elements(rpl_role_type)-1,"",
|
||||
rpl_role_type, NULL};
|
||||
TYPELIB rpl_role_typelib = CREATE_TYPELIB_FOR(rpl_role_type);
|
||||
|
||||
const char* rpl_status_type[]=
|
||||
{
|
||||
|
|
|
@ -52,8 +52,7 @@
|
|||
#define MAX_DROP_TABLE_Q_LEN 1024
|
||||
|
||||
const char *del_exts[]= {".BAK", ".opt", NullS};
|
||||
static TYPELIB deletable_extensions=
|
||||
{array_elements(del_exts)-1,"del_exts", del_exts, NULL};
|
||||
static TYPELIB deletable_extensions= CREATE_TYPELIB_FOR(del_exts);
|
||||
|
||||
static bool find_db_tables_and_rm_known_files(THD *, MY_DIR *,
|
||||
const Lex_ident_db_normalized &db,
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -62,8 +62,7 @@ extern struct st_maria_plugin *mysql_mandatory_plugins[];
|
|||
const char *global_plugin_typelib_names[]=
|
||||
{ "OFF", "ON", "FORCE", "FORCE_PLUS_PERMANENT", NULL };
|
||||
static TYPELIB global_plugin_typelib=
|
||||
{ array_elements(global_plugin_typelib_names)-1,
|
||||
"", global_plugin_typelib_names, NULL };
|
||||
CREATE_TYPELIB_FOR(global_plugin_typelib_names);
|
||||
|
||||
static I_List<i_string> opt_plugin_load_list;
|
||||
I_List<i_string> *opt_plugin_load_list_ptr= &opt_plugin_load_list;
|
||||
|
|
|
@ -140,10 +140,7 @@ LEX_CSTRING INDEX_clex_str= { STRING_WITH_LEN("INDEX") };
|
|||
static const char *grant_names[]={
|
||||
"select","insert","update","delete","create","drop","reload","shutdown",
|
||||
"process","file","grant","references","index","alter"};
|
||||
|
||||
static TYPELIB grant_types = { sizeof(grant_names)/sizeof(char **),
|
||||
"grant_types",
|
||||
grant_names, NULL};
|
||||
static TYPELIB grant_types = CREATE_TYPELIB_FOR(grant_names);
|
||||
#endif
|
||||
|
||||
/* Match the values of enum ha_choice */
|
||||
|
|
|
@ -2521,12 +2521,8 @@ Sys_var_slave_parallel_mode::global_value_ptr(THD *thd,
|
|||
static const char *slave_parallel_mode_names[] = {
|
||||
"none", "minimal", "conservative", "optimistic", "aggressive", NULL
|
||||
};
|
||||
export TYPELIB slave_parallel_mode_typelib = {
|
||||
array_elements(slave_parallel_mode_names)-1,
|
||||
"",
|
||||
slave_parallel_mode_names,
|
||||
NULL
|
||||
};
|
||||
export TYPELIB slave_parallel_mode_typelib =
|
||||
CREATE_TYPELIB_FOR(slave_parallel_mode_names);
|
||||
|
||||
static Sys_var_on_access_global<Sys_var_slave_parallel_mode,
|
||||
PRIV_SET_SYSTEM_GLOBAL_VAR_SLAVE_PARALLEL_MODE>
|
||||
|
|
|
@ -105,7 +105,7 @@ extern const char *UNUSED_HELP;
|
|||
|
||||
|
||||
static const char *bool_values[3]= {"OFF", "ON", 0};
|
||||
TYPELIB bool_typelib={ array_elements(bool_values)-1, "", bool_values, 0 };
|
||||
TYPELIB bool_typelib= CREATE_TYPELIB_FOR(bool_values);
|
||||
|
||||
|
||||
template<class BASE, privilege_t GLOBAL_PRIV, privilege_t SESSION_PRIV>
|
||||
|
|
|
@ -305,11 +305,7 @@ const char *xtrace_names[] =
|
|||
"QUERY", "STMT", "HANDLER", "BLOCK", "MONGO", NullS
|
||||
};
|
||||
|
||||
TYPELIB xtrace_typelib =
|
||||
{
|
||||
array_elements(xtrace_names) - 1, "xtrace_typelib",
|
||||
xtrace_names, NULL
|
||||
};
|
||||
TYPELIB xtrace_typelib = CREATE_TYPELIB_FOR(xtrace_names);
|
||||
|
||||
static MYSQL_THDVAR_SET(
|
||||
xtrace, // name
|
||||
|
@ -343,11 +339,7 @@ const char *usetemp_names[]=
|
|||
"NO", "AUTO", "YES", "FORCE", "TEST", NullS
|
||||
};
|
||||
|
||||
TYPELIB usetemp_typelib=
|
||||
{
|
||||
array_elements(usetemp_names) - 1, "usetemp_typelib",
|
||||
usetemp_names, NULL
|
||||
};
|
||||
TYPELIB usetemp_typelib= CREATE_TYPELIB_FOR(usetemp_names);
|
||||
|
||||
static MYSQL_THDVAR_ENUM(
|
||||
use_tempfile, // name
|
||||
|
@ -390,11 +382,7 @@ const char *xconv_names[]=
|
|||
"NO", "YES", "FORCE", "SKIP", NullS
|
||||
};
|
||||
|
||||
TYPELIB xconv_typelib=
|
||||
{
|
||||
array_elements(xconv_names) - 1, "xconv_typelib",
|
||||
xconv_names, NULL
|
||||
};
|
||||
TYPELIB xconv_typelib= CREATE_TYPELIB_FOR(xconv_names);
|
||||
|
||||
static MYSQL_THDVAR_ENUM(
|
||||
type_conv, // name
|
||||
|
@ -469,11 +457,7 @@ const char *language_names[]=
|
|||
"default", "english", "french", NullS
|
||||
};
|
||||
|
||||
TYPELIB language_typelib=
|
||||
{
|
||||
array_elements(language_names) - 1, "language_typelib",
|
||||
language_names, NULL
|
||||
};
|
||||
TYPELIB language_typelib= CREATE_TYPELIB_FOR(language_names);
|
||||
|
||||
static MYSQL_THDVAR_ENUM(
|
||||
msg_lang, // name
|
||||
|
|
|
@ -1000,11 +1000,7 @@ const char *enum_var_names[]=
|
|||
"e1", "e2", NullS
|
||||
};
|
||||
|
||||
TYPELIB enum_var_typelib=
|
||||
{
|
||||
array_elements(enum_var_names) - 1, "enum_var_typelib",
|
||||
enum_var_names, NULL
|
||||
};
|
||||
TYPELIB enum_var_typelib= CREATE_TYPELIB_FOR(enum_var_names);
|
||||
|
||||
static MYSQL_SYSVAR_ENUM(
|
||||
enum_var, // name
|
||||
|
|
|
@ -310,12 +310,8 @@ static const char* innodb_stats_method_names[] = {
|
|||
|
||||
/** Used to define an enumerate type of the system variable innodb_stats_method.
|
||||
This is the same as "myisam_stats_method_typelib" */
|
||||
static TYPELIB innodb_stats_method_typelib = {
|
||||
array_elements(innodb_stats_method_names) - 1,
|
||||
"innodb_stats_method_typelib",
|
||||
innodb_stats_method_names,
|
||||
NULL
|
||||
};
|
||||
static TYPELIB innodb_stats_method_typelib =
|
||||
CREATE_TYPELIB_FOR(innodb_stats_method_names);
|
||||
|
||||
/** Possible values of the parameter innodb_checksum_algorithm */
|
||||
const char* innodb_checksum_algorithm_names[] = {
|
||||
|
@ -328,12 +324,8 @@ const char* innodb_checksum_algorithm_names[] = {
|
|||
|
||||
/** Used to define an enumerate type of the system variable
|
||||
innodb_checksum_algorithm. */
|
||||
TYPELIB innodb_checksum_algorithm_typelib = {
|
||||
array_elements(innodb_checksum_algorithm_names) - 1,
|
||||
"innodb_checksum_algorithm_typelib",
|
||||
innodb_checksum_algorithm_names,
|
||||
NULL
|
||||
};
|
||||
TYPELIB innodb_checksum_algorithm_typelib =
|
||||
CREATE_TYPELIB_FOR(innodb_checksum_algorithm_names);
|
||||
|
||||
/** Possible values for system variable "innodb_default_row_format". */
|
||||
static const char* innodb_default_row_format_names[] = {
|
||||
|
@ -345,12 +337,8 @@ static const char* innodb_default_row_format_names[] = {
|
|||
|
||||
/** Used to define an enumerate type of the system variable
|
||||
innodb_default_row_format. */
|
||||
static TYPELIB innodb_default_row_format_typelib = {
|
||||
array_elements(innodb_default_row_format_names) - 1,
|
||||
"innodb_default_row_format_typelib",
|
||||
innodb_default_row_format_names,
|
||||
NULL
|
||||
};
|
||||
static TYPELIB innodb_default_row_format_typelib =
|
||||
CREATE_TYPELIB_FOR(innodb_default_row_format_names);
|
||||
|
||||
/** Names of allowed values of innodb_flush_method */
|
||||
static const char* innodb_flush_method_names[] = {
|
||||
|
@ -371,12 +359,8 @@ static const char* innodb_flush_method_names[] = {
|
|||
static constexpr ulong innodb_flush_method_default = IF_WIN(6,4);
|
||||
|
||||
/** Enumeration of innodb_flush_method */
|
||||
TYPELIB innodb_flush_method_typelib = {
|
||||
array_elements(innodb_flush_method_names) - 1,
|
||||
"innodb_flush_method_typelib",
|
||||
innodb_flush_method_names,
|
||||
NULL
|
||||
};
|
||||
TYPELIB innodb_flush_method_typelib =
|
||||
CREATE_TYPELIB_FOR(innodb_flush_method_names);
|
||||
|
||||
/** Deprecated parameter */
|
||||
static ulong innodb_flush_method;
|
||||
|
@ -386,12 +370,8 @@ static const char *innodb_doublewrite_names[]=
|
|||
{"OFF", "ON", "fast", nullptr};
|
||||
|
||||
/** Enumeration of innodb_doublewrite */
|
||||
TYPELIB innodb_doublewrite_typelib= {
|
||||
array_elements(innodb_doublewrite_names) - 1,
|
||||
"innodb_doublewrite_typelib",
|
||||
innodb_doublewrite_names,
|
||||
nullptr
|
||||
};
|
||||
TYPELIB innodb_doublewrite_typelib=
|
||||
CREATE_TYPELIB_FOR(innodb_doublewrite_names);
|
||||
|
||||
/** Names of allowed values of innodb_deadlock_report */
|
||||
static const char *innodb_deadlock_report_names[]= {
|
||||
|
@ -406,12 +386,8 @@ static_assert(Deadlock::REPORT_BASIC == 1, "compatibility");
|
|||
static_assert(Deadlock::REPORT_FULL == 2, "compatibility");
|
||||
|
||||
/** Enumeration of innodb_deadlock_report */
|
||||
static TYPELIB innodb_deadlock_report_typelib = {
|
||||
array_elements(innodb_deadlock_report_names) - 1,
|
||||
"innodb_deadlock_report_typelib",
|
||||
innodb_deadlock_report_names,
|
||||
NULL
|
||||
};
|
||||
static TYPELIB innodb_deadlock_report_typelib =
|
||||
CREATE_TYPELIB_FOR(innodb_deadlock_report_names);
|
||||
|
||||
/** Allowed values of innodb_instant_alter_column_allowed */
|
||||
const char* innodb_instant_alter_column_allowed_names[] = {
|
||||
|
@ -422,12 +398,8 @@ const char* innodb_instant_alter_column_allowed_names[] = {
|
|||
};
|
||||
|
||||
/** Enumeration of innodb_instant_alter_column_allowed */
|
||||
static TYPELIB innodb_instant_alter_column_allowed_typelib = {
|
||||
array_elements(innodb_instant_alter_column_allowed_names) - 1,
|
||||
"innodb_instant_alter_column_allowed_typelib",
|
||||
innodb_instant_alter_column_allowed_names,
|
||||
NULL
|
||||
};
|
||||
static TYPELIB innodb_instant_alter_column_allowed_typelib =
|
||||
CREATE_TYPELIB_FOR(innodb_instant_alter_column_allowed_names);
|
||||
|
||||
/** Retrieve the FTS Relevance Ranking result for doc with doc_id
|
||||
of m_prebuilt->fts_doc_id
|
||||
|
@ -19774,10 +19746,7 @@ static MYSQL_SYSVAR_BOOL(alter_copy_bulk, innodb_alter_copy_bulk,
|
|||
|
||||
const char *page_compression_algorithms[]= { "none", "zlib", "lz4", "lzo", "lzma", "bzip2", "snappy", 0 };
|
||||
static TYPELIB page_compression_algorithms_typelib=
|
||||
{
|
||||
array_elements(page_compression_algorithms) - 1, 0,
|
||||
page_compression_algorithms, 0
|
||||
};
|
||||
CREATE_TYPELIB_FOR(page_compression_algorithms);
|
||||
static MYSQL_SYSVAR_ENUM(compression_algorithm, innodb_compression_algorithm,
|
||||
PLUGIN_VAR_OPCMDARG,
|
||||
"Compression algorithm used on page compression. One of: none, zlib, lz4, lzo, lzma, bzip2, or snappy",
|
||||
|
@ -19798,10 +19767,8 @@ static MYSQL_SYSVAR_ULONG(fatal_semaphore_wait_threshold, srv_fatal_semaphore_wa
|
|||
0);
|
||||
|
||||
static const char* srv_encrypt_tables_names[] = { "OFF", "ON", "FORCE", 0 };
|
||||
static TYPELIB srv_encrypt_tables_typelib = {
|
||||
array_elements(srv_encrypt_tables_names)-1, 0, srv_encrypt_tables_names,
|
||||
NULL
|
||||
};
|
||||
static TYPELIB srv_encrypt_tables_typelib =
|
||||
CREATE_TYPELIB_FOR(srv_encrypt_tables_names);
|
||||
static MYSQL_SYSVAR_ENUM(encrypt_tables, srv_encrypt_tables,
|
||||
PLUGIN_VAR_OPCMDARG,
|
||||
"Enable encryption for tables. "
|
||||
|
|
|
@ -633,9 +633,7 @@ Recover (repair)/ options (When using '--recover' or '--safe-recover'):\n\
|
|||
|
||||
const char *maria_stats_method_names[] = {"nulls_unequal", "nulls_equal",
|
||||
"nulls_ignored", NullS};
|
||||
TYPELIB maria_stats_method_typelib= {
|
||||
array_elements(maria_stats_method_names) - 1, "",
|
||||
maria_stats_method_names, NULL};
|
||||
TYPELIB maria_stats_method_typelib= CREATE_TYPELIB_FOR(maria_stats_method_names);
|
||||
|
||||
/* Read options */
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <welcome_copyright_notice.h>
|
||||
|
||||
static const char *op_types[]= {"to_s3", "from_s3", "delete_from_s3", NullS};
|
||||
static TYPELIB op_typelib= {array_elements(op_types)-1,"", op_types, NULL};
|
||||
static TYPELIB op_typelib= CREATE_TYPELIB_FOR(op_types);
|
||||
#define OP_IMPOSSIBLE array_elements(op_types)
|
||||
|
||||
static const char *load_default_groups[]= { "aria_s3_copy", 0 };
|
||||
|
|
|
@ -87,55 +87,35 @@ const char *maria_recover_names[]=
|
|||
*/
|
||||
"NORMAL", "BACKUP", "FORCE", "QUICK", "OFF", NullS
|
||||
};
|
||||
TYPELIB maria_recover_typelib=
|
||||
{
|
||||
array_elements(maria_recover_names) - 1, "",
|
||||
maria_recover_names, NULL
|
||||
};
|
||||
TYPELIB maria_recover_typelib= CREATE_TYPELIB_FOR(maria_recover_names);
|
||||
|
||||
const char *maria_stats_method_names[]=
|
||||
{
|
||||
"nulls_unequal", "nulls_equal",
|
||||
"nulls_ignored", NullS
|
||||
};
|
||||
TYPELIB maria_stats_method_typelib=
|
||||
{
|
||||
array_elements(maria_stats_method_names) - 1, "",
|
||||
maria_stats_method_names, NULL
|
||||
};
|
||||
TYPELIB maria_stats_method_typelib= CREATE_TYPELIB_FOR(maria_stats_method_names);
|
||||
|
||||
/* transactions log purge mode */
|
||||
const char *maria_translog_purge_type_names[]=
|
||||
{
|
||||
"immediate", "external", "at_flush", NullS
|
||||
};
|
||||
TYPELIB maria_translog_purge_type_typelib=
|
||||
{
|
||||
array_elements(maria_translog_purge_type_names) - 1, "",
|
||||
maria_translog_purge_type_names, NULL
|
||||
};
|
||||
TYPELIB maria_translog_purge_type_typelib= CREATE_TYPELIB_FOR(maria_translog_purge_type_names);
|
||||
|
||||
/* transactional log directory sync */
|
||||
const char *maria_sync_log_dir_names[]=
|
||||
{
|
||||
"NEVER", "NEWFILE", "ALWAYS", NullS
|
||||
};
|
||||
TYPELIB maria_sync_log_dir_typelib=
|
||||
{
|
||||
array_elements(maria_sync_log_dir_names) - 1, "",
|
||||
maria_sync_log_dir_names, NULL
|
||||
};
|
||||
TYPELIB maria_sync_log_dir_typelib= CREATE_TYPELIB_FOR(maria_sync_log_dir_names);
|
||||
|
||||
/* transactional log group commit */
|
||||
const char *maria_group_commit_names[]=
|
||||
{
|
||||
"none", "hard", "soft", NullS
|
||||
};
|
||||
TYPELIB maria_group_commit_typelib=
|
||||
{
|
||||
array_elements(maria_group_commit_names) - 1, "",
|
||||
maria_group_commit_names, NULL
|
||||
};
|
||||
TYPELIB maria_group_commit_typelib= CREATE_TYPELIB_FOR(maria_group_commit_names);
|
||||
|
||||
/** Interval between background checkpoints in seconds */
|
||||
static ulong checkpoint_interval;
|
||||
|
|
|
@ -40,8 +40,7 @@ static int s3_read_file_from_disk(const char *filename, uchar **to,
|
|||
/* Used by ha_s3.cc and tools to define different protocol options */
|
||||
|
||||
static const char *protocol_types[]= {"Auto", "Original", "Amazon", "Legacy", "Path", "Domain", NullS};
|
||||
TYPELIB s3_protocol_typelib= {array_elements(protocol_types)-1,"",
|
||||
protocol_types, NULL};
|
||||
TYPELIB s3_protocol_typelib= CREATE_TYPELIB_FOR(protocol_types);
|
||||
|
||||
static const char *providers[]= {"Default", "Amazon", "Huawei", NullS};
|
||||
TYPELIB s3_provider_typelib = {array_elements(providers)-1,"",providers, NULL};
|
||||
|
|
|
@ -656,12 +656,8 @@ static const char *mrn_boolean_mode_sytnax_flag_names[] = {
|
|||
"ALLOW_LEADING_NOT",
|
||||
NullS
|
||||
};
|
||||
static TYPELIB mrn_boolean_mode_syntax_flags_typelib = {
|
||||
array_elements(mrn_boolean_mode_sytnax_flag_names) - 1,
|
||||
"",
|
||||
mrn_boolean_mode_sytnax_flag_names,
|
||||
NULL
|
||||
};
|
||||
static TYPELIB mrn_boolean_mode_syntax_flags_typelib =
|
||||
CREATE_TYPELIB_FOR(mrn_boolean_mode_sytnax_flag_names);
|
||||
#endif
|
||||
#ifdef MRN_GROONGA_EMBEDDED
|
||||
static mrn_bool mrn_libgroonga_embedded = true;
|
||||
|
@ -747,12 +743,8 @@ static const char *mrn_log_level_type_names[] = {
|
|||
"DUMP",
|
||||
NullS
|
||||
};
|
||||
static TYPELIB mrn_log_level_typelib = {
|
||||
array_elements(mrn_log_level_type_names) - 1,
|
||||
"mrn_log_level_typelib",
|
||||
mrn_log_level_type_names,
|
||||
NULL
|
||||
};
|
||||
static TYPELIB mrn_log_level_typelib =
|
||||
CREATE_TYPELIB_FOR(mrn_log_level_type_names);
|
||||
|
||||
static void mrn_log_level_update(THD *thd, struct st_mysql_sys_var *var,
|
||||
void *var_ptr, const void *save)
|
||||
|
@ -1075,12 +1067,7 @@ static const char *mrn_action_on_error_names[] = {
|
|||
};
|
||||
|
||||
static TYPELIB mrn_action_on_error_typelib =
|
||||
{
|
||||
array_elements(mrn_action_on_error_names) - 1,
|
||||
"mrn_action_on_error_typelib",
|
||||
mrn_action_on_error_names,
|
||||
NULL
|
||||
};
|
||||
CREATE_TYPELIB_FOR(mrn_action_on_error_names);
|
||||
|
||||
static MYSQL_THDVAR_ENUM(action_on_fulltext_query_error,
|
||||
PLUGIN_VAR_RQCMDARG,
|
||||
|
|
|
@ -41,14 +41,12 @@ static ulong opt_myisam_block_size;
|
|||
/* bits in myisam_recover_options */
|
||||
const char *myisam_recover_names[] =
|
||||
{ "DEFAULT", "BACKUP", "FORCE", "QUICK", "BACKUP_ALL", "OFF", NullS};
|
||||
TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names)-1,"",
|
||||
myisam_recover_names, NULL};
|
||||
TYPELIB myisam_recover_typelib= CREATE_TYPELIB_FOR(myisam_recover_names);
|
||||
|
||||
const char *myisam_stats_method_names[] = {"NULLS_UNEQUAL", "NULLS_EQUAL",
|
||||
"NULLS_IGNORED", NullS};
|
||||
TYPELIB myisam_stats_method_typelib= {
|
||||
array_elements(myisam_stats_method_names) - 1, "",
|
||||
myisam_stats_method_names, NULL};
|
||||
TYPELIB myisam_stats_method_typelib=
|
||||
CREATE_TYPELIB_FOR(myisam_stats_method_names);
|
||||
|
||||
static MYSQL_SYSVAR_ULONG(block_size, opt_myisam_block_size,
|
||||
PLUGIN_VAR_READONLY | PLUGIN_VAR_RQCMDARG,
|
||||
|
|
|
@ -457,9 +457,8 @@ static void usage(void)
|
|||
|
||||
const char *myisam_stats_method_names[] = {"nulls_unequal", "nulls_equal",
|
||||
"nulls_ignored", NullS};
|
||||
TYPELIB myisam_stats_method_typelib= {
|
||||
array_elements(myisam_stats_method_names) - 1, "",
|
||||
myisam_stats_method_names, NULL};
|
||||
TYPELIB myisam_stats_method_typelib=
|
||||
CREATE_TYPELIB_FOR(myisam_stats_method_names);
|
||||
|
||||
/* Read options */
|
||||
|
||||
|
|
|
@ -26,8 +26,7 @@
|
|||
LIST *myrg_open_list=0;
|
||||
static const char *merge_insert_methods[] =
|
||||
{ "FIRST", "LAST", NullS };
|
||||
TYPELIB merge_insert_method= { array_elements(merge_insert_methods)-1,"",
|
||||
merge_insert_methods, 0};
|
||||
TYPELIB merge_insert_method= CREATE_TYPELIB_FOR(merge_insert_methods);
|
||||
|
||||
PSI_memory_key rg_key_memory_MYRG_INFO;
|
||||
PSI_memory_key rg_key_memory_children;
|
||||
|
|
|
@ -768,17 +768,13 @@ static std::shared_ptr<rocksdb::RateLimiter> rocksdb_rate_limiter;
|
|||
static const char *write_policy_names[] = {"write_committed", "write_prepared",
|
||||
"write_unprepared", NullS};
|
||||
|
||||
static TYPELIB write_policy_typelib = {array_elements(write_policy_names) - 1,
|
||||
"write_policy_typelib",
|
||||
write_policy_names, nullptr};
|
||||
static TYPELIB write_policy_typelib = CREATE_TYPELIB_FOR(write_policy_names);
|
||||
|
||||
#if 0 // MARIAROCKS_NOT_YET : read-free replication is not supported
|
||||
/* This array needs to be kept up to date with myrocks::read_free_rpl_type */
|
||||
static const char *read_free_rpl_names[] = {"OFF", "PK_ONLY", "PK_SK", NullS};
|
||||
|
||||
static TYPELIB read_free_rpl_typelib = {array_elements(read_free_rpl_names) - 1,
|
||||
"read_free_rpl_typelib",
|
||||
read_free_rpl_names, nullptr};
|
||||
static TYPELIB read_free_rpl_typelib = CREATE_TYPELIB_FOR(read_free_rpl_names);
|
||||
#endif
|
||||
|
||||
/* This enum needs to be kept up to date with rocksdb::InfoLogLevel */
|
||||
|
@ -786,9 +782,7 @@ static const char *info_log_level_names[] = {"debug_level", "info_level",
|
|||
"warn_level", "error_level",
|
||||
"fatal_level", NullS};
|
||||
|
||||
static TYPELIB info_log_level_typelib = {
|
||||
array_elements(info_log_level_names) - 1, "info_log_level_typelib",
|
||||
info_log_level_names, nullptr};
|
||||
static TYPELIB info_log_level_typelib = CREATE_TYPELIB_FOR(info_log_level_names);
|
||||
|
||||
static void rocksdb_set_rocksdb_info_log_level(
|
||||
THD *const thd, struct st_mysql_sys_var *const var, void *const var_ptr,
|
||||
|
@ -903,9 +897,7 @@ static int rocksdb_compact_column_family(THD *const thd,
|
|||
|
||||
static const char *index_type_names[] = {"kBinarySearch", "kHashSearch", NullS};
|
||||
|
||||
static TYPELIB index_type_typelib = {array_elements(index_type_names) - 1,
|
||||
"index_type_typelib", index_type_names,
|
||||
nullptr};
|
||||
static TYPELIB index_type_typelib = CREATE_TYPELIB_FOR(index_type_names);
|
||||
|
||||
const ulong RDB_MAX_LOCK_WAIT_SECONDS = 1024 * 1024 * 1024;
|
||||
const ulong RDB_DEFAULT_MAX_ROW_LOCKS = 1024 * 1024;
|
||||
|
|
Loading…
Reference in a new issue