diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql.cc | 6 | ||||
-rw-r--r-- | client/mysqlcheck.c | 21 | ||||
-rw-r--r-- | client/mysqltest.cc | 2 |
3 files changed, 23 insertions, 6 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 4b3a39fe302..50114ee8b65 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -40,7 +40,7 @@ #include "my_readline.h" #include <signal.h> #include <violite.h> - +#include <source_revision.h> #if defined(USE_LIBEDIT_INTERFACE) && defined(HAVE_LOCALE_H) #include <locale.h> #endif @@ -1720,8 +1720,8 @@ static void usage(int version) my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE, readline, rl_library_version); #else - printf("%s Ver %s Distrib %s, for %s (%s)\n", my_progname, VER, - MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); + printf("%s Ver %s Distrib %s, for %s (%s), source revision %s\n", my_progname, VER, + MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE,SOURCE_REVISION); #endif if (version) diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 42785b6dc7c..c633be6b734 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -19,6 +19,8 @@ /* By Jani Tolonen, 2001-04-20, MySQL Development Team */ #define CHECK_VERSION "2.7.4-MariaDB" +/* Avoid warnings from %'s format */ +#define USING_MARIADB_SNPRINTF_EXTENSIONS #include "client_priv.h" #include <m_ctype.h> @@ -581,6 +583,7 @@ static int process_selected_tables(char *db, char **table_names, int tables) my_free(table_names_comma_sep); } else + { for (; tables > 0; tables--, table_names++) { table= *table_names; @@ -590,6 +593,7 @@ static int process_selected_tables(char *db, char **table_names, int tables) continue; handle_request_for_tables(table, table_len, view == 1, opt_all_in_1); } + } DBUG_RETURN(0); } /* process_selected_tables */ @@ -909,16 +913,29 @@ static int handle_request_for_tables(char *tables, size_t length, } break; case DO_ANALYZE: + if (view) + { + printf("%-50s %s\n", tables, "Can't run anaylyze on a view"); + DBUG_RETURN(1); + } DBUG_ASSERT(!view); op= (opt_write_binlog) ? "ANALYZE" : "ANALYZE NO_WRITE_TO_BINLOG"; if (opt_persistent_all) end = strmov(end, " PERSISTENT FOR ALL"); break; case DO_OPTIMIZE: - DBUG_ASSERT(!view); + if (view) + { + printf("%-50s %s\n", tables, "Can't run optimize on a view"); + DBUG_RETURN(1); + } op= (opt_write_binlog) ? "OPTIMIZE" : "OPTIMIZE NO_WRITE_TO_BINLOG"; break; case DO_FIX_NAMES: - DBUG_ASSERT(!view); + if (view) + { + printf("%-50s %s\n", tables, "Can't run fix names on a view"); + DBUG_RETURN(1); + } DBUG_RETURN(fix_table_storage_name(tables)); } diff --git a/client/mysqltest.cc b/client/mysqltest.cc index e2fe43645f8..b8a7673996a 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -1606,7 +1606,7 @@ static void make_error_message(char *buf, size_t len, const char *fmt, va_list a fmt= "unknown error"; s+= my_vsnprintf(s, end - s, fmt, args); - s+= my_snprintf(s, end -s, "\n", start_lineno); + s+= my_snprintf(s, end -s, "\n"); } void die(const char *fmt, ...) |