summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-06-27 17:54:47 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-06-27 17:54:47 +0300
commitb7b0bc8f11c7cbbc690fa9b704ab3b0f62a77785 (patch)
treeb61eb8fc52031d2cd0cf2f05261dc5d80f7317fb
parentbb702c2e4c24632678b548ee1515c6a5b8173808 (diff)
parentf5c080c7353cc9c30d0b269c07024cd38253c3bc (diff)
downloadmariadb-git-b7b0bc8f11c7cbbc690fa9b704ab3b0f62a77785.tar.gz
Merge 10.3 into 10.4
We omit the work-around commit 0b7fa5a05deecaf52207f00bb02b5c6b460abb11 because it appears to be needed for CentOS 6 only, which we no longer support.
-rw-r--r--client/mysqldump.c6
-rw-r--r--config.h.cmake2
-rw-r--r--configure.cmake26
-rw-r--r--include/my_cpu.h54
-rw-r--r--mysql-test/main/mysqldump-compat-102.opt1
-rw-r--r--mysql-test/main/mysqldump-compat-102.result110
-rw-r--r--mysql-test/main/mysqldump-compat-102.test83
-rw-r--r--mysys/CMakeLists.txt2
-rw-r--r--mysys/my_cpu.c82
-rw-r--r--sql/mysqld.cc1
-rw-r--r--sql/semisync_master_ack_receiver.h4
-rw-r--r--storage/innobase/include/ib0mutex.h6
-rw-r--r--storage/innobase/include/ut0ut.h17
-rw-r--r--storage/innobase/ut/ut0ut.cc23
14 files changed, 330 insertions, 87 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 38db869c7ac..578bb0a067c 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -2513,7 +2513,9 @@ static uint dump_routines_for_db(char *db)
char db_cl_name[MY_CS_NAME_SIZE];
int db_cl_altered= FALSE;
-
+ // before 10.3 packages are not supported
+ uint upper_bound= mysql_get_server_version(mysql) >= 100300 ?
+ array_elements(routine_type) : 2;
DBUG_ENTER("dump_routines_for_db");
DBUG_PRINT("enter", ("db: '%s'", db));
@@ -2543,7 +2545,7 @@ static uint dump_routines_for_db(char *db)
fputs("\t<routines>\n", sql_file);
/* 0, retrieve and dump functions, 1, procedures, etc. */
- for (i= 0; i < array_elements(routine_type); i++)
+ for (i= 0; i < upper_bound; i++)
{
my_snprintf(query_buff, sizeof(query_buff),
"SHOW %s STATUS WHERE Db = '%s'",
diff --git a/config.h.cmake b/config.h.cmake
index 78fe1d9498f..22509b2cf93 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -186,8 +186,6 @@
#cmakedefine HAVE_POSIX_FALLOCATE 1
#cmakedefine HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE 1
#cmakedefine HAVE_PREAD 1
-#cmakedefine HAVE_PAUSE_INSTRUCTION 1
-#cmakedefine HAVE_FAKE_PAUSE_INSTRUCTION 1
#cmakedefine HAVE_RDTSCLL 1
#cmakedefine HAVE_READ_REAL_TIME 1
#cmakedefine HAVE_PTHREAD_ATTR_CREATE 1
diff --git a/configure.cmake b/configure.cmake
index 50900d10a6a..07cf752d495 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -753,32 +753,6 @@ IF(NOT C_HAS_inline)
ENDIF()
ENDIF()
-IF(NOT CMAKE_CROSSCOMPILING AND NOT MSVC)
- STRING(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} processor)
- IF(processor MATCHES "86" OR processor MATCHES "amd64" OR processor MATCHES "x64")
- #Check for x86 PAUSE instruction
- # We have to actually try running the test program, because of a bug
- # in Solaris on x86_64, where it wrongly reports that PAUSE is not
- # supported when trying to run an application. See
- # http://bugs.opensolaris.org/bugdatabase/printableBug.do?bug_id=6478684
- CHECK_C_SOURCE_RUNS("
- int main()
- {
- __asm__ __volatile__ (\"pause\");
- return 0;
- }" HAVE_PAUSE_INSTRUCTION)
- ENDIF()
- IF (NOT HAVE_PAUSE_INSTRUCTION)
- CHECK_C_SOURCE_COMPILES("
- int main()
- {
- __asm__ __volatile__ (\"rep; nop\");
- return 0;
- }
- " HAVE_FAKE_PAUSE_INSTRUCTION)
- ENDIF()
-ENDIF()
-
CHECK_SYMBOL_EXISTS(tcgetattr "termios.h" HAVE_TCGETATTR 1)
#
diff --git a/include/my_cpu.h b/include/my_cpu.h
index b5665fc108c..0e37eafe60e 100644
--- a/include/my_cpu.h
+++ b/include/my_cpu.h
@@ -46,10 +46,20 @@
#define HMT_high()
#endif
+#if defined __i386__ || defined __x86_64__ || defined _WIN32
+# define HAVE_PAUSE_INSTRUCTION /* added in Intel Pentium 4 */
+#endif
static inline void MY_RELAX_CPU(void)
{
-#ifdef HAVE_PAUSE_INSTRUCTION
+#ifdef _WIN32
+ /*
+ In the Win32 API, the x86 PAUSE instruction is executed by calling
+ the YieldProcessor macro defined in WinNT.h. It is a CPU architecture-
+ independent way by using YieldProcessor.
+ */
+ YieldProcessor();
+#elif defined HAVE_PAUSE_INSTRUCTION
/*
According to the gcc info page, asm volatile means that the
instruction has important side-effects and must not be removed.
@@ -61,16 +71,6 @@ static inline void MY_RELAX_CPU(void)
#else
__asm__ __volatile__ ("pause");
#endif
-
-#elif defined(HAVE_FAKE_PAUSE_INSTRUCTION)
- __asm__ __volatile__ ("rep; nop");
-#elif defined _WIN32
- /*
- In the Win32 API, the x86 PAUSE instruction is executed by calling
- the YieldProcessor macro defined in WinNT.h. It is a CPU architecture-
- independent way by using YieldProcessor.
- */
- YieldProcessor();
#elif defined(_ARCH_PWR8)
__ppc_get_timebase();
#else
@@ -81,6 +81,20 @@ static inline void MY_RELAX_CPU(void)
}
+#ifdef HAVE_PAUSE_INSTRUCTION
+# ifdef __cplusplus
+extern "C" {
+# endif
+extern unsigned my_cpu_relax_multiplier;
+void my_cpu_init(void);
+# ifdef __cplusplus
+}
+# endif
+#else
+# define my_cpu_relax_multiplier 200
+# define my_cpu_init() /* nothing */
+#endif
+
/*
LF_BACKOFF should be used to improve performance on hyperthreaded CPUs. Intel
recommends to use it in spin loops also on non-HT machines to reduce power
@@ -94,9 +108,23 @@ static inline void MY_RELAX_CPU(void)
static inline int LF_BACKOFF(void)
{
- int i;
- for (i= 0; i < 200; i++)
+ unsigned i= my_cpu_relax_multiplier;
+ while (i--)
MY_RELAX_CPU();
return 1;
}
+
+/**
+ Run a delay loop while waiting for a shared resource to be released.
+ @param delay originally, roughly microseconds on 100 MHz Intel Pentium
+*/
+static inline void ut_delay(unsigned delay)
+{
+ unsigned i= my_cpu_relax_multiplier / 4 * delay;
+ HMT_low();
+ while (i--)
+ MY_RELAX_CPU();
+ HMT_medium();
+}
+
#endif
diff --git a/mysql-test/main/mysqldump-compat-102.opt b/mysql-test/main/mysqldump-compat-102.opt
new file mode 100644
index 00000000000..d309bba8e76
--- /dev/null
+++ b/mysql-test/main/mysqldump-compat-102.opt
@@ -0,0 +1 @@
+-V10.2.1-MariaDB
diff --git a/mysql-test/main/mysqldump-compat-102.result b/mysql-test/main/mysqldump-compat-102.result
new file mode 100644
index 00000000000..aa8fe5a4de3
--- /dev/null
+++ b/mysql-test/main/mysqldump-compat-102.result
@@ -0,0 +1,110 @@
+#
+# MDEV-17429 mysqldump uses 10.3 options with pre-10.3 servers and breaks
+#
+SELECT @@version;
+@@version
+10.2.1-MariaDB
+SET sql_mode=ORACLE;
+CREATE DATABASE db1_mdev17429;
+USE db1_mdev17429;
+CREATE PROCEDURE p1(a INT)
+AS BEGIN
+NULL;
+END;
+$$
+CREATE OR REPLACE PACKAGE employee_tools AS
+FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);
+PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));
+PROCEDURE raiseSalaryStd(eid INT);
+PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));
+END;
+$$
+CREATE PACKAGE BODY employee_tools AS
+-- package body variables
+stdRaiseAmount DECIMAL(10,2):=500;
+-- private routines
+PROCEDURE log (eid INT, ecmnt TEXT) AS
+BEGIN
+INSERT INTO employee_log (id, cmnt) VALUES (eid, ecmnt);
+END;
+-- public routines
+PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2)) AS
+eid INT;
+BEGIN
+INSERT INTO employee (name, salary) VALUES (ename, esalary);
+eid:= last_insert_id();
+log(eid, 'hire ' || ename);
+END;
+FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2) AS
+nSalary DECIMAL(10,2);
+BEGIN
+SELECT salary INTO nSalary FROM employee WHERE id=eid;
+log(eid, 'getSalary id=' || eid || ' salary=' || nSalary);
+RETURN nSalary;
+END;
+PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2)) AS
+BEGIN
+UPDATE employee SET salary=salary+amount WHERE id=eid;
+log(eid, 'raiseSalary id=' || eid || ' amount=' || amount);
+END;
+PROCEDURE raiseSalaryStd(eid INT) AS
+BEGIN
+raiseSalary(eid, stdRaiseAmount);
+log(eid, 'raiseSalaryStd id=' || eid);
+END;
+BEGIN
+-- This code is executed when the current session
+-- accesses any of the package routines for the first time
+log(0, 'Session ' || connection_id() || ' ' || current_user || ' started');
+END;
+$$
+-- MariaDB dump DUMPVERSION Distrib DISTVERSION, for OS
+--
+-- Host: localhost Database: db1_mdev17429
+-- ------------------------------------------------------
+-- Server version 10.2.1-MariaDB
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8mb4 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Dumping routines for database 'db1_mdev17429'
+--
+/*!50003 DROP PROCEDURE IF EXISTS `p1` */;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = 'PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT' */ ;
+DELIMITER ;;
+CREATE DEFINER="root"@"localhost" PROCEDURE "p1"(a INT)
+AS BEGIN
+NULL;
+END ;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+-- Dump completed on TIMESTAMP
+DROP DATABASE db1_mdev17429;
+SET sql_mode=DEFAULT;
diff --git a/mysql-test/main/mysqldump-compat-102.test b/mysql-test/main/mysqldump-compat-102.test
new file mode 100644
index 00000000000..27c1dfcb6ce
--- /dev/null
+++ b/mysql-test/main/mysqldump-compat-102.test
@@ -0,0 +1,83 @@
+# Embedded server doesn't support external clients
+--source include/not_embedded.inc
+
+--echo #
+--echo # MDEV-17429 mysqldump uses 10.3 options with pre-10.3 servers and breaks
+--echo #
+
+# Make sure the server reports itself as 10.2.1-MariaDB
+SELECT @@version;
+
+SET sql_mode=ORACLE;
+CREATE DATABASE db1_mdev17429;
+USE db1_mdev17429;
+
+DELIMITER $$;
+
+CREATE PROCEDURE p1(a INT)
+AS BEGIN
+ NULL;
+END;
+$$
+
+CREATE OR REPLACE PACKAGE employee_tools AS
+ FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2);
+ PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2));
+ PROCEDURE raiseSalaryStd(eid INT);
+ PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2));
+END;
+$$
+CREATE PACKAGE BODY employee_tools AS
+ -- package body variables
+ stdRaiseAmount DECIMAL(10,2):=500;
+
+ -- private routines
+ PROCEDURE log (eid INT, ecmnt TEXT) AS
+ BEGIN
+ INSERT INTO employee_log (id, cmnt) VALUES (eid, ecmnt);
+ END;
+
+ -- public routines
+ PROCEDURE hire(ename TEXT, esalary DECIMAL(10,2)) AS
+ eid INT;
+ BEGIN
+ INSERT INTO employee (name, salary) VALUES (ename, esalary);
+ eid:= last_insert_id();
+ log(eid, 'hire ' || ename);
+ END;
+
+ FUNCTION getSalary(eid INT) RETURN DECIMAL(10,2) AS
+ nSalary DECIMAL(10,2);
+ BEGIN
+ SELECT salary INTO nSalary FROM employee WHERE id=eid;
+ log(eid, 'getSalary id=' || eid || ' salary=' || nSalary);
+ RETURN nSalary;
+ END;
+
+ PROCEDURE raiseSalary(eid INT, amount DECIMAL(10,2)) AS
+ BEGIN
+ UPDATE employee SET salary=salary+amount WHERE id=eid;
+ log(eid, 'raiseSalary id=' || eid || ' amount=' || amount);
+ END;
+
+ PROCEDURE raiseSalaryStd(eid INT) AS
+ BEGIN
+ raiseSalary(eid, stdRaiseAmount);
+ log(eid, 'raiseSalaryStd id=' || eid);
+ END;
+
+BEGIN
+ -- This code is executed when the current session
+ -- accesses any of the package routines for the first time
+ log(0, 'Session ' || connection_id() || ' ' || current_user || ' started');
+END;
+$$
+DELIMITER ;$$
+
+# mysqldump output is expected to have standalone PROCEDURE/FUNCTION, but not PACKAGE/PACKAGE BODY.
+
+--replace_regex /-- MariaDB dump.*[^\n]/-- MariaDB dump DUMPVERSION Distrib DISTVERSION, for OS/ / on [0-9 :-]+/ on TIMESTAMP/
+--exec $MYSQL_DUMP --quick --routines --triggers --no-create-info --skip-lock-tables --no-data --compress -uroot db1_mdev17429
+
+DROP DATABASE db1_mdev17429;
+SET sql_mode=DEFAULT;
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index 6990d1350e3..438d6b428e0 100644
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -44,7 +44,7 @@ SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c my_default.c
my_getncpus.c my_safehash.c my_chmod.c my_rnd.c
my_uuid.c wqueue.c waiting_threads.c ma_dyncol.c ../sql-common/my_time.c
my_rdtsc.c my_context.c psi_noop.c
- my_atomic_writes.c my_likely.c
+ my_atomic_writes.c my_cpu.c my_likely.c
file_logger.c my_dlerror.c)
IF (WIN32)
diff --git a/mysys/my_cpu.c b/mysys/my_cpu.c
new file mode 100644
index 00000000000..4cf08f38637
--- /dev/null
+++ b/mysys/my_cpu.c
@@ -0,0 +1,82 @@
+/* Copyright (c) 2019, MariaDB Corporation.
+
+ 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 Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+#include <my_global.h>
+#include <my_atomic.h>
+#include <my_cpu.h>
+
+#ifdef HAVE_PAUSE_INSTRUCTION
+/** How many times to invoke PAUSE in a loop */
+unsigned my_cpu_relax_multiplier = 200;
+
+# include <stdint.h>
+
+# ifdef _MSC_VER
+# include <intrin.h>
+# else
+# include <x86intrin.h>
+# endif
+
+#define PAUSE4 MY_RELAX_CPU(); MY_RELAX_CPU(); MY_RELAX_CPU(); MY_RELAX_CPU()
+#define PAUSE16 PAUSE4; PAUSE4; PAUSE4; PAUSE4
+
+/**
+ Initialize my_cpu_relax_multiplier.
+
+ Determine the duration of a PAUSE instruction by running an
+ unrolled loop of 16 PAUSE instructions twice, and taking the
+ faster of the two runs. In this way, even if the execution is
+ interrupted by the operating system, it should be extremely
+ unlikely that both loops get interrupted.
+
+ On the Intel Skylake microarchitecture, the PAUSE instruction takes
+ around 140 clock cycles, while on earlier microarchitectures it could
+ be 10 clock cycles or less. Scale the PAUSE loop counter accordingly.
+
+ On a pre-Skylake Intel Xeon CPU E5-2630 v4 @ 2.20GHz running an AMD64
+ executable, the numbers would be between 172 and 220 when all the code
+ is inlined as follows:
+
+ rdtsc,mov,shl,or, 16*pause,
+ rdtsc,mov,shl,or, 16*pause,
+ rdtsc.
+
+ That would yield 11 to 14 cycles per PAUSE instruction even if we
+ (wrongly) ignore the overhead of the other instructions.
+
+ On a Skylake mobile processor Intel Core i7-6500U CPU @ 2.50GHz, the
+ numbers would range from 1896 to 2410 (or 1976 if taking the minimum
+ of two runs), yielding 118 to 151 (or 123) cycles per PAUSE instruction.
+
+ Let us define a threshold at roughly 30 cycles per PAUSE instruction,
+ and use a shorter delay if the PAUSE instruction takes longer than
+ that. In some AMD processors, the PAUSE instruction could take 40 or
+ 50 cycles. Let us use a shorter delay multiplier for them as well.
+
+ The 1/10 scaling factor (200/20) was derived experimentally by
+ Mikhail Sinyavin from Intel.
+*/
+void my_cpu_init(void)
+{
+ uint64_t t0, t1, t2;
+ t0= __rdtsc();
+ PAUSE16;
+ t1= __rdtsc();
+ PAUSE16;
+ t2= __rdtsc();
+ if (t2 - t1 > 30 * 16 && t1 - t0 > 30 * 16)
+ my_cpu_relax_multiplier= 20;
+}
+#endif
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 4f6255e81d1..0e6070b26df 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -4891,6 +4891,7 @@ static int init_server_components()
We need to call each of these following functions to ensure that
all things are initialized so that unireg_abort() doesn't fail
*/
+ my_cpu_init();
mdl_init();
if (tdc_init() || hostname_cache_init())
unireg_abort(1);
diff --git a/sql/semisync_master_ack_receiver.h b/sql/semisync_master_ack_receiver.h
index feb3a51ccea..138f7b5aeed 100644
--- a/sql/semisync_master_ack_receiver.h
+++ b/sql/semisync_master_ack_receiver.h
@@ -211,7 +211,7 @@ public:
{
my_socket socket_id= slave->sock_fd();
m_max_fd= (socket_id > m_max_fd ? socket_id : m_max_fd);
-#ifndef WINDOWS
+#ifndef _WIN32
if (socket_id > FD_SETSIZE)
{
sql_print_error("Semisync slave socket fd is %u. "
@@ -219,7 +219,7 @@ public:
"greater than %u (FD_SETSIZE).", socket_id, FD_SETSIZE);
return 0;
}
-#endif //WINDOWS
+#endif //_WIN32
FD_SET(socket_id, &m_init_fds);
fds_index++;
}
diff --git a/storage/innobase/include/ib0mutex.h b/storage/innobase/include/ib0mutex.h
index c121ada4bfd..960cafe5cdb 100644
--- a/storage/innobase/include/ib0mutex.h
+++ b/storage/innobase/include/ib0mutex.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2013, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, MariaDB Corporation. All Rights Reserved.
+Copyright (c) 2017, 2019, MariaDB Corporation.
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
@@ -29,8 +29,8 @@ Created 2013-03-26 Sunny Bains.
#ifndef ib0mutex_h
#define ib0mutex_h
-#include "ut0ut.h"
-#include "ut0rnd.h"
+#include "my_atomic.h"
+#include "my_cpu.h"
#include "os0event.h"
#include "sync0arr.h"
diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h
index c53b08b64b8..a063399849d 100644
--- a/storage/innobase/include/ut0ut.h
+++ b/storage/innobase/include/ut0ut.h
@@ -53,14 +53,6 @@ Created 1/20/1994 Heikki Tuuri
/** Time stamp */
typedef time_t ib_time_t;
-#if defined (__GNUC__)
-# define UT_COMPILER_BARRIER() __asm__ __volatile__ ("":::"memory")
-#elif defined (_MSC_VER)
-# define UT_COMPILER_BARRIER() _ReadWriteBarrier()
-#else
-# define UT_COMPILER_BARRIER()
-#endif
-
/*********************************************************************//**
Delays execution for at most max_wait_us microseconds or returns earlier
if cond becomes true.
@@ -269,14 +261,7 @@ void
ut_sprintf_timestamp(
/*=================*/
char* buf); /*!< in: buffer where to sprintf */
-/*************************************************************//**
-Runs an idle loop on CPU. The argument gives the desired delay
-in microseconds on 100 MHz Pentium + Visual C++.
-@return dummy value */
-void
-ut_delay(
-/*=====*/
- ulint delay); /*!< in: delay in microseconds on 100 MHz Pentium */
+
/*************************************************************//**
Prints the contents of a memory buffer in hex and ascii. */
void
diff --git a/storage/innobase/ut/ut0ut.cc b/storage/innobase/ut/ut0ut.cc
index 8ee18005d3b..4265e23334b 100644
--- a/storage/innobase/ut/ut0ut.cc
+++ b/storage/innobase/ut/ut0ut.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1994, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, MariaDB Corporation.
+Copyright (c) 2017, 2019, MariaDB Corporation.
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
@@ -284,27 +284,6 @@ ut_sprintf_timestamp(
}
/*************************************************************//**
-Runs an idle loop on CPU. The argument gives the desired delay
-in microseconds on 100 MHz Pentium + Visual C++.
-@return dummy value */
-void
-ut_delay(
-/*=====*/
- ulint delay) /*!< in: delay in microseconds on 100 MHz Pentium */
-{
- ulint i;
-
- HMT_low();
-
- for (i = 0; i < delay * 50; i++) {
- MY_RELAX_CPU();
- UT_COMPILER_BARRIER();
- }
-
- HMT_medium();
-}
-
-/*************************************************************//**
Prints the contents of a memory buffer in hex and ascii. */
void
ut_print_buf(