From fa79a121e6bac2f86fcbfc6f3de46cac44f65e47 Mon Sep 17 00:00:00 2001 From: Mark Riddoch Date: Wed, 5 Feb 2014 11:29:20 +0100 Subject: [PATCH] Updated server version added to the prompt and in the log files. See Bugzilla bug 376. --- VERSION | 1 + server/core/Makefile | 8 ++++++-- server/core/gateway.c | 7 +++++-- server/modules/include/mysql_client_server_protocol.h | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..8f0916f76 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.5.0 diff --git a/server/core/Makefile b/server/core/Makefile index 48b657657..bd96df614 100644 --- a/server/core/Makefile +++ b/server/core/Makefile @@ -63,7 +63,7 @@ HDRS= ../include/atomic.h ../include/buffer.h ../include/dcb.h \ ../include/session.h ../include/spinlock.h ../include/thread.h \ ../include/modules.h ../include/poll.h ../include/config.h \ ../include/users.h ../include/hashtable.h ../include/gwbitmask.h \ - ../include/adminusers.h + ../include/adminusers.h ../include/version.h OBJ=$(SRCS:.c=.o) @@ -89,6 +89,10 @@ maxpasswd: $(POBJS) .c.o: $(CC) $(CFLAGS) $< -o $@ + +../include/version.h: ../../VERSION + echo '#define MAXSCALE_VERSION "'`cat ../../VERSION`'"' > ../include/version.h + clean: rm -f $(OBJ) maxscale - rm *.so @@ -96,7 +100,7 @@ clean: tags: ctags $(SRCS) $(HDRS) -depend: +depend: ../include/version.h @rm -f depend.mk cc -M $(CFLAGS) $(SRCS) > depend.mk diff --git a/server/core/gateway.c b/server/core/gateway.c index 53065de11..f5ea14056 100644 --- a/server/core/gateway.c +++ b/server/core/gateway.c @@ -34,6 +34,7 @@ * 28/06/13 Vilho Raatikka Added necessary headers, example functions and * calls to log manager and to query classifier. * Put example code behind SS_DEBUG macros. + * 05/02/14 Mark Riddoch Addition of version string * * @endverbatim */ @@ -53,6 +54,7 @@ #include #include #include +#include #include #include @@ -313,7 +315,7 @@ static bool file_write_header( *t = time(NULL); *tm = *localtime(t); - header_buf1 = "\n\nSkySQL MaxScale\t"; + header_buf1 = "\n\nSkySQL MaxScale " MAXSCALE_VERSION "\t"; header_buf2 = strdup(asctime(tm)); if (header_buf2 == NULL) { @@ -1294,7 +1296,8 @@ int main(int argc, char **argv) } LOGIF(LM, (skygw_log_write( LOGFILE_MESSAGE, - "SkySQL MaxScale (C) SkySQL Ab 2013"))); + "SkySQL MaxScale %s (C) SkySQL Ab 2013,2014", + MAXSCALE_VERSION))); LOGIF(LM, (skygw_log_write( LOGFILE_MESSAGE, "MaxScale is running in process %i", diff --git a/server/modules/include/mysql_client_server_protocol.h b/server/modules/include/mysql_client_server_protocol.h index 3cbd72849..e23519da3 100644 --- a/server/modules/include/mysql_client_server_protocol.h +++ b/server/modules/include/mysql_client_server_protocol.h @@ -49,9 +49,9 @@ #include #include #include +#include -#define GW_VERSION "0.1.0" -#define GW_MYSQL_VERSION "5.5.22-SKYSQL-" GW_VERSION +#define GW_MYSQL_VERSION "MaxScale " MAXSCALE_VERSION #define GW_MYSQL_LOOP_TIMEOUT 300000000 #define GW_MYSQL_READ 0 #define GW_MYSQL_WRITE 1