mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1-marvel
into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.1-marvel
This commit is contained in:
@@ -885,14 +885,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
opt_nopager= 1;
|
opt_nopager= 1;
|
||||||
break;
|
break;
|
||||||
case OPT_MYSQL_PROTOCOL:
|
case OPT_MYSQL_PROTOCOL:
|
||||||
{
|
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
|
||||||
if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0)
|
opt->name);
|
||||||
{
|
|
||||||
fprintf(stderr, "Unknown option to protocol: %s\n", argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'A':
|
case 'A':
|
||||||
opt_rehash= 0;
|
opt_rehash= 0;
|
||||||
|
@@ -284,15 +284,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case OPT_MYSQL_PROTOCOL:
|
case OPT_MYSQL_PROTOCOL:
|
||||||
{
|
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
|
||||||
if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0)
|
opt->name);
|
||||||
{
|
|
||||||
fprintf(stderr, "Unknown option to protocol: %s\n", argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
usage();
|
usage();
|
||||||
|
@@ -948,14 +948,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
remote_opt= 1;
|
remote_opt= 1;
|
||||||
break;
|
break;
|
||||||
case OPT_MYSQL_PROTOCOL:
|
case OPT_MYSQL_PROTOCOL:
|
||||||
{
|
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
|
||||||
if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0)
|
opt->name);
|
||||||
{
|
|
||||||
fprintf(stderr, "Unknown option to protocol: %s\n", argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case OPT_START_DATETIME:
|
case OPT_START_DATETIME:
|
||||||
start_datetime= convert_str_to_timestamp(start_datetime_str);
|
start_datetime= convert_str_to_timestamp(start_datetime_str);
|
||||||
break;
|
break;
|
||||||
|
@@ -310,15 +310,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
break;
|
break;
|
||||||
case 'V': print_version(); exit(0);
|
case 'V': print_version(); exit(0);
|
||||||
case OPT_MYSQL_PROTOCOL:
|
case OPT_MYSQL_PROTOCOL:
|
||||||
{
|
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
|
||||||
if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0)
|
opt->name);
|
||||||
{
|
|
||||||
fprintf(stderr, "Unknown option to protocol: %s\n", argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -790,14 +790,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (int) OPT_MYSQL_PROTOCOL:
|
case (int) OPT_MYSQL_PROTOCOL:
|
||||||
{
|
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
|
||||||
if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0)
|
opt->name);
|
||||||
{
|
break;
|
||||||
fprintf(stderr, "Unknown option to protocol: %s\n", argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -231,14 +231,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case OPT_MYSQL_PROTOCOL:
|
case OPT_MYSQL_PROTOCOL:
|
||||||
{
|
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
|
||||||
if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0)
|
opt->name);
|
||||||
{
|
|
||||||
fprintf(stderr, "Unknown option to protocol: %s\n", argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case '#':
|
case '#':
|
||||||
DBUG_PUSH(argument ? argument : "d:t:o");
|
DBUG_PUSH(argument ? argument : "d:t:o");
|
||||||
break;
|
break;
|
||||||
|
@@ -287,14 +287,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case OPT_MYSQL_PROTOCOL:
|
case OPT_MYSQL_PROTOCOL:
|
||||||
{
|
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
|
||||||
if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0)
|
opt->name);
|
||||||
{
|
|
||||||
fprintf(stderr, "Unknown option to protocol: %s\n", argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case '#':
|
case '#':
|
||||||
DBUG_PUSH(argument ? argument : "d:t:o");
|
DBUG_PUSH(argument ? argument : "d:t:o");
|
||||||
break;
|
break;
|
||||||
|
@@ -568,14 +568,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case OPT_MYSQL_PROTOCOL:
|
case OPT_MYSQL_PROTOCOL:
|
||||||
{
|
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
|
||||||
if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0)
|
opt->name);
|
||||||
{
|
break;
|
||||||
fprintf(stderr, "Unknown option to protocol: %s\n", argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case '#':
|
case '#':
|
||||||
DBUG_PUSH(argument ? argument : default_dbug_option);
|
DBUG_PUSH(argument ? argument : default_dbug_option);
|
||||||
break;
|
break;
|
||||||
|
@@ -26,6 +26,8 @@ typedef struct st_typelib { /* Different types saved here */
|
|||||||
unsigned int *type_lengths;
|
unsigned int *type_lengths;
|
||||||
} TYPELIB;
|
} TYPELIB;
|
||||||
|
|
||||||
|
extern int find_type_or_exit(const char *x, TYPELIB *typelib,
|
||||||
|
const char *option);
|
||||||
extern int find_type(char *x,TYPELIB *typelib,unsigned int full_name);
|
extern int find_type(char *x,TYPELIB *typelib,unsigned int full_name);
|
||||||
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
|
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
|
||||||
extern const char *get_type(TYPELIB *typelib,unsigned int nr);
|
extern const char *get_type(TYPELIB *typelib,unsigned int nr);
|
||||||
|
@@ -7,3 +7,4 @@ SOCKET
|
|||||||
ERROR 2047 (HY000): Wrong or unknown protocol
|
ERROR 2047 (HY000): Wrong or unknown protocol
|
||||||
ERROR 2047 (HY000): Wrong or unknown protocol
|
ERROR 2047 (HY000): Wrong or unknown protocol
|
||||||
Unknown option to protocol: NullS
|
Unknown option to protocol: NullS
|
||||||
|
Alternatives are: 'TCP','SOCKET','PIPE','MEMORY'
|
||||||
|
@@ -20,6 +20,28 @@
|
|||||||
#include <m_ctype.h>
|
#include <m_ctype.h>
|
||||||
|
|
||||||
|
|
||||||
|
int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option)
|
||||||
|
{
|
||||||
|
int res;
|
||||||
|
const char **ptr;
|
||||||
|
|
||||||
|
if ((res= find_type((my_string) x, typelib, 2)) <= 0)
|
||||||
|
{
|
||||||
|
ptr= typelib->type_names;
|
||||||
|
if (!*x)
|
||||||
|
fprintf(stderr, "No option given to %s\n", option);
|
||||||
|
else
|
||||||
|
fprintf(stderr, "Unknown option to %s: %s\n", option, x);
|
||||||
|
fprintf(stderr, "Alternatives are: '%s'", *ptr);
|
||||||
|
while (*++ptr)
|
||||||
|
fprintf(stderr, ",'%s'", *ptr);
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Search after a string in a list of strings. Endspace in x is not compared.
|
Search after a string in a list of strings. Endspace in x is not compared.
|
||||||
|
|
||||||
|
118
sql/mysqld.cc
118
sql/mysqld.cc
@@ -737,6 +737,8 @@ pthread_handler_t handle_connections_shared_memory(void *arg);
|
|||||||
#endif
|
#endif
|
||||||
pthread_handler_t handle_slave(void *arg);
|
pthread_handler_t handle_slave(void *arg);
|
||||||
static ulong find_bit_type(const char *x, TYPELIB *bit_lib);
|
static ulong find_bit_type(const char *x, TYPELIB *bit_lib);
|
||||||
|
static ulong find_bit_type_or_exit(const char *x, TYPELIB *bit_lib,
|
||||||
|
const char *option);
|
||||||
static void clean_up(bool print_message);
|
static void clean_up(bool print_message);
|
||||||
static int test_if_case_insensitive(const char *dir_name);
|
static int test_if_case_insensitive(const char *dir_name);
|
||||||
|
|
||||||
@@ -7422,11 +7424,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
case (int) OPT_INIT_RPL_ROLE:
|
case (int) OPT_INIT_RPL_ROLE:
|
||||||
{
|
{
|
||||||
int role;
|
int role;
|
||||||
if ((role=find_type(argument, &rpl_role_typelib, 2)) <= 0)
|
role= find_type_or_exit(argument, &rpl_role_typelib, opt->name);
|
||||||
{
|
|
||||||
fprintf(stderr, "Unknown replication role: %s\n", argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
rpl_status = (role == 1) ? RPL_AUTH_MASTER : RPL_IDLE_SLAVE;
|
rpl_status = (role == 1) ? RPL_AUTH_MASTER : RPL_IDLE_SLAVE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -7482,17 +7480,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
case OPT_BINLOG_FORMAT:
|
case OPT_BINLOG_FORMAT:
|
||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
if ((id= find_type(argument, &binlog_format_typelib, 2)) <= 0)
|
id= find_type_or_exit(argument, &binlog_format_typelib, opt->name);
|
||||||
{
|
|
||||||
fprintf(stderr,
|
|
||||||
"Unknown binary log format: '%s' "
|
|
||||||
"(should be one of '%s', '%s', '%s')\n",
|
|
||||||
argument,
|
|
||||||
binlog_format_names[BINLOG_FORMAT_STMT],
|
|
||||||
binlog_format_names[BINLOG_FORMAT_ROW],
|
|
||||||
binlog_format_names[BINLOG_FORMAT_MIXED]);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
global_system_variables.binlog_format= opt_binlog_format_id= id - 1;
|
global_system_variables.binlog_format= opt_binlog_format_id= id - 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -7552,13 +7540,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_output_str= argument;
|
log_output_str= argument;
|
||||||
if ((log_output_options=
|
log_output_options=
|
||||||
find_bit_type(argument, &log_output_typelib)) == ~(ulong) 0)
|
find_bit_type_or_exit(argument, &log_output_typelib, opt->name);
|
||||||
{
|
}
|
||||||
fprintf(stderr, "Unknown option to log-output: %s\n", argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -7572,10 +7556,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
type= 5 1 2 3 4
|
type= 5 1 2 3 4
|
||||||
(DISABLE ) - (OFF | ON) - (0 | 1)
|
(DISABLE ) - (OFF | ON) - (0 | 1)
|
||||||
*/
|
*/
|
||||||
switch ((type=find_type(argument, &Events::opt_typelib, 1))) {
|
type= find_type_or_exit(argument, &Events::opt_typelib, opt->name);
|
||||||
case 0:
|
switch (type) {
|
||||||
fprintf(stderr, "Unknown option to event-scheduler: %s\n",argument);
|
|
||||||
exit(1);
|
|
||||||
case 5: /* OPT_DISABLED */
|
case 5: /* OPT_DISABLED */
|
||||||
Events::opt_event_scheduler= Events::EVENTS_DISABLED;
|
Events::opt_event_scheduler= Events::EVENTS_DISABLED;
|
||||||
break;
|
break;
|
||||||
@@ -7725,11 +7707,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
int type;
|
int type;
|
||||||
if ((type=find_type(argument, &delay_key_write_typelib, 2)) <= 0)
|
type= find_type_or_exit(argument, &delay_key_write_typelib, opt->name);
|
||||||
{
|
|
||||||
fprintf(stderr,"Unknown delay_key_write type: %s\n",argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
delay_key_write_options= (uint) type-1;
|
delay_key_write_options= (uint) type-1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -7740,11 +7718,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
case OPT_TX_ISOLATION:
|
case OPT_TX_ISOLATION:
|
||||||
{
|
{
|
||||||
int type;
|
int type;
|
||||||
if ((type=find_type(argument, &tx_isolation_typelib, 2)) <= 0)
|
type= find_type_or_exit(argument, &tx_isolation_typelib, opt->name);
|
||||||
{
|
|
||||||
fprintf(stderr,"Unknown transaction isolation type: %s\n",argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
global_system_variables.tx_isolation= (type-1);
|
global_system_variables.tx_isolation= (type-1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -7785,16 +7759,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
break;
|
break;
|
||||||
case OPT_NDB_DISTRIBUTION:
|
case OPT_NDB_DISTRIBUTION:
|
||||||
int id;
|
int id;
|
||||||
if ((id= find_type(argument, &ndb_distribution_typelib, 2)) <= 0)
|
id= find_type_or_exit(argument, &ndb_distribution_typelib, opt->name);
|
||||||
{
|
|
||||||
fprintf(stderr,
|
|
||||||
"Unknown ndb distribution type: '%s' "
|
|
||||||
"(should be '%s' or '%s')\n",
|
|
||||||
argument,
|
|
||||||
ndb_distribution_names[ND_KEYHASH],
|
|
||||||
ndb_distribution_names[ND_LINHASH]);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
opt_ndb_distribution_id= (enum ndb_distribution)(id-1);
|
opt_ndb_distribution_id= (enum ndb_distribution)(id-1);
|
||||||
break;
|
break;
|
||||||
case OPT_NDB_EXTRA_LOGGING:
|
case OPT_NDB_EXTRA_LOGGING:
|
||||||
@@ -7834,12 +7799,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
myisam_recover_options_str=argument;
|
myisam_recover_options_str=argument;
|
||||||
if ((myisam_recover_options=
|
myisam_recover_options=
|
||||||
find_bit_type(argument, &myisam_recover_typelib)) == ~(ulong) 0)
|
find_bit_type_or_exit(argument, &myisam_recover_typelib, opt->name);
|
||||||
{
|
|
||||||
fprintf(stderr, "Unknown option to myisam-recover: %s\n",argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ha_open_options|=HA_OPEN_ABORT_IF_CRASHED;
|
ha_open_options|=HA_OPEN_ABORT_IF_CRASHED;
|
||||||
break;
|
break;
|
||||||
@@ -7852,14 +7813,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
myisam_concurrent_insert= 0; /* --skip-concurrent-insert */
|
myisam_concurrent_insert= 0; /* --skip-concurrent-insert */
|
||||||
break;
|
break;
|
||||||
case OPT_TC_HEURISTIC_RECOVER:
|
case OPT_TC_HEURISTIC_RECOVER:
|
||||||
{
|
tc_heuristic_recover= find_type_or_exit(argument,
|
||||||
if ((tc_heuristic_recover=find_type(argument,
|
&tc_heuristic_recover_typelib,
|
||||||
&tc_heuristic_recover_typelib, 2)) <=0)
|
opt->name);
|
||||||
{
|
break;
|
||||||
fprintf(stderr, "Unknown option to tc-heuristic-recover: %s\n",argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case OPT_MYISAM_STATS_METHOD:
|
case OPT_MYISAM_STATS_METHOD:
|
||||||
{
|
{
|
||||||
ulong method_conv;
|
ulong method_conv;
|
||||||
@@ -7867,11 +7824,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
LINT_INIT(method_conv);
|
LINT_INIT(method_conv);
|
||||||
|
|
||||||
myisam_stats_method_str= argument;
|
myisam_stats_method_str= argument;
|
||||||
if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0)
|
method= find_type_or_exit(argument, &myisam_stats_method_typelib,
|
||||||
{
|
opt->name);
|
||||||
fprintf(stderr, "Invalid value of myisam_stats_method: %s.\n", argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
switch (method-1) {
|
switch (method-1) {
|
||||||
case 2:
|
case 2:
|
||||||
method_conv= MI_STATS_METHOD_IGNORE_NULLS;
|
method_conv= MI_STATS_METHOD_IGNORE_NULLS;
|
||||||
@@ -7890,12 +7844,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||||||
case OPT_SQL_MODE:
|
case OPT_SQL_MODE:
|
||||||
{
|
{
|
||||||
sql_mode_str= argument;
|
sql_mode_str= argument;
|
||||||
if ((global_system_variables.sql_mode=
|
global_system_variables.sql_mode=
|
||||||
find_bit_type(argument, &sql_mode_typelib)) == ~(ulong) 0)
|
find_bit_type_or_exit(argument, &sql_mode_typelib, opt->name);
|
||||||
{
|
|
||||||
fprintf(stderr, "Unknown option to sql-mode: %s\n", argument);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
global_system_variables.sql_mode= fix_sql_mode(global_system_variables.
|
global_system_variables.sql_mode= fix_sql_mode(global_system_variables.
|
||||||
sql_mode);
|
sql_mode);
|
||||||
break;
|
break;
|
||||||
@@ -8203,6 +8153,30 @@ static void fix_paths(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static ulong find_bit_type_or_exit(const char *x, TYPELIB *bit_lib,
|
||||||
|
const char *option)
|
||||||
|
{
|
||||||
|
ulong res;
|
||||||
|
|
||||||
|
const char **ptr;
|
||||||
|
|
||||||
|
if ((res= find_bit_type(x, bit_lib)) == ~(ulong) 0)
|
||||||
|
{
|
||||||
|
ptr= bit_lib->type_names;
|
||||||
|
if (!*x)
|
||||||
|
fprintf(stderr, "No option given to %s\n", option);
|
||||||
|
else
|
||||||
|
fprintf(stderr, "Wrong option to %s. Option(s) given: %s\n", option, x);
|
||||||
|
fprintf(stderr, "Alternatives are: '%s'", *ptr);
|
||||||
|
while (*++ptr)
|
||||||
|
fprintf(stderr, ",'%s'", *ptr);
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Return a bitfield from a string of substrings separated by ','
|
Return a bitfield from a string of substrings separated by ','
|
||||||
returns ~(ulong) 0 on error.
|
returns ~(ulong) 0 on error.
|
||||||
|
Reference in New Issue
Block a user