mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge with 4.0
BitKeeper/etc/logging_ok: auto-union BitKeeper/deleted/.del-apply-patch: Delete: netware/BUILD/apply-patch BitKeeper/deleted/.del-save-patch: Delete: netware/BUILD/save-patch BitKeeper/deleted/.del-mini_client.cc~8677895ec8169183: Auto merged BitKeeper/triggers/post-commit: Auto merged VC++Files/mysys/mysys.dsp: Auto merged client/mysqlbinlog.cc: Auto merged extra/resolveip.c: Auto merged include/config-win.h: Auto merged include/my_global.h: Auto merged include/my_sys.h: Auto merged include/mysql_com.h: Auto merged innobase/include/os0thread.h: Auto merged innobase/os/os0file.c: Auto merged innobase/srv/srv0start.c: Auto merged innobase/thr/thr0loc.c: Auto merged libmysql/manager.c: Auto merged libmysqld/Makefile.am: Auto merged libmysqld/lib_sql.cc: Auto merged myisam/ft_boolean_search.c: Auto merged myisam/mi_extra.c: Auto merged myisam/mi_locking.c: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/fulltext.result: Auto merged mysql-test/r/myisam.result: Auto merged mysql-test/r/select.result: Auto merged mysql-test/t/fulltext.test: Auto merged mysql-test/t/myisam.test: Auto merged mysql-test/t/rpl_reset_slave.test: Auto merged mysql-test/t/rpl_trunc_binlog.test: Auto merged mysys/Makefile.am: Auto merged mysys/errors.c: Auto merged mysys/my_symlink.c: Auto merged mysys/my_thr_init.c: Auto merged scripts/mysql_install_db.sh: Auto merged sql/item_func.cc: Auto merged sql/log_event.h: Auto merged sql/mysqld.cc: Auto merged sql/slave.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_repl.cc: Auto merged sql/sql_test.cc: Auto merged sql/unireg.h: Auto merged client/mysqldump.c: merge with 4.0 (quoted names) configure.in: use local file include/my_pthread.h: Use local file innobase/include/srv0srv.h: Use local file innobase/row/row0sel.c: Use local file innobase/srv/srv0srv.c: Use local file libmysql/libmysql.c: Use local file myisam/myisamchk.c: merge fixes mysql-test/r/func_crypt.result: update results mysql-test/r/order_by.result: update results mysql-test/r/query_cache.result: update results mysql-test/r/range.result: update results mysql-test/r/rpl_reset_slave.result: update results mysql-test/r/rpl_trunc_binlog.result: update results mysql-test/t/func_crypt.test: Added disable_warnings/enable warnings mysql-test/t/query_cache.test: merge tests mysql-test/t/range.test: merge tests mysys/charset.c: use local file (will merge patch separately) sql/ha_innodb.cc: use local file sql/log_event.cc: new slave_proxy_id handling sql/slave.h: merge sql/sql_base.cc: merge sql/sql_parse.cc: Fixes for counting user connect resourses Added function comments for involved functions sql/sql_select.cc: Fix for not doing sort with LIMIT when OPTION_FOUND_ROWS is used sql/unireg.cc: merge fixes support-files/mysql.server.sh: merge fixes
This commit is contained in:
@ -52,7 +52,7 @@ static const char* host = 0;
|
||||
static int port = MYSQL_PORT;
|
||||
static const char* sock= 0;
|
||||
static const char* user = 0;
|
||||
static const char* pass = "";
|
||||
static char* pass = 0;
|
||||
static ulonglong position = 0;
|
||||
static short binlog_flags = 0;
|
||||
static MYSQL* mysql = NULL;
|
||||
@ -226,7 +226,7 @@ static struct my_option my_long_options[] =
|
||||
{"offset", 'o', "Skip the first N entries.", (gptr*) &offset, (gptr*) &offset,
|
||||
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"password", 'p', "Password to connect to remote server.",
|
||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"port", 'P', "Use port to connect to the remote server.",
|
||||
(gptr*) &port, (gptr*) &port, 0, GET_INT, REQUIRED_ARG, MYSQL_PORT, 0, 0,
|
||||
0, 0, 0},
|
||||
@ -266,6 +266,11 @@ void sql_print_error(const char *format,...)
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
static void cleanup()
|
||||
{
|
||||
my_free(pass,MYF(MY_ALLOW_ZERO_PTR));
|
||||
}
|
||||
|
||||
static void die(const char* fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
@ -274,6 +279,7 @@ static void die(const char* fmt, ...)
|
||||
vfprintf(stderr, fmt, args);
|
||||
fprintf(stderr, "\n");
|
||||
va_end(args);
|
||||
cleanup();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -333,6 +339,7 @@ extern "C" my_bool
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
bool tty_password=0;
|
||||
switch (optid) {
|
||||
#ifndef DBUG_OFF
|
||||
case '#':
|
||||
@ -343,7 +350,17 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
one_database = 1;
|
||||
break;
|
||||
case 'p':
|
||||
pass = my_strdup(argument, MYF(0));
|
||||
if (argument)
|
||||
{
|
||||
my_free(pass,MYF(MY_ALLOW_ZERO_PTR));
|
||||
char *start=argument;
|
||||
pass= my_strdup(argument,MYF(MY_FAE));
|
||||
while (*argument) *argument++= 'x'; /* Destroy argument */
|
||||
if (*start)
|
||||
start[1]=0; /* Cut length of argument */
|
||||
}
|
||||
else
|
||||
tty_password=1;
|
||||
break;
|
||||
case 'r':
|
||||
if (!(result_file = my_fopen(argument, O_WRONLY | O_BINARY, MYF(MY_WME))))
|
||||
@ -359,6 +376,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
usage();
|
||||
exit(0);
|
||||
}
|
||||
if (tty_password)
|
||||
pass= get_tty_password(NullS);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -707,6 +727,7 @@ int main(int argc, char** argv)
|
||||
my_fclose(result_file, MYF(0));
|
||||
if (remote_opt)
|
||||
mysql_close(mysql);
|
||||
cleanup();
|
||||
free_defaults(defaults_argv);
|
||||
my_end(0);
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user