Commit graph

179 commits

Author SHA1 Message Date
Oleksandr Byelkin
ef7cb0a0b5 Merge branch '10.1' into 10.2 2020-08-02 11:05:29 +02:00
Karthik Kamath
e6cb263ef3 MDEV-15961: Fix stacktraces under FreeBSD (aarch64)
Largely based on MySQL commit
75271e51d6

MySQL Ref:
    BUG#24566529: BACKPORT BUG#23575445 TO 5.6

    (cut)
    Also, the PTR_SANE macro which tries to check if a pointer
    is invalid (used when printing pointer values in stack traces)
    gave false negatives on OSX/FreeBSD. On these platforms we
    now simply check if the pointer is non-null. This also removes
    a sbrk() deprecation warning when building on OS X. (It was
    before only disabled with building using XCode).

Removed execinfo path of MySQL patch that was already included.

sbrk doesn't exist on FreeBSD aarch64.

Removed HAVE_BSS_START based detection and replaced with __linux__
as it doesn't exist on OSX, Solaris or Windows.  __bss_start
exists on mutiple Linux architectures.

Tested on FreeBSD and Linux x86_64. Being in FreeBSD ports for 2
years implies a good testing there on all FreeBSD architectures there
too. MySQL-8.0.21 code is functionally identical to original commit.
2020-07-28 11:10:25 +10:00
Anel Husakovic
0d1dd2e79d Clean wrong cherry-pick from previous commit
- Delete variable HAVE_PTHREAD_CONDATTR_SETCLOCK and check
- Delete second HAVE_PTHREAD_KEY_DELETE
2020-02-20 09:25:11 +01:00
Daniel Black
fb01cc3766 my_getncpus based on threads available
Detecting the cpus based on sysconf of the online CPUs can significantly
over estimate the number of cpus available.

Wheither via numactl, cgroups, taskset, systemd constraints, docker
containers and probably other mechanisms, the number of threads mysqld
can be run on can be quite less.

As such we use the pthread_getaffinity_np function on Linux and FreeBSD
(identical API) to get the number of CPUs.

The number of CPUs is the default for the thread_pool_size and a too
high default will resulting in large memory usage and high context
switching overhead.

Closes PR #922
2020-02-20 08:44:20 +01:00
Vlad Lesin
6718d3bc32 MDEV-21082: isnan/isinf compilation errors, isfinite warnings on MacOS
The fix consists of three commits backported from 10.3:

1) Cleanup isnan() portability checks

(cherry picked from commit 7ffd7fe962)

2) Cleanup isinf() portability checks

Original problem reported by Wlad: re-compilation of 10.3 on top of 10.2
build would cache undefined HAVE_ISINF from 10.2, whereas it is expected
to be 1 in 10.3.

std::isinf() seem to be available on all supported platforms.
(cherry picked from commit bc469a0bdf)

3) Use std::isfinite in C++ code

This is addition to parent revision fixing build failures.

(cherry picked from commit 54999f4e75)
2019-11-19 16:28:15 +03:00
Marko Mäkelä
26a14ee130 Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
Vicențiu Ciorbaru
cb248f8806 Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
Vicențiu Ciorbaru
5543b75550 Update FSF Address
* Update wrong zip-code
2019-05-11 21:29:06 +03:00
Oleksandr Byelkin
91d506cf2d Merge branch '10.1' into 10.2 2019-02-19 16:47:45 +01:00
Sergei Golubchik
2de0b57dd1 Don't build aws_key_management plugin by default 2019-02-19 12:39:40 +01:00
Marko Mäkelä
32062cc61c Merge 10.1 into 10.2 2018-11-06 08:41:48 +02:00
Bernd Kuhls
2a576f71c5 cmake: fix ucontext detection
On some archs uclibc does not provide the ucontext structure despite
providing ucontext.h, for details see
https://git.buildroot.net/buildroot/commit/?id=f1cbfeea95e6287c7a666aafc182ffa318eff262

This patch improves the detection of ucontext by making sure that
HAVE_UCONTEXT_H is only set when makecontext() was found.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
2018-10-17 00:10:18 +04:00
Vicențiu Ciorbaru
98eb9518db Merge remote-tracking branch 'origin/10.1' into 10.2 2018-03-16 14:12:00 +02:00
Timo Teräs
782fb1e016 fix ucontext configure check
musl ships the header for other purposes, but makecontext is not
implemented. fix the check to detect if makecontext is implemented
before enabling code using it.
2018-03-14 15:16:03 +04:00
Sergei Golubchik
4771ae4b22 Merge branch 'github/10.1' into 10.2 2018-02-06 14:50:50 +01:00
Sergei Golubchik
d4df7bc9b1 Merge branch 'github/10.0' into 10.1 2018-02-02 10:09:44 +01:00
Vicențiu Ciorbaru
d833bb65d5 Merge remote-tracking branch '5.5' into 10.0 2018-01-24 12:29:31 +02:00
Vicențiu Ciorbaru
26e5f9dda1 MDEV-14229: Stack trace is not resolved for shared objects
Resolving a stacktrace including functions in dynamic libraries requires
us to look inside the libraries for the symbols. Addr2line needs to be
started with the correct binary for each address on the stack. To do this,
figure out which library it is using dladdr, then if the addr2line
binary was started with a different binary, fork it again with the
correct one.

