Bug #59460 UNIV_DEBUG
Submitted: 13 Jan 2011 0:37 Modified: 30 Nov 2011 18:57
Reporter: Roel Van de Paar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: John Russell CPU Architecture:Any

[13 Jan 2011 0:37] Roel Van de Paar
Description:
http://dev.mysql.com/doc/refman/5.0/en/show-mutex-status.html
http://dev.mysql.com/doc/refman/5.1/en/show-engine.html
http://dev.mysql.com/doc/refman/5.5/en/show-engine.html

...if UNIV_DEBUG was defined at MySQL compilation time (for example, in include/univ.h in the InnoDB part of the MySQL source tree)...

There is no univ.h. Changes need to be made in univ.i. Maybe it would also be good to list the two full paths instead of "InnoDB part of the MySQL source tree" - i.e. \storage\innobase\include (built-in) and \storage\innodb_plugin\include (plugin) for 5.1.

Procedure:

====================
Please open the file "univ.i" - either for the (5.1) built-in InnoDB (\storage\innobase\include) and/or for the InnoDB plugin (\storage\innodb_plugin\include).

Then change the following:

==
#if 0
...
#define UNIV_DEBUG /* Enable ut_ad() assertions
and disable UNIV_INLINE */
...
#endif
==

To:

==
#define UNIV_DEBUG /* Enable ut_ad() assertions
and disable UNIV_INLINE */
#if 0
...
...
#endif
==

i.e. the UNIV_DEBUG line is moved out of the #if 0 block.

The above patch would work for 5.5 also (storage\innobase\include directory) though there is only the InnoDB plugin which is built-in - i.e. there is no difference between a "built in" and "plugin" InnoDB engine. 

Additionally, in 5.5 it may also be possible to use a cmake flag like -DUNIV_DEBUG:BOOL=TRUE or possibly -DUNIV_DEBUG=ON (for UNIV_DEBUG) or -DWITH_DEBUG=ON (but this will turn on all debugging) instead of editing univ.i. I have not verified these options though, InnoDB team may be able to provide more input.
====================

How to repeat:
Ref code/docs. Also some background info on UNIV_DEBUG in bug #36600.

Suggested fix:
Could we make a separate page for all UNIV_* options as listed in univ.i? This page can then be referred to from the aforementioned url's.
[13 Jan 2011 7:36] John Embretsen
See Bug#58279 for detailed info on how to enable UNIV_DEBUG in CMake builds on various platforms, as well as related issues with that.

More here: http://forge.mysql.com/wiki/CMake#Debug-only_options
[30 Nov 2011 18:57] John Russell
Corrected .h filename to .i.

Other suggestions about enhancing the doc for "compiling with debug" will be considered as a feature request by the doc group.
[30 Nov 2011 20:17] MySQL Verification Team
These days all debug binaries (mysqld-debug) have UNIV_DEBUG enabled. So why would we need to built it ourselves?  In the distant past, debug binaries didn't have it enabled iirc.

Now:
I:\mysql\5.5\5.5.18\mysql-5.5.18-win32\bin>mysqld-debug --console
111130 22:17:12 [Note] Plugin 'FEDERATED' is disabled.
111130 22:17:13 InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!
<cut>
[26 Apr 2013 18:08] Paul DuBois
Given Shane's comment, there's nothing to do here.