Merge lp:~vkolesnikov/pbxt/pbxt-xtstat-windows into lp:pbxt

Proposed by Vladimir Kolesnikov
Status: Merged
Merged at revision: not available
Proposed branch: lp:~vkolesnikov/pbxt/pbxt-xtstat-windows
Merge into: lp:pbxt
Diff against target: None lines
To merge this branch: bzr merge lp:~vkolesnikov/pbxt/pbxt-xtstat-windows
Reviewer Review Type Date Requested Status
PBXT Core Pending
Review via email: mp+9425@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Vladimir Kolesnikov (vkolesnikov) wrote :

we will need to update our web-site documentation to mention xtstat's CMakeLists.txt file

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2009-07-22 08:35:24 +0000
3+++ ChangeLog 2009-07-28 14:28:57 +0000
4@@ -3,6 +3,8 @@
5
6 ------- 1.0.09 RC2 - Not released yet
7
8+RN260: Updated xtstat to compile on Windows/MS Visual C++
9+
10 RN259: Fixed bug 377788: Cannot find index for FK, fixed buffer overflow
11
12 RN258: updated xt_p_join implementation for Windows to check if a thread has already exited or has not yet started
13
14=== added file 'bin/CMakeLists.txt'
15--- bin/CMakeLists.txt 1970-01-01 00:00:00 +0000
16+++ bin/CMakeLists.txt 2009-07-29 12:56:00 +0000
17@@ -0,0 +1,34 @@
18+# Copyright (c) 2008 PrimeBase Technologies GmbH
19+#
20+# PrimeBase XT
21+#
22+# This program is free software; you can redistribute it and/or modify
23+# it under the terms of the GNU General Public License as published by
24+# the Free Software Foundation; either version 2 of the License, or
25+# (at your option) any later version.
26+#
27+# This program is distributed in the hope that it will be useful,
28+# but WITHOUT ANY WARRANTY; without even the implied warranty of
29+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30+# GNU General Public License for more details.
31+#
32+# You should have received a copy of the GNU General Public License
33+# along with this program; if not, write to the Free Software
34+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35+#
36+# 2006-03-22 Paul McCullagh
37+#
38+# H&G2JCtL
39+#
40+# This file is used to make the Windows version
41+
42+SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DDEBUG")
43+SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DDEBUG")
44+
45+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
46+ ${CMAKE_SOURCE_DIR}/storage/pbxt/src)
47+
48+SET(PBXTSTAT_SOURCES xtstat_xt.cc)
49+
50+ADD_EXECUTABLE(xtstat_xt ${PBXTSTAT_SOURCES})
51+TARGET_LINK_LIBRARIES(xtstat_xt mysqlclient_notls wsock32 pbxt)
52
53=== modified file 'bin/xtstat_xt.cc'
54--- bin/xtstat_xt.cc 2008-12-22 14:29:21 +0000
55+++ bin/xtstat_xt.cc 2009-07-28 14:28:57 +0000
56@@ -95,6 +95,10 @@
57 { OPT_NONE, 0, NULL, 0, NULL, 0, false }
58 };
59
60+#ifdef XT_WIN
61+#define atoll _atoi64
62+#endif
63+
64 void add_statistic(int stat)
65 {
66 /* Check if column has already been added: */
67@@ -741,19 +745,17 @@
68 else if (meta->sm_flags & XT_STAT_PERCENTAGE) {
69 double perc = 100;
70 switch (stat) {
71- case XT_STAT_REC_CACHE_USAGE: perc = record_cache_size; break;
72- case XT_STAT_IND_CACHE_USAGE: perc = index_cache_size; break;
73- case XT_STAT_XLOG_CACHE_USAGE: perc = log_cache_size; break;
74+ case XT_STAT_REC_CACHE_USAGE: perc = (double)record_cache_size; break;
75+ case XT_STAT_IND_CACHE_USAGE: perc = (double)index_cache_size; break;
76+ case XT_STAT_XLOG_CACHE_USAGE: perc = (double)log_cache_size; break;
77 }
78 format_percent_value(str_value, value, perc);
79 len = 4;
80 }
81 else if (meta->sm_flags & XT_STAT_DATE) {
82- time_t ticks = (time_t) value;
83- struct tm ltime;
84-
85- localtime_r(&ticks, &ltime);
86- strftime(str_value, 99, "%y%m%d %H:%M:%S", &ltime);
87+ time_t ticks = (time_t) value;
88+ const struct tm *ltime = localtime(&ticks);
89+ strftime(str_value, 99, "%y%m%d %H:%M:%S", ltime);
90 len = 15;
91 }
92 else if (meta->sm_flags & XT_STAT_BYTE_COUNT)

Subscribers

People subscribed via source and target branches