Documentation Home
MySQL Internals Manual
Download this Manual
EPUB - 0.8Mb


4.6.7 Interface to Third-Party Tools

Previously, third-party tools that need to determine the MySQL version from the MySQL source read the configure.in file in the top-level source directory. For example, the AC_INIT line for MySQL 5.5.7-rc looked like this:

AC_INIT([MySQL Server], [5.5.7-rc], [], [mysql])

Such tools now can read the VERSION file. For example, if the version is MySQL 5.7.4-m14, the file looks like this:

MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=7
MYSQL_VERSION_PATCH=4
MYSQL_VERSION_EXTRA=-m14

If the source is not for a General Availablility (GA) release, the MYSQL_VERSION_EXTRA value will be nonempty. For the example, the value corresponds to Milestone 14.

To construct a five-digit number from the version components, use this formula:

MYSQL_VERSION_MAJOR*10000 + MYSQL_VERSION_MINOR*100 + MYSQL_VERSION_PATCH

User Comments
Sign Up Login You must be logged in to post a comment.