diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-04-25 17:22:25 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-04-25 17:22:25 +0200 |
commit | 0accbd0364e0333e0b119aa9ce93e34ded9df6cb (patch) | |
tree | bdf0738c29dc1f57fbfba3a1754524e238f15b52 /client | |
parent | 37f87d73ae8dc6c30594867b40a5d70159acf63c (diff) | |
download | mariadb-git-0accbd0364e0333e0b119aa9ce93e34ded9df6cb.tar.gz |
lots of post-merge changes
Diffstat (limited to 'client')
-rw-r--r-- | client/CMakeLists.txt | 2 | ||||
-rw-r--r-- | client/Makefile.am | 11 | ||||
-rw-r--r-- | client/mysql.cc | 2 | ||||
-rw-r--r-- | client/mysql_upgrade.c | 15 | ||||
-rw-r--r-- | client/mysqladmin.cc | 3 | ||||
-rw-r--r-- | client/mysqlbinlog.cc | 4 | ||||
-rw-r--r-- | client/mysqlcheck.c | 2 | ||||
-rw-r--r-- | client/mysqldump.c | 2 | ||||
-rw-r--r-- | client/mysqltest.cc | 15 | ||||
-rw-r--r-- | client/sql_string.h | 3 |
10 files changed, 23 insertions, 36 deletions
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 52fd378689e..80c5bbd1c9f 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -74,5 +74,3 @@ PROPERTIES HAS_CXX TRUE) ADD_DEFINITIONS(-DHAVE_DLOPEN) -INSTALL(TARGETS mysql mysqltest mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow - mysqlbinlog mysqladmin mysqlslap echo DESTINATION bin COMPONENT runtime) diff --git a/client/Makefile.am b/client/Makefile.am index 96e763772dd..97ced5fbfb7 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -63,6 +63,7 @@ mysqlbinlog_SOURCES = mysqlbinlog.cc \ $(top_srcdir)/mysys/my_bit.c \ $(top_srcdir)/mysys/my_bitmap.c \ $(top_srcdir)/mysys/base64.c +mysqlbinlog_CXXFLAGS= -I$(top_srcdir)/sql mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS) mysqldump_SOURCES= mysqldump.c \ @@ -102,14 +103,8 @@ DEFS = -DMYSQL_CLIENT_NO_THREADS \ -DDEFAULT_MYSQL_HOME='"$(prefix)"' \ -DMYSQL_DATADIR='"$(localstatedir)"' -sql_src=log_event.h sql_priv.h rpl_constants.h \ - rpl_tblmap.h rpl_tblmap.cc \ - log_event.cc my_decimal.h my_decimal.cc \ - log_event_old.h log_event_old.cc \ - rpl_record_old.h rpl_record_old.cc \ - rpl_utility.h rpl_utility.cc \ - transaction.h sql_const.h \ - sql_list.h rpl_filter.h sql_list.cc rpl_filter.cc +sql_src=rpl_tblmap.cc log_event.cc my_decimal.cc log_event_old.cc \ + rpl_record_old.cc rpl_utility.cc sql_list.cc rpl_filter.cc strings_src=decimal.c dtoa.c link_sources: diff --git a/client/mysql.cc b/client/mysql.cc index 208b5b3288c..d0c35e63536 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -4327,7 +4327,7 @@ extern "C" char *mysql_authentication_dialog_ask(MYSQL *mysql, int type, s= get_tty_password(""); strnmov(buf, s, buf_len); buf[buf_len-1]= 0; - my_free(s, MYF(0)); + my_free(s); } else { diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index cd1c9bb27d3..5045ee0f8cb 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -35,10 +35,10 @@ static char mysql_path[FN_REFLEN]; static char mysqlcheck_path[FN_REFLEN]; -static my_bool opt_force, debug_info_flag, debug_check_flag, +static my_bool opt_force, opt_verbose, debug_info_flag, debug_check_flag, opt_systables_only; -static my_bool opt_not_used; /* For compatiblity */ -static uint my_end_arg= 0, opt_verbose; +static my_bool opt_not_used, opt_silent; +static uint my_end_arg= 0; static char *opt_user= (char*)"root"; static DYNAMIC_STRING ds_args; @@ -59,6 +59,8 @@ static my_bool not_used; /* Can't use GET_BOOL without a value pointer */ static my_bool opt_write_binlog; +#define OPT_SILENT OPT_MAX_CLIENT_OPTION + static struct my_option my_long_options[]= { {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG, @@ -118,7 +120,7 @@ static struct my_option my_long_options[]= "Base name of shared memory.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"silent", 's', "Print less information", &opt_silent, + {"silent", OPT_SILENT, "Print less information", &opt_silent, &opt_silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"socket", 'S', "The socket file to use for connection.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -282,10 +284,13 @@ get_one_option(int optid, const struct my_option *opt, } add_option= 0; break; - case 's': + case OPT_SILENT: opt_verbose= 0; add_option= 0; break; + case 's': + add_option= 0; + break; case 'f': /* --force */ add_option= FALSE; break; diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index f164a7d039f..83b034a61b5 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -663,7 +663,6 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) REFRESH_MASTER | REFRESH_TABLE_STATS | REFRESH_INDEX_STATS | REFRESH_USER_STATS | - REFRESH_SLOW_QUERY_LOG | REFRESH_CLIENT_STATS))) { my_printf_error(0, "refresh failed; error: '%s'", error_flags, @@ -869,7 +868,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_SLOW_LOG: { - if (mysql_query(mysql,"flush slow query logs")) + if (mysql_query(mysql,"flush slow logs")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index a8f96a1089d..4b62bd12ceb 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -28,6 +28,7 @@ #define MYSQL_CLIENT #undef MYSQL_SERVER +#define TABLE TABLE_CLIENT #include "client_priv.h" #include <my_time.h> /* That one is necessary for defines of OPTION_NO_FOREIGN_KEY_CHECKS etc */ @@ -1136,7 +1137,7 @@ static struct my_option my_long_options[] = 0, 0}, {"result-file", 'r', "Direct output to a given file.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"server-id", OPT_SERVER_ID, + {"server-id", 0, "Extract only binlog entries created by the server having the given id.", &server_id, &server_id, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -2247,6 +2248,7 @@ void *sql_alloc(size_t size) the server */ +#undef TABLE #include "my_decimal.h" #include "decimal.c" #include "my_decimal.cc" diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index aeaead924c9..f5a2c4600f8 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -777,7 +777,7 @@ static void print_result() we have to run upgrade on it. In this case we write a nicer message than "Please do "REPAIR TABLE""... */ - if (!strcmp(row[2],"error") && strinstr(row[3],"REPAIR TABLE") != 0) + if (!strcmp(row[2],"error") && strstr(row[3],"REPAIR TABLE")) printf("%-50s %s", row[0], "Needs upgrade"); else printf("%s\n%-9s: %s", row[0], row[2], row[3]); diff --git a/client/mysqldump.c b/client/mysqldump.c index 626ce1dede7..34055f3db67 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -4207,7 +4207,7 @@ static char *get_actual_table_name(const char *old_table_name, MEM_ROOT *root) } mysql_free_result(table_res); } - DBUG_PRINT("exit", ("new_table_name: %s", val_or_null(name))); + DBUG_PRINT("exit", ("new_table_name: %s", name)); DBUG_RETURN(name); } diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 3eea6b997c8..802e94b8d7c 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -103,7 +103,6 @@ static int opt_max_connect_retries; static int opt_result_format_version; static int opt_max_connections= DEFAULT_MAX_CONN; static my_bool opt_compress= 0, silent= 0, verbose= 0; -static int opt_connect_timeout= -1; static my_bool debug_info_flag= 0, debug_check_flag= 0; static my_bool tty_password= 0; static my_bool opt_mark_progress= 0; @@ -556,8 +555,7 @@ public: void open(const char* dir, const char* name, const char* ext) { DBUG_ENTER("LogFile::open"); - DBUG_PRINT("enter", ("dir: '%s', name: '%s'", - val_or_null(dir), val_or_null(name))); + DBUG_PRINT("enter", ("dir: '%s', name: '%s'", dir, name)); if (!name) { m_file= stdout; @@ -648,9 +646,8 @@ public: DBUG_VOID_RETURN; } - IF_DBUG(buf[bytes]= '\0';) - DBUG_PRINT("info", ("Read %lu bytes from file, buf: %s", - (unsigned long)bytes, buf)); + DBUG_PRINT("info", ("Read %zu bytes from file, buf: %.*s", + bytes, (int)bytes, buf)); char* show_from= buf + bytes; while(show_from > buf && lines > 0 ) @@ -5420,9 +5417,6 @@ void do_connect(struct st_command *command) if (opt_charsets_dir) mysql_options(&con_slot->mysql, MYSQL_SET_CHARSET_DIR, opt_charsets_dir); - if (opt_connect_timeout >= 0) - mysql_options(&con_slot->mysql, MYSQL_OPT_CONNECT_TIMEOUT, - &opt_connect_timeout); #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) if (opt_use_ssl || con_ssl) @@ -6249,9 +6243,6 @@ static struct my_option my_long_options[] = GET_INT, REQUIRED_ARG, 0, 0, 10000, 0, 0, 0}, {"test-file", 'x', "Read test from/in this file (default stdin).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"connect-timeout", OPT_MY_CONNECT_TIMEOUT, "Client connection timeout", - (uchar**) &opt_connect_timeout, (uchar**) &opt_connect_timeout, 0, - GET_INT, REQUIRED_ARG, -1, -1, 0, 0, 0, 0}, {"timer-file", 'm', "File where the timing in microseconds is stored.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"tmpdir", 't', "Temporary directory where sockets are put.", diff --git a/client/sql_string.h b/client/sql_string.h index b51e6b07e01..bafc287c73e 100644 --- a/client/sql_string.h +++ b/client/sql_string.h @@ -18,9 +18,6 @@ /* This file is originally from the mysql distribution. Coded by monty */ -#ifndef CLIENT_SQL_STRING_H -#define CLIENT_SQL_STRING_H - #ifdef USE_PRAGMA_INTERFACE #pragma interface /* gcc class implementation */ #endif |