From 1f6fa46b7a3fc8564ab552b1b01aff04483df68a Mon Sep 17 00:00:00 2001 From: Jim Winstead Date: Mon, 18 May 2009 14:19:18 -0700 Subject: mysqladmin did not have enough space allocated for tracking all variables when using --vertical or --relative with extended-status. (Bug #40395) This patch simply increases the buffer size and adds an assert to check that it is big enough -- a more comprehensive fix would dynamically allocate the appropriate buffers. --- client/mysqladmin.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'client/mysqladmin.cc') diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 9865b67bb3b..09821d6a995 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -24,7 +24,7 @@ #include #define ADMIN_VERSION "8.42" -#define MAX_MYSQL_VAR 256 +#define MAX_MYSQL_VAR 512 #define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */ #define MAX_TRUNC_LENGTH 3 @@ -743,6 +743,9 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) mysql_error(mysql)); return -1; } + + DBUG_ASSERT(mysql_num_rows(res) < MAX_MYSQL_VAR); + if (!opt_vertical) print_header(res); else -- cgit v1.2.1