Commit e917188f authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Merge branch 'bb-10.2-wlad' into 10.2-backup-fixes

parents 2129eab7 2bb19230
...@@ -3,7 +3,7 @@ version: build-{build}~branch-{branch} ...@@ -3,7 +3,7 @@ version: build-{build}~branch-{branch}
before_build: before_build:
- md %APPVEYOR_BUILD_FOLDER%\win_build - md %APPVEYOR_BUILD_FOLDER%\win_build
- cd %APPVEYOR_BUILD_FOLDER%\win_build - cd %APPVEYOR_BUILD_FOLDER%\win_build
- cmake .. -G "Visual Studio 15 2017 Win64" -DWITH_UNIT_TESTS=0 -DBISON_EXECUTABLE=C:\cygwin\bin\bison - cmake .. -G "Visual Studio 15 2017 Win64" -DWITH_UNIT_TESTS=0
build: build:
project: win_build\MySQL.sln project: win_build\MySQL.sln
......
...@@ -20,7 +20,16 @@ IF(CMAKE_SYSTEM_NAME MATCHES "SunOS") ...@@ -20,7 +20,16 @@ IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
SET(BISON_EXECUTABLE /opt/csw/bin/bison) SET(BISON_EXECUTABLE /opt/csw/bin/bison)
ENDIF() ENDIF()
ENDIF() ENDIF()
FIND_PROGRAM(BISON_EXECUTABLE bison DOC "path to the bison executable") IF(WIN32)
SET(BISON_PATH_HINTS
HINTS
C:/gnuwin32/bin
C:/cygwin64/bin
C:/cygwin/bin)
ENDIF()
FIND_PROGRAM(BISON_EXECUTABLE bison
${BISON_PATH_HINTS}
DOC "path to the bison executable")
MARK_AS_ADVANCED(BISON_EXECUTABLE "") MARK_AS_ADVANCED(BISON_EXECUTABLE "")
IF(NOT BISON_EXECUTABLE) IF(NOT BISON_EXECUTABLE)
MESSAGE("Warning: Bison executable not found in PATH") MESSAGE("Warning: Bison executable not found in PATH")
......
...@@ -24,9 +24,6 @@ INCLUDE (CheckCSourceRuns) ...@@ -24,9 +24,6 @@ INCLUDE (CheckCSourceRuns)
INCLUDE (CheckSymbolExists) INCLUDE (CheckSymbolExists)
INCLUDE (CheckTypeSize) INCLUDE (CheckTypeSize)
# Optionally read user configuration, generated by configure.js.
# This is left for backward compatibility reasons only.
INCLUDE(${CMAKE_BINARY_DIR}/win/configure.data OPTIONAL)
# avoid running system checks by using pre-cached check results # avoid running system checks by using pre-cached check results
# system checks are expensive on VS since every tiny program is to be compiled in # system checks are expensive on VS since every tiny program is to be compiled in
...@@ -63,6 +60,8 @@ IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4) ...@@ -63,6 +60,8 @@ IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4)
ENDIF() ENDIF()
IF(MSVC) IF(MSVC)
# Disable mingw based pkg-config found in Strawberry perl
SET(PKG_CONFIG_EXECUTABLE 0 CACHE INTERNAL "")
SET(MSVC_CRT_TYPE /MT CACHE STRING SET(MSVC_CRT_TYPE /MT CACHE STRING
"Runtime library - specify runtime library for linking (/MT,/MTd,/MD,/MDd)" "Runtime library - specify runtime library for linking (/MT,/MTd,/MD,/MDd)"
) )
...@@ -156,7 +155,11 @@ IF(MSVC) ...@@ -156,7 +155,11 @@ IF(MSVC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
ENDIF() ENDIF()
IF(MSVC_VERSION LESS 1910)
# Noisy warning C4800: 'type': forcing value to bool 'true' or 'false' (performance warning),
# removed in VS2017
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800")
ENDIF()
ENDIF() ENDIF()
# Always link with socket library # Always link with socket library
......
Subproject commit 058fc080b4ee95bce405c182ae8d542576863f8a Subproject commit 67cc3438a84df9fa3cc0cfbf9ed81242502702da
perl mysql-test-run.pl --verbose-restart --force --suite-timeout=120 --max-test-fail=10 --retry=3 --parallel=4 --suite=^ perl mysql-test-run.pl --verbose-restart --force --suite-timeout=120 --max-test-fail=10 --retry=3 --parallel=4 --suite=^
vcol,gcol,perfschema,^
main,^ main,^
innodb,^ innodb,^
plugins,^ plugins,^
......
...@@ -431,16 +431,21 @@ sub main { ...@@ -431,16 +431,21 @@ sub main {
my $num_tests= @$tests; my $num_tests= @$tests;
if ( $opt_parallel eq "auto" ) { if ( $opt_parallel eq "auto" ) {
# Try to find a suitable value for number of workers # Try to find a suitable value for number of workers
my $sys_info= My::SysInfo->new(); if (IS_WINDOWS)
{
$opt_parallel= $sys_info->num_cpus(); $opt_parallel= $ENV{NUMBER_OF_PROCESSORS} || 1;
for my $limit (2000, 1500, 1000, 500){ }
$opt_parallel-- if ($sys_info->min_bogomips() < $limit); else
{
my $sys_info= My::SysInfo->new();
$opt_parallel= $sys_info->num_cpus();
for my $limit (2000, 1500, 1000, 500){
$opt_parallel-- if ($sys_info->min_bogomips() < $limit);
}
} }
my $max_par= $ENV{MTR_MAX_PARALLEL} || 8; my $max_par= $ENV{MTR_MAX_PARALLEL} || 8;
$opt_parallel= $max_par if ($opt_parallel > $max_par); $opt_parallel= $max_par if ($opt_parallel > $max_par);
$opt_parallel= $num_tests if ($opt_parallel > $num_tests); $opt_parallel= $num_tests if ($opt_parallel > $num_tests);
$opt_parallel= 1 if (IS_WINDOWS and $sys_info->isvm());
$opt_parallel= 1 if ($opt_parallel < 1); $opt_parallel= 1 if ($opt_parallel < 1);
mtr_report("Using parallel: $opt_parallel"); mtr_report("Using parallel: $opt_parallel");
} }
......
...@@ -40,8 +40,8 @@ sub start_test { ...@@ -40,8 +40,8 @@ sub start_test {
my $bin=$ENV{MTR_BINDIR} || '..'; my $bin=$ENV{MTR_BINDIR} || '..';
return "Not run for embedded server" if $::opt_embedded_server; return "Not run for embedded server" if $::opt_embedded_server;
return "Not configured to run ctest" unless -f "$bin/CTestTestfile.cmake"; return "Not configured to run ctest" unless -f "$bin/CTestTestfile.cmake";
my ($ctest_vs)= $opt_vs_config ? "--build-config $opt_vs_config" : ""; my ($ctest_vs)= $opt_vs_config ? "-C $opt_vs_config" : "";
my (@ctest_list)= `cd "$bin" && ctest $opt_vs_config --show-only --verbose`; my (@ctest_list)= `cd "$bin" && ctest $ctest_vs --show-only --verbose`;
return "No ctest" if $?; return "No ctest" if $?;
my ($command, %tests, $prefix); my ($command, %tests, $prefix);
...@@ -51,7 +51,9 @@ sub start_test { ...@@ -51,7 +51,9 @@ sub start_test {
$command= $'; $command= $';
$prefix= /libmariadb/ ? 'conc_' : ''; $prefix= /libmariadb/ ? 'conc_' : '';
} elsif (/^ +Test +#\d+: +/) { } elsif (/^ +Test +#\d+: +/) {
$tests{$prefix.$'}=$command; if ($command ne "NOT_AVAILABLE") {
$tests{$prefix.$'}=$command;
}
} }
} }
bless { ctests => { %tests } }; bless { ctests => { %tests } };
......
...@@ -15046,7 +15046,7 @@ ha_innobase::check( ...@@ -15046,7 +15046,7 @@ ha_innobase::check(
&& !dict_index_is_corrupted(index)) { && !dict_index_is_corrupted(index)) {
/* Enlarge the fatal lock wait timeout during /* Enlarge the fatal lock wait timeout during
CHECK TABLE. */ CHECK TABLE. */
my_atomic_addlint( my_atomic_addlong(
&srv_fatal_semaphore_wait_threshold, &srv_fatal_semaphore_wait_threshold,
SRV_SEMAPHORE_WAIT_EXTENSION); SRV_SEMAPHORE_WAIT_EXTENSION);
...@@ -15055,7 +15055,7 @@ ha_innobase::check( ...@@ -15055,7 +15055,7 @@ ha_innobase::check(
/* Restore the fatal lock wait timeout after /* Restore the fatal lock wait timeout after
CHECK TABLE. */ CHECK TABLE. */
my_atomic_addlint( my_atomic_addlong(
&srv_fatal_semaphore_wait_threshold, &srv_fatal_semaphore_wait_threshold,
-SRV_SEMAPHORE_WAIT_EXTENSION); -SRV_SEMAPHORE_WAIT_EXTENSION);
......
...@@ -1827,7 +1827,7 @@ struct buf_block_t{ ...@@ -1827,7 +1827,7 @@ struct buf_block_t{
} while (0) } while (0)
# define assert_block_ahi_valid(block) \ # define assert_block_ahi_valid(block) \
ut_a((block)->index \ ut_a((block)->index \
|| my_atomic_addlint(&(block)->n_pointers, 0) == 0) || my_atomic_loadlint(&(block)->n_pointers) == 0)
# else /* UNIV_AHI_DEBUG || UNIV_DEBUG */ # else /* UNIV_AHI_DEBUG || UNIV_DEBUG */
# define assert_block_ahi_empty(block) /* nothing */ # define assert_block_ahi_empty(block) /* nothing */
# define assert_block_ahi_empty_on_init(block) /* nothing */ # define assert_block_ahi_empty_on_init(block) /* nothing */
......
...@@ -1156,9 +1156,41 @@ enum rw_lock_flag_t { ...@@ -1156,9 +1156,41 @@ enum rw_lock_flag_t {
#endif /* UNIV_INNOCHECKSUM */ #endif /* UNIV_INNOCHECKSUM */
#ifdef _WIN64 #ifdef _WIN64
#define my_atomic_addlint(A,B) my_atomic_add64((int64*) (A), (B)) static inline ulint my_atomic_addlint(ulint *A, ulint B)
#define my_atomic_loadlint(A) my_atomic_load64((int64*) (A)) {
#define my_atomic_caslint(A,B,C) my_atomic_cas64((int64*) (A), (int64*) (B), (C)) return ulint(my_atomic_add64((volatile int64*)A, B));
}
static inline ulint my_atomic_loadlint(const ulint *A)
{
return ulint(my_atomic_load64((volatile int64*)A));
}
static inline lint my_atomic_addlint(volatile lint *A, lint B)
{
return my_atomic_add64((volatile int64*)A, B);
}
static inline lint my_atomic_loadlint(const lint *A)
{
return lint(my_atomic_load64((volatile int64*)A));
}
static inline void my_atomic_storelint(ulint *A, ulint B)
{
my_atomic_store64((volatile int64*)A, B);
}
static inline lint my_atomic_caslint(volatile lint *A, lint *B, lint C)
{
return my_atomic_cas64((volatile int64*)A, (int64 *)B, C);
}
static inline ulint my_atomic_caslint(ulint *A, ulint *B, ulint C)
{
return my_atomic_cas64((volatile int64*)A, (int64 *)B, (int64)C);
}
#else #else
#define my_atomic_addlint my_atomic_addlong #define my_atomic_addlint my_atomic_addlong
#define my_atomic_loadlint my_atomic_loadlong #define my_atomic_loadlint my_atomic_loadlong
...@@ -1188,7 +1220,7 @@ struct MY_ALIGNED(CPU_LEVEL1_DCACHE_LINESIZE) simple_counter ...@@ -1188,7 +1220,7 @@ struct MY_ALIGNED(CPU_LEVEL1_DCACHE_LINESIZE) simple_counter
#pragma warning (push) #pragma warning (push)
#pragma warning (disable : 4244) #pragma warning (disable : 4244)
#endif #endif
return Type(my_atomic_addlint(reinterpret_cast<lint*> return Type(my_atomic_addlint(reinterpret_cast<ulint*>
(&m_counter), i)); (&m_counter), i));
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning (pop) #pragma warning (pop)
......
...@@ -514,9 +514,9 @@ class purge_sys_t ...@@ -514,9 +514,9 @@ class purge_sys_t
parallelized purge operation */ parallelized purge operation */
ReadView view; /*!< The purge will not remove undo logs ReadView view; /*!< The purge will not remove undo logs
which are >= this view (purge view) */ which are >= this view (purge view) */
volatile ulint n_submitted; /*!< Count of total tasks submitted ulint n_submitted; /*!< Count of total tasks submitted
to the task queue */ to the task queue */
volatile ulint n_completed; /*!< Count of total tasks completed */ ulint n_completed; /*!< Count of total tasks completed */
/*------------------------------*/ /*------------------------------*/
/* The following two fields form the 'purge pointer' which advances /* The following two fields form the 'purge pointer' which advances
......
...@@ -78,11 +78,11 @@ struct srv_conc_t { ...@@ -78,11 +78,11 @@ struct srv_conc_t {
This is no longer true. We'll, however, keep the lint datatype to add This is no longer true. We'll, however, keep the lint datatype to add
assertions to catch any corner cases that we may have missed. */ assertions to catch any corner cases that we may have missed. */
volatile lint n_active; ulint n_active;
/** Number of OS threads waiting in the FIFO for permission to /** Number of OS threads waiting in the FIFO for permission to
enter InnoDB */ enter InnoDB */
volatile lint n_waiting; ulint n_waiting;
}; };
/* Control variables for tracking concurrency. */ /* Control variables for tracking concurrency. */
...@@ -152,7 +152,7 @@ srv_conc_enter_innodb_with_atomics( ...@@ -152,7 +152,7 @@ srv_conc_enter_innodb_with_atomics(
return; return;
} }
if (srv_conc.n_active < (lint) srv_thread_concurrency) { if (srv_conc.n_active < srv_thread_concurrency) {
ulint n_active; ulint n_active;
/* Check if there are any free tickets. */ /* Check if there are any free tickets. */
......
...@@ -2588,8 +2588,8 @@ DECLARE_THREAD(srv_worker_thread)( ...@@ -2588,8 +2588,8 @@ DECLARE_THREAD(srv_worker_thread)(
slot = srv_reserve_slot(SRV_WORKER); slot = srv_reserve_slot(SRV_WORKER);
ut_a(srv_n_purge_threads > 1); ut_a(srv_n_purge_threads > 1);
ut_a(my_atomic_loadlint(&srv_sys.n_threads_active[SRV_WORKER]) ut_a(ulong(my_atomic_loadlint(&srv_sys.n_threads_active[SRV_WORKER]))
< static_cast<lint>(srv_n_purge_threads)); < srv_n_purge_threads);
/* We need to ensure that the worker threads exit after the /* We need to ensure that the worker threads exit after the
purge coordinator thread. Otherwise the purge coordinator can purge coordinator thread. Otherwise the purge coordinator can
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment