Bug #20246 enum mysql_enum_shutdown_level not well-defined in mysql_com.h
Submitted: 3 Jun 2006 15:08 Modified: 2 Feb 2007 3:00
Reporter: Christian Hammers (Silver Quality Contributor) (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.1-BK, 5.0.23-BK, 4.1-BK OS:Linux (Debian GNU/Linux)
Assigned to: Jay Pipes CPU Architecture:Any

[3 Jun 2006 15:08] Christian Hammers
Description:
As reported as Debian bug http://bugs.debian.org/369798 by
Thiemo Nagel <tnagel@e18.physik.tu-muenchen.de>:

MYSQL_VERSION_ID is tested before it has been defined.  This leads to
a warning when compiling with -Wundef and it also will break the
internal logic of mysql_com.h as soon as MYSQL_VERSION_ID exceeds
50000.

How to repeat:
-

Suggested fix:
The problem is fixed with the following patch:

--- mysql.h.old 2006-06-01 13:35:20.000000000 +0200
+++ mysql.h     2006-06-01 13:35:37.000000000 +0200
@@ -54,9 +54,9 @@
 #endif /* my_socket_defined */
 #endif /* _global_h */

+#include "mysql_version.h"
 #include "mysql_com.h"
 #include "mysql_time.h"
-#include "mysql_version.h"
 #include "typelib.h"

 #include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */
[3 Jun 2006 15:34] Valeriy Kravchuk
Thank you for a problem report and patch suggested. mysql.h in latest 5.1.12-BK, 5.0.23-BK, 4.1.21-BK still has:

#include "mysql_com.h"
#include "mysql_time.h"
#include "mysql_version.h"
#include "typelib.h"

and mysql_com.h still uses MYSQL_VERSION_ID defined in mysql_version.h. This should be fixed.
[7 Dec 2006 0:13] 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/16564

ChangeSet@1.2581, 2006-12-06 19:13:00-05:00, jpipes@shakedown.(none) +1 -0
  Fix for Bug #20246 (enum mysql_enum_shutdown_level not well-defined in mysql_com.h)
  
  A simple re-ordering of included files sufficed.
[31 Jan 2007 19:14] Chad MILLER
Available in 5.0.36, 5.1.15-beta.
[2 Feb 2007 3:00] Paul DuBois
No changelog entry needed.