We only have one addr2line process running at any point during the
stacktrace resolving step. The maximum number of forks for addr2line should
generally be around 6.

One for server stacktrace code, one for plugin code, one when going back
into server code, one for pthread library, one for libc, one for the
_start function in the server. More can come up if plugin calls server
function which goes back to a plugin, etc.
2018-01-19 16:11:34 +02:00
Sergei Golubchik
d8001106c9 MDEV-14469 build with cmake -DMYSQL_MAINTAINER_MODE=ON fails: 'readdir_r' is deprecated
1. test readdir_r() availability under -Werror
2. don't protect readdir() with mutexes, it's not needed for the way
   we use readdir()
2018-01-15 15:57:04 +01:00
Sergei Golubchik
4a5d25c338 Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
Sergei Golubchik
2f20d297f8 Merge branch '10.0' into 10.1 2016-12-11 09:53:42 +01:00
Sergei Golubchik
3e8155c637 Merge branch '5.5' into 10.0 2016-12-09 16:33:48 +01:00
Sergei Golubchik
18cdff6765 MDEV-10293 'setupterm' was not declared in this scope
Check for readline before checking for curses headers, because
MYSQL_CHECK_READLINE fails when curses is not found, but
CHECK_INCLUDE_FILES simply remembers the fact and continues.  So if
there's no curses, MYSQL_CHECK_READLINE will abort, the user will then
installs curses and continue the build. Thus, CHECK_INCLUDE_HEADERS
will remember that there is no curses, but other checks from
MYSQL_CHECK_READLINE will remember that curses are there. It will
result in inconsistent HAVE_xxx defines.
2016-12-05 14:27:45 +01:00
Sergei Golubchik
f9bdc7c01a Merge branch '10.2' into bb-10.2-jan 2016-09-19 09:47:08 +02:00
Sergei Golubchik
06b7fce9f2 Merge branch '10.1' into 10.2 2016-09-09 08:33:08 +02:00
Jan Lindström
2e814d4702 Merge InnoDB 5.7 from mysql-5.7.9.
Contains also

MDEV-10547: Test multi_update_innodb fails with InnoDB 5.7

	The failure happened because 5.7 has changed the signature of
	the bool handler::primary_key_is_clustered() const
	virtual function ("const" was added). InnoDB was using the old
	signature which caused the function not to be used.

MDEV-10550: Parallel replication lock waits/deadlock handling does not work with InnoDB 5.7

	Fixed mutexing problem on lock_trx_handle_wait. Note that
	rpl_parallel and rpl_optimistic_parallel tests still
	fail.

MDEV-10156 : Group commit tests fail on 10.2 InnoDB (branch bb-10.2-jan)
  Reason: incorrect merge

MDEV-10550: Parallel replication can't sync with master in InnoDB 5.7 (branch bb-10.2-jan)
  Reason: incorrect merge
2016-09-02 13:22:28 +03:00
Daniel Black
37b08eff90 Cross Compile HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE change to compile check
HAVE_FALLOC_PUNCH_HOLE_AND_KEEP_SIZE only needed a compile check
rather than a RUN check so after changing to a compile check there
is one less variable to manually set while cross compiling.
2016-07-01 17:10:46 +10:00
Galina Shalygina
be1d06c8a5 Merge branch '10.2' into 10.2-mdev9864 2016-05-08 23:04:41 +03:00
Monty
9c846373f0 Merge commit 'd5822a3ad0657040114cdc185c6387b9eb3a12b2' into 10.2 2016-04-28 16:59:33 +03:00
Daniel Black
26c38de804 MDEV-8684: Use POWER wrappers rather than direct asm
i.e. __ppc_set_ppr_low rather than 'or 1,1,1'
2016-04-01 09:38:17 +11:00
Yasufumi Kinoshita
d4ba50477e Some POWER specific optimizations
Bug#18842925 : SET THREAD PRIORITY IN INNODB MUTEX SPINLOOP
Like "pause" instruction for hyper-threading at Intel CPUs,
POWER has special instructions only for hinting priority of hardware-threads.

Approved by Sunny in rb#6256

Backport of the 5.7 fix - c92102a6ef
(excluded cache line size patch)

