Bug #3758 VERSION needs to be correct for commercial windows builds
Submitted: 14 May 2004 8:43 Modified: 25 Aug 2004 20:00
Reporter: Patrick Galbraith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:4.0.20 OS:Any (all)
Assigned to: Bugs System CPU Architecture:Any

[14 May 2004 8:43] Patrick Galbraith
Description:
This is the email I sent to Brian that describes this issue:

I just committed a change to msyqld.cc that allows us to get the proper version string when one runs "show variables like 'version'"
If it's a commercial build, whatever executeable is being run under windows (mysqld-nt, mysqld-max, mysqld-max-nt all .exe) needs to have "-pro" appended. To get part of this working this was added on buildxp to get the value for "show variables like 'license'":

#ifndef LICENSE
#define LICENSE "GPL"
#endif /* LICENSE */

Having just looked at the way it currently is without that change:

#ifndef LICENSE
#define LICENSE "GPL"
#endif /* LICENSE */

Alas, my fix to mysqld.cc:

/* Set prefix for windows binary */
#ifdef __WIN__
#ifdef LICENSE
#define MYSQL_SERVER_SUFFIX "-pro"
#else
#undef MYSQL_SERVER_SUFFIX
#endif /* LICENSE */
#ifdef __NT__
#if defined(HAVE_BERKELEY_DB)
#ifdef LICENSE
#define MYSQL_SERVER_SUFFIX "-max-nt-pro"
#else
#define MYSQL_SERVER_SUFFIX "-max-nt"
#endif /* LICENSE */
#else
#ifdef LICENSE
#define MYSQL_SERVER_SUFFIX "-nt-pro"
#else
#define MYSQL_SERVER_SUFFIX "-nt"
#endif /* LICENSE */
#endif /* ...DB */
#elif defined(HAVE_BERKELEY_DB)
#ifdef LICENSE
#define MYSQL_SERVER_SUFFIX "-max-pro"
#else
#define MYSQL_SERVER_SUFFIX "-max"
#endif /* LICENSE */
#else
#define MYSQL_SERVER_SUFFIX ""
#endif /* __NT__ */
#endif /* __WIN__ */

I've realised this isn't going to work either, because LICENSE is always set!

We really need something more elegant and... better than this. How can "-pro" simply be appended to whatever value there is for MYSQL_SERVER_SUFFIX _if_ the LICENSE is 'Commercial' ? How can this be passed to the windows compiler? Also, it seems a lot of these pre-processor includes should _all_ be in the header file.

Do you have any thoughts on this, and how we can come to an elegant solution that will work in the long run? The whole purpose in all of this is to accomodate the changes needed for the authenticated libraries.

thanks much,

Patrick

-------------

It would be good to have all of this pre-processor logic at least in mysql_version.h. Even better, I'd like to know if there could be a way that this could all be set with a compiler option, and how I could set this option with the windows compiler.

How to repeat:
Simply compile the windows-ready sources without any modification to mysqld.cc or mysql_version.h (as they are currently in bk). If you run mysqld-max-nt.exe for instance, if you connect with the client and issue: "show variables like 'version'", you should get "mysql-max-nt-pro", but instead get "mysql-max-nt". "-pro" should be the last part of the version string for commercial builds to accomodate the upcoming authenticated libraries functionality (where the client will not connect if the version string is incorrect).
[25 Aug 2004 18:57] Brian Aker
Patrick, verify this has not been done already.
[25 Aug 2004 20:00] Patrick Galbraith
This was fixed in the project file for the windows build by Monty in June during the 4.0.20 and 4.1.2 build.