List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:December 24 1999 5:02pm
Subject:Re: MYSQL_VERSION_ID in mysql_version.h
View as plain text  
At 10:32 PM -0700 1999-12-23, Sasha Pachev wrote:
>Jamu Kakar wrote:
>>
>>  Hello,
>>  I'm writing a small program to check whether the current version 
>>of the MySQL libraries match the version I require.  I'm getting 
>>the current version from the #define's in mysql_version.h.  My 
>>question is: Can I depend on new versions of mysql_version.h to 
>>provide a MYSQL_VERSION_ID that is bigger than any older versions. 
>>Also, what would MYSQL_VERSION_ID look like for a beta release 
>>[where the version would be similar to #.##.##-beta]?
>>
>>  For reference, mysql_version.h (I'm using version 3.22.27) 
>>#define's the following:
>>
>>  #define MYSQL_SERVER_VERSION    "3.22.27"
>>  #define FRM_VER                 6
>>  #define MYSQL_VERSION_ID        32227
>>
>
>  > Basically, I want to avoid having to break apart 
>MYSQL_SERVER_VERSION if I can just do a simple if MYSQL_VERSION_ID 
><= VersionRequired comparison.
>>
>>  Thanks,
>>  Jamu.
>>  --
>>  Aikido- the art of unity with the ground.
>>
>
>Well, it's funny you asked. I guess we could keep it that way in the
>future versions. Monty, what do you say -- anything against it?


Why is that a problem?  I thought that's how MYSQL_VERSION_ID was intended
to be used all along.  However, to be safe, you need a slightly more
complicated test if you also want to be able to compile against possibly
really old MySQL headers in which MySQL_VERSION_ID isn't defined after
all:

#if (defined(MYSQL_VERSION_ID))  &&  (MYSQL_VERSION_ID >= VersionRequired)


(I think you want ">=", not "<=", don't you, Jamu?)

-- 
Paul DuBois, paul@stripped
Thread
MYSQL_VERSION_ID in mysql_version.hJamu Kakar24 Dec
  • Re: MYSQL_VERSION_ID in mysql_version.hSasha Pachev24 Dec
    • Re: MYSQL_VERSION_ID in mysql_version.hPaul DuBois24 Dec
    • Re: MYSQL_VERSION_ID in mysql_version.hMichael Widenius26 Jan