Suggestion by Stewart Smith
2016-03-31 16:34:56 +11:00
Sergei Golubchik
00d1db7a38 Merge branch '10.1' into 10.2 2016-02-25 18:19:55 +01:00
Sergei Golubchik
a5679af1b1 Merge branch '10.0' into 10.1 2016-02-23 21:35:05 +01:00
Sergei Golubchik
271fed4106 Merge branch '5.5' into 10.0 2016-02-15 22:50:59 +01:00
Sergei Golubchik
a5d9597e97 better inline check
1. check that unused inline functions are removed
2. only allow compilation if they are or if the check if overridden
3. with CMAKE_GENERATOR=Makefiles, use all flags when testing
   (e.g. both CMAKE_C_FLAGS and CMAKE_C_FLAGS_DEBUG if
   CMAKE_BUILD_TYPE=Debug). This is because
 - on Solaris with the SunPro compiler, default CMAKE_C_FLAGS_xxx
   values contain -xO2 (for Release and RelWithDebInfo)
   and -g (for RelWithDebInfo and Debug)
 - proper inlining only works at -xO4 without -g
 - so if CMAKE_C_FLAGS has -xO4, inlining would work in
   configure.cmake (before this fix) and fail during actual compilation

also remove the outdated check for inline from myu_global.h
2016-02-15 12:51:35 +01:00
Monty
d80b8442a6 Fixes needed to compile with musl C library
Patch originally by Codarren Velvindron
2016-02-07 15:00:30 +02:00
Sergei Golubchik
c4cb240061 MDEV-9024 Build fails with VS2015
cherry-pick f1daf9ce from 10.0 branch
-------------------------------------

Fix build failures caused by new C runtime library
- isnan, snprintf, struct timespec are now defined, attempt to
redefine them leads
- P_tmpdir, tzname are no more defined
-  lfind() and lsearch() in lf_hash.c had to be renamed,  declaration
conflicts with some C runtime functions with the same name declared in
a header included by stdlib.h

 Also fix couple of annoying warnings :
- remove #define NOMINMAX from config.h to avoid "redefined" compiler
warnings(NOMINMAX is already in compile flags)

- disable incremental linker in Debug as well (feature not used much
and compiler crashes often)

Also simplify package building with Wix, require Wix 3.9 or later
(VS2015 is not compatible with old Wix 3.5/3.6)
2016-02-06 22:41:58 +01:00
Sergei Golubchik
2ebc2eef8a cleanup: remove a couple of unused cmake checks and defines 2016-02-06 18:07:54 +01:00
Monty
b2f8d7b410 Merge branch '10.1' into 10.2
Conflicts:
	VERSION
	cmake/plugin.cmake
	config.h.cmake
	configure.cmake
	plugin/server_audit/server_audit.c
	sql/sql_yacc.yy
2016-02-06 18:14:54 +02:00
Monty
11c2d3c3e2 Merge branch '10.0' into 10.1
Conflicts:
	configure.cmake
2016-02-02 13:07:53 +02:00
Kristian Nielsen
91ff017297 Merge MDEV-9112 into 10.1
Conflicts:
	config.h.cmake
	configure.cmake
2016-02-01 16:40:20 +01:00
Kristian Nielsen
955126e31d Merge MDEV-9112 into 10.0
Conflicts:
	configure.cmake
2016-02-01 16:29:00 +01:00
Georg Richter
8cf1f50967 MDEV-9112: Non-blocking client API missing on non-x86 platforms
The check for UCONTEXT in cmake was somehow become broken, disabling the
fallback to ucontext. This caused the non-blocking client API to not be
available for non-x86 platforms, on which no hand-crafted assembler
implementation of my_context is available.
2016-02-01 16:12:00 +01:00
Alexander Barkov
2ba7ed77aa Merge remote-tracking branch 'origin/10.1' into 10.2 2015-12-29 19:37:11 +04:00
Sergei Golubchik
a2bcee626d Merge branch '10.0' into 10.1 2015-12-21 21:24:22 +01:00
Vladislav Vaintroub
06cbf7c95c restore the check for HAVE_CXX_NEW, it is actually used 2015-12-02 19:23:02 +01:00
Monty
f813a00029 Fixed failing test cases and compiler warnings found by buildbot
- Added some extra command to rpl_start_stop to ensure that the
  IO thread has connected to the master before we shut down the server.
- if signal returns signalhandler_t, use this with the alarm code
- Added missing tests to sys_vars
- Fixed some possible overflow bugs in tabxml.cpp
2015-11-24 20:04:12 +02:00
Sergei Golubchik
65d69c84cf cmake: remove unused checks, options, and symbols 2015-11-23 16:02:56 +01:00
Sergei Golubchik
e4b88235b5 cmake: rename symbols used internally by check_compiler_flag.cmake
(that is MY_CHECK_C_COMPILER_FLAG, MY_CHECK_CXX_COMPILER_FLAG,
MY_CHECK_AND_SET_COMPILER_FLAG)

This is to have a clear "internal" name prefix and to avoid
mixing them with hand-named symbols
2015-11-23 16:02:56 +01:00
Sergei Golubchik
beded7d9c9 Merge branch '10.0' into 10.1 2015-11-19 15:52:14 +01:00