Bug #30127 mysql --debug-info no longer prints memory usage
Submitted: 30 Jul 2007 18:31 Modified: 8 Aug 2007 16:30
Reporter: Paul DuBois Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: Michael Widenius CPU Architecture:Any

[30 Jul 2007 18:31] Paul DuBois
Description:
Before MySQL 5.1.14, the --debug-info/-T option had two effects:

- Display memory usage information at exit time
- Display column metadata for query results

In 5.1.14, the metadata effect was split out from --debug-info and enabled by a separate option, --column-type-info.

However, the memory usage information part of --debug-info got busted and that information no longer is displayed.

How to repeat:
% /var/mysql/50113/bin/mysql --debug-info -e "quit"

User time 0.00, System time 0.00
Maximum resident set size 0, Integral resident set size 0
Non-physical pagefaults 648, Physical pagefaults 2, Swaps 0
Blocks in 0 out 0, Messages in 0 out 0, Signals 0
Voluntary context switches 8, Involuntary context switches 4
Maximum memory usage: 52365 bytes (52k)

~% /var/mysql/50114/bin/mysql --debug-info -e "quit"
(no output)
[30 Jul 2007 18:36] MySQL Verification Team
Thank you for the bug report.
[30 Jul 2007 18:59] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/31845

ChangeSet@1.2557, 2007-07-30 21:58:33+03:00, monty@mysql.com +10 -0
  --debug-info now prints memory usage for all C & C++ clients
  Fixes Bug#30127: --debug-info no longer prints memory usage in mysql
[31 Jul 2007 20:44] Timothy Smith
See also bug #29457, which is related and should be fixed at the same time.  There is a patch on 29457 which makes 'mysql -T' do what people expect (print column type info).
[1 Aug 2007 20:00] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/31979

ChangeSet@1.2557, 2007-08-01 22:59:05+03:00, monty@mysql.com +24 -0
  Fixes Bug#30127: --debug-info no longer prints memory usage in mysql
  Fixed compiler warnings, errors and link errors
  Fixed new bug on Solaris with gethrtime()
  Added --debug-check option to all mysql clients to print errors and memory leaks
  Added --debug-info to all clients. This now works as --debug-check but also prints memory and cpu usage
[6 Aug 2007 18:13] Bugs System
Pushed into 5.1.21-beta
[6 Aug 2007 21:07] Timothy Smith
The following clients now accept both --debug-info and --debug-check:
- mysql
- mysqldump
- mysqlcheck
- mysql_upgrade
- mysqladmin
- mysqlbinlog
- mysqlimport
- mysqlshow
- mysqlslap
- mysqltest

mysql-test-run.pl now calls --debug-check instead of --debug-info when calling clients, so the client doesn't generate extra output unless there is an error (such as a memory leak).

And, now mysql --debug-info does print status information at when the client quits.  This had been removed in a previous bug fix (it was behaving like the new --debug-check option).
[8 Aug 2007 16:30] Paul DuBois
Noted in 5.1.21 changelog.

Several programs now accept --debug-check and --debug-info options:
mysql, mysqladmin, mysqlbinlog, mysqlcheck, mysqldump, mysqlimport,
mysqlshow, mysqlslap, mysqltest, mysql_upgrade. (Note: mysql and
mysqltest already accepted --debug-info.) --debug-check prints
debugging information at program exit. --debug-info is similar but
also prints memory and CPU usage statistics. This patch also corrects
a problem for mysql that --debug-info did not display statistics at
exit time.