summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2018-01-25 11:33:34 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2018-01-25 11:34:56 +0200
commitf775ee6006846a22a24440c9012a09a3437f72d6 (patch)
treec0bdeaf2b03c57b729781d2fd974b2e53ef8a896 /storage
parent12c42bd2c77bd1cb8970d7991b28d7d2c0f81b9b (diff)
downloadmariadb-git-f775ee6006846a22a24440c9012a09a3437f72d6.tar.gz
Fix innodb compilation failure on Windows
We don't need to print an error when loading kernel32.dll. If we can't load it we'll automatically crash. Reviewed by wlad@mariadb.com
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/ha_innodb.cc4
-rw-r--r--storage/innobase/include/ut0ut.h7
-rw-r--r--storage/innobase/ut/ut0ut.cc24
3 files changed, 14 insertions, 21 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index e5abc4b7aee..3fdbf639dc2 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -3645,9 +3645,7 @@ innobase_change_buffering_inited_ok:
#ifndef UNIV_HOTBACKUP
#ifdef _WIN32
- if (ut_win_init_time()) {
- goto mem_free_and_error;
- }
+ ut_win_init_time();
#endif /* _WIN32 */
#endif /* !UNIV_HOTBACKUP */
diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h
index 918e8e5f350..7336ca87ce6 100644
--- a/storage/innobase/include/ut0ut.h
+++ b/storage/innobase/include/ut0ut.h
@@ -275,9 +275,10 @@ ut_time_ms(void);
/*============*/
#ifdef _WIN32
/**********************************************************//**
-Initialise highest available time resolution API on Windows
-@return 0 if all OK else -1 */
-int
+Initialise highest available time resolution API on Windows.
+Crashes if there's an error loading kernel32.dll.
+*/
+void
ut_win_init_time();
#endif /* _WIN32 */
diff --git a/storage/innobase/ut/ut0ut.cc b/storage/innobase/ut/ut0ut.cc
index cc0f31b0ad6..52e576279ae 100644
--- a/storage/innobase/ut/ut0ut.cc
+++ b/storage/innobase/ut/ut0ut.cc
@@ -49,7 +49,6 @@ Created 5/11/1994 Heikki Tuuri
UNIV_INTERN ibool ut_always_false = FALSE;
#ifdef __WIN__
-#include <mysql/innodb_priv.h> /* For sql_print_error */
typedef VOID(WINAPI *time_fn)(LPFILETIME);
static time_fn ut_get_system_time_as_file_time = GetSystemTimeAsFileTime;
@@ -61,25 +60,20 @@ http://support.microsoft.com/kb/167296/ */
/**
-Initialise highest available time resolution API on Windows
-@return 0 if all OK else -1 */
-int
+Initialise highest available time resolution API on Windows.
+Crashes if there's an error loading kernel32.dll.
+*/
+void
ut_win_init_time()
{
HMODULE h = LoadLibrary("kernel32.dll");
- if (h != NULL)
+ ut_a(h);
+ time_fn pfn = (time_fn)GetProcAddress(h, "GetSystemTimePreciseAsFileTime");
+ if (pfn != NULL)
{
- time_fn pfn = (time_fn)GetProcAddress(h, "GetSystemTimePreciseAsFileTime");
- if (pfn != NULL)
- {
- ut_get_system_time_as_file_time = pfn;
- }
- return false;
+ ut_get_system_time_as_file_time = pfn;
}
- DWORD error = GetLastError();
- sql_print_error(
- "LoadLibrary(\"kernel32.dll\") failed: GetLastError returns %lu", error);
- return(-1);
+ return;
}
/*****************************************************************//**