Commit eb29ce25 authored by Nirbhay Choubey's avatar Nirbhay Choubey

MDEV-3895 Version naming for MariaDB-Galera builds

This patch fixes both the reported issues :
(1) Included '-wsrep' to the server version information.

> select @@version;
+-----------------------------+
| @@version                   |
+-----------------------------+
| 5.5.33a-MariaDB-wsrep-debug |
+-----------------------------+

(2) The @@version_comment would no longer have XXXX
in the wsrep version information in case cmake couldn't
determine the current bzr revision.
parent 20afd6b1
# Copyright (c) 2011, Codership Oy <info@codership.com>. # Copyright (c) 2011, Codership Oy <info@codership.com>.
# Copyright (c) 2013, Monty Program Ab.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -19,20 +20,25 @@ ...@@ -19,20 +20,25 @@
# Set the patch version # Set the patch version
SET(WSREP_PATCH_VERSION "7.6") SET(WSREP_PATCH_VERSION "7.6")
# Obtain patch revision number # Obtain patch revision number:
# The script tries to probe the bzr revision number using $ENV{WSREP_REV}, and
# "bzr revno" if the WSREP_REV is not defined. In case both fail, the revision
# information is not appended to the wsrep patch version.
# 1: $ENV{WSREP_REV}
SET(WSREP_PATCH_REVNO $ENV{WSREP_REV}) SET(WSREP_PATCH_REVNO $ENV{WSREP_REV})
# 2: bzr revno
IF(NOT WSREP_PATCH_REVNO) IF(NOT WSREP_PATCH_REVNO)
EXECUTE_PROCESS( EXECUTE_PROCESS(
COMMAND bzr revno COMMAND bzr revno
OUTPUT_VARIABLE WSREP_PATCH_REVNO OUTPUT_VARIABLE WSREP_PATCH_REVNO
RESULT_VARIABLE RESULT RESULT_VARIABLE RESULT
) )
STRING(REGEX REPLACE "(\r?\n)+$" "" WSREP_PATCH_REVNO "${WSREP_PATCH_REVNO}") STRING(REGEX REPLACE "(\r?\n)+$" "" WSREP_PATCH_REVNO "${WSREP_PATCH_REVNO}")
#FILE(WRITE "wsrep_config" "Debug: WSREP_PATCH_REVNO result: ${RESULT}\n") #FILE(WRITE "wsrep_config" "Debug: WSREP_PATCH_REVNO result: ${RESULT}\n")
ENDIF() ENDIF()
IF(NOT WSREP_PATCH_REVNO)
SET(WSREP_PATCH_REVNO "XXXX")
ENDIF()
# Obtain wsrep API version # Obtain wsrep API version
EXECUTE_PROCESS( EXECUTE_PROCESS(
...@@ -43,9 +49,17 @@ EXECUTE_PROCESS( ...@@ -43,9 +49,17 @@ EXECUTE_PROCESS(
#FILE(WRITE "wsrep_config" "Debug: WSREP_API_VERSION result: ${RESULT}\n") #FILE(WRITE "wsrep_config" "Debug: WSREP_API_VERSION result: ${RESULT}\n")
STRING(REGEX REPLACE "(\r?\n)+$" "" WSREP_API_VERSION "${WSREP_API_VERSION}") STRING(REGEX REPLACE "(\r?\n)+$" "" WSREP_API_VERSION "${WSREP_API_VERSION}")
SET(WSREP_VERSION IF(NOT WSREP_PATCH_REVNO)
"${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}.r${WSREP_PATCH_REVNO}" MESSAGE(WARNING "Could not determine bzr revision number, WSREP_VERSION will "
) "not contain the revision number.")
SET(WSREP_VERSION
"${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}"
)
ELSE()
SET(WSREP_VERSION
"${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}.r${WSREP_PATCH_REVNO}"
)
ENDIF()
OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ON) OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ON)
IF (WITH_WSREP) IF (WITH_WSREP)
......
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. /* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
Copyright (c) 2008, 2012, Monty Program Ab Copyright (c) 2008, 2013, Monty Program Ab
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -8867,6 +8867,9 @@ void set_server_version(void) ...@@ -8867,6 +8867,9 @@ void set_server_version(void)
#ifdef EMBEDDED_LIBRARY #ifdef EMBEDDED_LIBRARY
end= strmov(end, "-embedded"); end= strmov(end, "-embedded");
#endif #endif
#ifdef WITH_WSREP
end= strmov(end, "-wsrep");
#endif
#ifndef DBUG_OFF #ifndef DBUG_OFF
if (!strstr(MYSQL_SERVER_SUFFIX_STR, "-debug")) if (!strstr(MYSQL_SERVER_SUFFIX_STR, "-debug"))
end= strmov(end, "-debug"); end= strmov(end, "-debug");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment