mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1
into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.1-marvel client/mysqlcheck.c: Auto merged client/mysqldump.c: Auto merged include/my_time.h: Auto merged mysql-test/r/date_formats.result: Auto merged mysql-test/r/grant.result: Auto merged mysql-test/r/sp.result: Auto merged mysql-test/r/type_date.result: Auto merged mysql-test/r/type_datetime.result: Auto merged mysql-test/t/grant.test: Auto merged mysql-test/t/sp.test: Auto merged mysys/my_malloc.c: Auto merged mysys/my_static.c: Auto merged mysys/safemalloc.c: Auto merged sql/event_queue.cc: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.h: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/set_var.cc: Auto merged sql/slave.cc: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_db.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/table.cc: Auto merged sql-common/client.c: Auto merged sql-common/my_time.c: Auto merged sql/time.cc: Auto merged storage/archive/ha_archive.cc: Auto merged storage/innobase/handler/ha_innodb.cc: Auto merged storage/ndb/src/mgmclient/CommandInterpreter.cpp: Auto merged tests/mysql_client_test.c: Auto merged client/client_priv.h: Manual merge with main 5.1 source. sql/event_data_objects.cc: Manual merge with main 5.1 source. sql/event_db_repository.cc: Manual merge with main 5.1 source. sql/mysqld.cc: Manual merge with main 5.1 source. sql/sql_load.cc: Manual merge with main 5.1 source. sql/sql_parse.cc: Manual merge with main 5.1 source.
This commit is contained in:
@ -109,7 +109,8 @@ static char *opt_password=0,*current_user=0,
|
||||
*lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0,
|
||||
*where=0, *order_by=0,
|
||||
*opt_compatible_mode_str= 0,
|
||||
*err_ptr= 0;
|
||||
*err_ptr= 0,
|
||||
*log_error_file= NULL;
|
||||
static char **defaults_argv= 0;
|
||||
static char compatible_mode_normal_str[255];
|
||||
static ulong opt_compatible_mode= 0;
|
||||
@ -120,7 +121,9 @@ static my_string opt_mysql_unix_port=0;
|
||||
static int first_error=0;
|
||||
static DYNAMIC_STRING extended_row;
|
||||
#include <sslopt-vars.h>
|
||||
FILE *md_result_file= 0;
|
||||
FILE *md_result_file= 0;
|
||||
FILE *stderror_file=0;
|
||||
|
||||
#ifdef HAVE_SMEM
|
||||
static char *shared_memory_base_name=0;
|
||||
#endif
|
||||
@ -320,6 +323,9 @@ static struct my_option my_long_options[] =
|
||||
0, 0, 0, 0, 0, 0},
|
||||
{"lock-tables", 'l', "Lock all tables for read.", (gptr*) &lock_tables,
|
||||
(gptr*) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
|
||||
{"log-error", OPT_ERROR_LOG_FILE, "Append warnings and errors to given file.",
|
||||
(gptr*) &log_error_file, (gptr*) &log_error_file, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"master-data", OPT_MASTER_DATA,
|
||||
"This causes the binary log position and filename to be appended to the "
|
||||
"output. If equal to 1, will print it as a CHANGE MASTER command; if equal"
|
||||
@ -801,14 +807,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
break;
|
||||
}
|
||||
case (int) OPT_MYSQL_PROTOCOL:
|
||||
{
|
||||
if ((opt_protocol= find_type(argument, &sql_protocol_typelib,0)) <= 0)
|
||||
{
|
||||
fprintf(stderr, "Unknown option to protocol: %s\n", argument);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
|
||||
opt->name);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -4210,6 +4211,16 @@ int main(int argc, char **argv)
|
||||
free_resources(0);
|
||||
exit(exit_code);
|
||||
}
|
||||
|
||||
if (log_error_file)
|
||||
{
|
||||
if(!(stderror_file= freopen(log_error_file, "a+", stderr)))
|
||||
{
|
||||
free_resources(0);
|
||||
exit(EX_MYSQLERR);
|
||||
}
|
||||
}
|
||||
|
||||
if (connect_to_db(current_host, current_user, opt_password))
|
||||
{
|
||||
free_resources(0);
|
||||
@ -4273,5 +4284,9 @@ err:
|
||||
if (!path)
|
||||
write_footer(md_result_file);
|
||||
free_resources();
|
||||
|
||||
if (stderror_file)
|
||||
fclose(stderror_file);
|
||||
|
||||
return(first_error);
|
||||
} /* main */
|
||||
|
Reference in New Issue
Block a user