summaryrefslogtreecommitdiff
path: root/innobase/ut
diff options
context:
space:
mode:
authorheikki@hundin.mysql.fi <>2003-11-03 19:11:09 +0200
committerheikki@hundin.mysql.fi <>2003-11-03 19:11:09 +0200
commit1796d50df339574b8f09ac018f0d44dd3eaf1580 (patch)
tree16d8e94df9055bb6ed7e41eb7afbcdebf5b61236 /innobase/ut
parent06161760ce9e53778f18f48e9b065c47e1ad2fbf (diff)
downloadmariadb-git-1796d50df339574b8f09ac018f0d44dd3eaf1580.tar.gz
Many files:
Merge with ibbackup; bug fix: .ibd files were extended 2 x the required amount; InnoDB does not create the small file inno_arch_log... any more at database creation
Diffstat (limited to 'innobase/ut')
-rw-r--r--innobase/ut/ut0rnd.c3
-rw-r--r--innobase/ut/ut0ut.c46
2 files changed, 46 insertions, 3 deletions
diff --git a/innobase/ut/ut0rnd.c b/innobase/ut/ut0rnd.c
index 3335861384f..85d2e6094c3 100644
--- a/innobase/ut/ut0rnd.c
+++ b/innobase/ut/ut0rnd.c
@@ -71,9 +71,8 @@ ut_find_prime(
/* Found a prime */
break;
- next_n: ;
+next_n: ;
}
return(n);
}
-
diff --git a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c
index be311764261..f3be1a082a2 100644
--- a/innobase/ut/ut0ut.c
+++ b/innobase/ut/ut0ut.c
@@ -63,7 +63,7 @@ ut_get_high32(
}
/************************************************************
-The following function returns a clock time in milliseconds. */
+The following function returns elapsed CPU time in milliseconds. */
ulint
ut_clock(void)
@@ -182,6 +182,50 @@ ut_sprintf_timestamp(
}
/**************************************************************
+Sprintfs a timestamp to a buffer with no spaces and with ':' characters
+replaced by '_'. */
+
+void
+ut_sprintf_timestamp_without_extra_chars(
+/*=====================================*/
+ char* buf) /* in: buffer where to sprintf */
+{
+#ifdef __WIN__
+ SYSTEMTIME cal_tm;
+
+ GetLocalTime(&cal_tm);
+
+ sprintf(buf, "%02d%02d%02d_%2d_%02d_%02d",
+ (int)cal_tm.wYear % 100,
+ (int)cal_tm.wMonth,
+ (int)cal_tm.wDay,
+ (int)cal_tm.wHour,
+ (int)cal_tm.wMinute,
+ (int)cal_tm.wSecond);
+#else
+ struct tm cal_tm;
+ struct tm* cal_tm_ptr;
+ time_t tm;
+
+ time(&tm);
+
+#ifdef HAVE_LOCALTIME_R
+ localtime_r(&tm, &cal_tm);
+ cal_tm_ptr = &cal_tm;
+#else
+ cal_tm_ptr = localtime(&tm);
+#endif
+ sprintf(buf, "%02d%02d%02d_%2d_%02d_%02d",
+ cal_tm_ptr->tm_year % 100,
+ cal_tm_ptr->tm_mon + 1,
+ cal_tm_ptr->tm_mday,
+ cal_tm_ptr->tm_hour,
+ cal_tm_ptr->tm_min,
+ cal_tm_ptr->tm_sec);
+#endif
+}
+
+/**************************************************************
Returns current year, month, day. */
void