mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Fix to make Windows compilation smoother
This commit is contained in:
@@ -129,6 +129,7 @@ static my_bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
|
||||
vertical=0, line_numbers=1, column_names=1,opt_html=0,
|
||||
opt_xml=0,opt_nopager=1, opt_outfile=0, named_cmds= 0,
|
||||
tty_password= 0, opt_nobeep=0;
|
||||
static ulong opt_max_allowed_packet, opt_net_buffer_length;
|
||||
static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0;
|
||||
static my_string opt_mysql_unix_port=0;
|
||||
static int connect_flag=CLIENT_INTERACTIVE;
|
||||
@@ -330,7 +331,7 @@ int main(int argc,char *argv[])
|
||||
exit(1);
|
||||
}
|
||||
if (status.batch && !status.line_buff &&
|
||||
!(status.line_buff=batch_readline_init(max_allowed_packet+512,stdin)))
|
||||
!(status.line_buff=batch_readline_init(opt_max_allowed_packet+512,stdin)))
|
||||
{
|
||||
free_defaults(defaults_argv);
|
||||
exit(1);
|
||||
@@ -573,11 +574,11 @@ static struct my_option my_long_options[] =
|
||||
(gptr*) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 3600*12, 0,
|
||||
0, 1},
|
||||
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "",
|
||||
(gptr*) &max_allowed_packet, (gptr*) &max_allowed_packet, 0, GET_ULONG,
|
||||
(gptr*) &opt_max_allowed_packet, (gptr*) &opt_max_allowed_packet, 0, GET_ULONG,
|
||||
REQUIRED_ARG, 16 *1024L*1024L, 4096, (longlong) 2*1024L*1024L*1024L,
|
||||
MALLOC_OVERHEAD, 1024, 0},
|
||||
{"net_buffer_length", OPT_NET_BUFFER_LENGTH, "",
|
||||
(gptr*) &net_buffer_length, (gptr*) &net_buffer_length, 0, GET_ULONG,
|
||||
(gptr*) &opt_net_buffer_length, (gptr*) &opt_net_buffer_length, 0, GET_ULONG,
|
||||
REQUIRED_ARG, 16384, 1024, 512*1024*1024L, MALLOC_OVERHEAD, 1024, 0},
|
||||
{"select_limit", OPT_SELECT_LIMIT, "", (gptr*) &select_limit,
|
||||
(gptr*) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ~0L, 0, 1, 0},
|
||||
@@ -738,6 +739,7 @@ static int get_options(int argc, char **argv)
|
||||
{
|
||||
char *tmp, *pagpoint;
|
||||
int ho_error;
|
||||
MYSQL_PARAMETERS *mysql_params= mysql_get_parameters();
|
||||
|
||||
tmp= (char *) getenv("MYSQL_HOST");
|
||||
if (tmp)
|
||||
@@ -753,9 +755,15 @@ static int get_options(int argc, char **argv)
|
||||
strmov(pager, pagpoint);
|
||||
strmov(default_pager, pager);
|
||||
|
||||
opt_max_allowed_packet= *mysql_params->p_max_allowed_packet;
|
||||
opt_net_buffer_length= *mysql_params->p_net_buffer_length;
|
||||
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
*mysql_params->p_max_allowed_packet= opt_max_allowed_packet;
|
||||
*mysql_params->p_net_buffer_length= opt_net_buffer_length;
|
||||
|
||||
if (status.batch) /* disable pager and outfile in this case */
|
||||
{
|
||||
strmov(default_pager, "stdout");
|
||||
@@ -2164,7 +2172,7 @@ static int com_source(String *buffer, char *line)
|
||||
return put_info(buff, INFO_ERROR, 0);
|
||||
}
|
||||
|
||||
if (!(line_buff=batch_readline_init(max_allowed_packet+512,sql_file)))
|
||||
if (!(line_buff=batch_readline_init(opt_max_allowed_packet+512,sql_file)))
|
||||
{
|
||||
my_fclose(sql_file,MYF(0));
|
||||
return put_info("Can't initialize batch_readline", INFO_ERROR, 0);
|
||||
|
Reference in New Issue
Block a user