Skip to content
Permalink
Browse files
Merge branch 'merge-innodb-5.6' into 10.0
  • Loading branch information
cvicentiu committed Jan 24, 2018
2 parents d69d488 + 3dfe148 commit 3699a4b
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 11 deletions.
@@ -1,4 +1,4 @@
# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -489,3 +489,4 @@ MYSQL_ADD_PLUGIN(innobase ${INNOBASE_SOURCES} STORAGE_ENGINE
MODULE_OUTPUT_NAME ha_innodb
LINK_LIBRARIES ${ZLIB_LIBRARY} ${LINKER_SCRIPT})

ADD_DEPENDENCIES(innobase GenError)

This comment has been minimized.

Copy link
@Sp1l

Sp1l Feb 12, 2018

Contributor

This results in configure-errors when MariaDB is built without INNOBASE.
As far as I know, for 10.0 and 10.1, XtraDB is still the default InnoDB storage backend.

This comment has been minimized.

Copy link
@vuvova

vuvova Feb 12, 2018

Member

Thanks. Fixed in 8452351.

But better use Jira next time :)

This comment has been minimized.

Copy link
@Sp1l

Sp1l Feb 12, 2018

Contributor

I did :D

@@ -4761,9 +4761,17 @@ fts_process_token(
t_str.f_str = static_cast<byte*>(
mem_heap_alloc(heap, t_str.f_len));

newlen = innobase_fts_casedn_str(
doc->charset, (char*) str.f_str, str.f_len,
(char*) t_str.f_str, t_str.f_len);
/* For binary collations, a case sensitive search is
performed. Hence don't convert to lower case. */
if (my_binary_compare(result_doc->charset)) {
memcpy(t_str.f_str, str.f_str, str.f_len);
t_str.f_str[str.f_len]= 0;
newlen= str.f_len;
} else {
newlen = innobase_fts_casedn_str(
doc->charset, (char*) str.f_str, str.f_len,
(char*) t_str.f_str, t_str.f_len);
}

t_str.f_len = newlen;
t_str.f_str[newlen] = 0;
@@ -3763,10 +3763,19 @@ fts_query_str_preprocess(
str_len = query_len * charset->casedn_multiply + 1;
str_ptr = static_cast<byte*>(ut_malloc(str_len));

*result_len = innobase_fts_casedn_str(
charset, const_cast<char*>(reinterpret_cast<const char*>(
query_str)), query_len,
reinterpret_cast<char*>(str_ptr), str_len);
/* For binary collations, a case sensitive search is
performed. Hence don't convert to lower case. */
if (my_binary_compare(charset)) {
memcpy(str_ptr, query_str, query_len);
str_ptr[query_len]= 0;
*result_len= query_len;
} else {
*result_len = innobase_fts_casedn_str(
charset, const_cast<char*>
(reinterpret_cast<const char*>( query_str)),
query_len,
reinterpret_cast<char*>(str_ptr), str_len);
}

ut_ad(*result_len < str_len);

@@ -3643,6 +3643,14 @@ innobase_init(
/* Turn on monitor counters that are default on */
srv_mon_default_on();

#ifndef UNIV_HOTBACKUP
#ifdef _WIN32
if (ut_win_init_time()) {
goto mem_free_and_error;
}
#endif /* _WIN32 */
#endif /* !UNIV_HOTBACKUP */

DBUG_RETURN(FALSE);
error:
DBUG_RETURN(TRUE);
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1994, 2017, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -273,6 +273,15 @@ UNIV_INTERN
ulint
ut_time_ms(void);
/*============*/
#ifdef _WIN32
/**********************************************************//**
Initialise highest available time resolution API on Windows
@return 0 if all OK else -1 */
int
ut_win_init_time();

#endif /* _WIN32 */

#endif /* !UNIV_HOTBACKUP */

/**********************************************************//**
@@ -1,6 +1,6 @@
/*****************************************************************************
Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1994, 2017, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -49,13 +49,39 @@ 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;

/*****************************************************************//**
NOTE: The Windows epoch starts from 1601/01/01 whereas the Unix
epoch starts from 1970/1/1. For selection of constant see:
http://support.microsoft.com/kb/167296/ */
#define WIN_TO_UNIX_DELTA_USEC ((ib_int64_t) 11644473600000000ULL)


/**
Initialise highest available time resolution API on Windows
@return 0 if all OK else -1 */
int
ut_win_init_time()
{
HMODULE h = LoadLibrary("kernel32.dll");
if (h != NULL)
{
time_fn pfn = (time_fn)GetProcAddress(h, "GetSystemTimePreciseAsFileTime");
if (pfn != NULL)
{
ut_get_system_time_as_file_time = pfn;
}
return false;
}
DWORD error = GetLastError();
sql_print_error(
"LoadLibrary(\"kernel32.dll\") failed: GetLastError returns %lu", error);
return(-1);
}

/*****************************************************************//**
This is the Windows version of gettimeofday(2).
@return 0 if all OK else -1 */
@@ -74,7 +100,7 @@ ut_gettimeofday(
return(-1);
}

GetSystemTimeAsFileTime(&ft);
ut_get_system_time_as_file_time(&ft);

tm = (ib_int64_t) ft.dwHighDateTime << 32;
tm |= ft.dwLowDateTime;

0 comments on commit 3699a4b

Please sign in to comment.