Commit e47296b9 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

have db_version return the svn revision number. closes #1502

git-svn-id: file:///svn/toku/tokudb@10193 c7de825b-a66e-492c-adef-691d508d4ae1
parent 7cae47df
...@@ -14,6 +14,10 @@ ydbtrace.o tdbtrace.o: tdbtrace.h ...@@ -14,6 +14,10 @@ ydbtrace.o tdbtrace.o: tdbtrace.h
include $(TOKUROOT)toku_include/Makefile.include include $(TOKUROOT)toku_include/Makefile.include
CPPFLAGS+=-D_GNU_SOURCE -D_THREAD_SAFE CPPFLAGS+=-D_GNU_SOURCE -D_THREAD_SAFE
ifneq ($(TOKUDB_REVISION),)
CPPFLAGS += -DTOKUDB_REVISION=$(TOKUDB_REVISION)
endif
YDB=ydb.$(AEXT) YDB=ydb.$(AEXT)
YDB_BUNDLE=ydb.bundle YDB_BUNDLE=ydb.bundle
TYDB=tydb.$(AEXT) TYDB=tydb.$(AEXT)
......
...@@ -17,7 +17,9 @@ test_main (int argc, const char *argv[]) { ...@@ -17,7 +17,9 @@ test_main (int argc, const char *argv[]) {
assert(major==DB_VERSION_MAJOR); assert(major==DB_VERSION_MAJOR);
assert(minor==DB_VERSION_MINOR); assert(minor==DB_VERSION_MINOR);
assert(patch==DB_VERSION_PATCH); assert(patch==DB_VERSION_PATCH);
if (verbose) if (verbose) {
printf("%d.%d.%d %s\n", major, minor, patch, v); printf("%d.%d.%d\n", major, minor, patch);
printf("%s\n", v);
}
return 0; return 0;
} }
...@@ -3544,7 +3544,13 @@ const char *db_version(int *major, int *minor, int *patch) { ...@@ -3544,7 +3544,13 @@ const char *db_version(int *major, int *minor, int *patch) {
*minor = DB_VERSION_MINOR; *minor = DB_VERSION_MINOR;
if (patch) if (patch)
*patch = DB_VERSION_PATCH; *patch = DB_VERSION_PATCH;
#if defined(TOKUDB_REVISION)
#define xstr(X) str(X)
#define str(X) #X
return "tokudb " xstr(DB_VERSION_MAJOR) "." xstr(DB_VERSION_MINOR) "." xstr(DB_VERSION_PATCH) " build " xstr(TOKUDB_REVISION);
#else
return DB_VERSION_STRING; return DB_VERSION_STRING;
#endif
} }
int db_env_set_func_fsync (int (*fsync_function)(int)) { int db_env_set_func_fsync (int (*fsync_function)(int)) {
......
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