diff options
author | Jim Winstead <jimw@mysql.com> | 2009-05-18 14:19:18 -0700 |
---|---|---|
committer | Jim Winstead <jimw@mysql.com> | 2009-05-18 14:19:18 -0700 |
commit | 1f6fa46b7a3fc8564ab552b1b01aff04483df68a (patch) | |
tree | d25314d92832cbd8dec2fd023a35f4b33708bd54 /client/mysqladmin.cc | |
parent | 7117ee8ccc9e7bbac876871cb3bf31019a882b4c (diff) | |
download | mariadb-git-1f6fa46b7a3fc8564ab552b1b01aff04483df68a.tar.gz |
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.
Diffstat (limited to 'client/mysqladmin.cc')
-rw-r--r-- | client/mysqladmin.cc | 5 |
1 files changed, 4 insertions, 1 deletions
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 <mysql.h> #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 |