Commit graph

869 commits

Author SHA1 Message Date
Oleksandr Byelkin
6efb5e9f5e Merge branch '10.5' into 10.6 2021-08-02 10:11:41 +02:00
Oleksandr Byelkin
ae6bdc6769 Merge branch '10.4' into 10.5 2021-07-31 23:19:51 +02:00
Oleksandr Byelkin
7841a7eb09 Merge branch '10.3' into 10.4 2021-07-31 22:59:58 +02:00
Marko Mäkelä
b50ea90063 Merge 10.2 into 10.3 2021-07-22 18:57:54 +03:00
Heinz Wiesinger
751ebe44fd Add feature summary at the end of cmake.
This gives a short overview over found/missing dependencies as well
as enabled/disabled features.

Initial author Heinz Wiesinger <heinz@m2mobi.com>
Additions by Vicențiu Ciorbaru <vicentiu@mariadb.org>
* Report all plugins enabled via MYSQL_ADD_PLUGIN
* Simplify code. Eliminate duplication by making use of WITH_xxx
  variable values to set feature "ON" / "OFF" state.

Reviewed by: wlad@mariadb.com (code details) serg@mariadb.com (the idea)
2021-07-21 10:22:56 +03:00
Marko Mäkelä
860e754349 Merge 10.5 into 10.6 2021-05-26 11:22:40 +03:00
Marko Mäkelä
365cd08345 Merge 10.4 into 10.5 2021-05-26 09:47:28 +03:00
Marko Mäkelä
1dea7f7977 Merge 10.3 into 10.4 2021-05-25 15:38:57 +03:00
Monty
3b8d4180d5 Flush gcov files for DBUG_ASSERT and DBUG_SUICIDE 2021-05-24 21:04:40 +03:00
Marko Mäkelä
1864a8ea93 Merge 10.2 into 10.3 2021-05-24 09:38:49 +03:00
Sergei Golubchik
f70b11c8c9 cmake: fewer Build-Depends in SRPM
don't require tar/gtar, git, getconf, groff/nroff, and ruby.
2021-05-22 21:56:51 +02:00
Monty
e42130e9cd Fixes that enables my_new.cc (new wrapper using my_malloc)
This is not enabled by default, as there are leaks in the
server that needs to be fixed first. One can compile
with -DUSE_MYSYS_NEW to find the memory leaks from
'new'. More comments can be found in mysys/my_new.cc
2021-05-19 22:27:27 +02:00
Marko Mäkelä
f8665314d4 Merge 10.5 into 10.6 2021-05-10 11:42:04 +03:00
Marko Mäkelä
0e1437e147 Merge 10.4 into 10.5 2021-05-10 10:01:15 +03:00
Marko Mäkelä
8c73fab7f7 Merge 10.3 into 10.4 2021-05-10 09:52:01 +03:00
Marko Mäkelä
98e6159892 Merge 10.2 into 10.3 2021-05-10 09:09:50 +03:00
Vladislav Vaintroub
d0785f7731 MDEV-25232 Ninja MSVC build sets default CMAKE_BUILD_TYPE to Debug
This is incosistent with other single config generators, where
the default type has always been RelWithDebInfo.

Fixed by moving setting of CMAKE_BUILD_TYPE right before PROJECT.
2021-05-09 10:32:49 +02:00
Marko Mäkelä
916b237b3f Merge 10.5 into 10.6 2021-05-07 15:00:27 +03:00
Nikita Malyavin
3f55c56951 Merge branch bb-10.4-release into bb-10.5-release 2021-05-05 23:57:11 +03:00
Nikita Malyavin
509e4990af Merge branch bb-10.3-release into bb-10.4-release 2021-05-05 23:03:01 +03:00
Nikita Malyavin
a8a925dd22 Merge branch bb-10.2-release into bb-10.3-release 2021-05-04 14:49:31 +03:00
Vladislav Vaintroub
b07a6f45fe MDEV-25232 - CMake deprecation warning about CMAKE_MINIMUM_REQUIRED < 2.8.12 2021-04-28 08:53:36 +02:00
Marko Mäkelä
ed4b2b3f95 Merge 10.5 into 10.6 2021-04-26 08:40:36 +03:00
Marko Mäkelä
4725792bf3 Merge 10.4 into 10.5 2021-04-25 12:04:45 +03:00
Marko Mäkelä
e4394cc547 Merge 10.3 into 10.4 2021-04-25 10:20:57 +03:00
Marko Mäkelä
c425d93b92 Merge 10.2 into 10.3
except commit 1288dfffe7
2021-04-24 10:37:21 +03:00
Sergei Golubchik
018d7440fd remove EXCEPTIONS-CLIENT
It's Oracle libmysqlclient license exception, we no longer include,
build or ship libmysqlclient
2021-04-23 10:38:10 +02:00
Marko Mäkelä
5c76e1e693 Merge 10.5 into 10.6 2021-04-15 20:21:11 +03:00
Justin Jagieniak
1715fef107 Fix cross-compile to consider CMAKE_CROSSCOMPILING_EMULATOR
When CMAKE_CROSSCOMPILING_EMULATOR is defined, a cross-compile
can be made, however with native (emulated) execution possible.

This commit takes those points in the build system that
execute built targets natively and allow these to be executed
in a crosscompile if CMAKE_CROSSCOMPILING_EMULATOR is defined.

Closes #1805
2021-04-15 10:07:50 +10:00
Marko Mäkelä
d2e2d32933 Merge 10.5 into 10.6 2021-04-14 12:32:27 +03:00
Marko Mäkelä
6c3e860cbf Merge 10.4 into 10.5 2021-04-14 11:35:39 +03:00
Marko Mäkelä
5008171b05 Merge 10.3 into 10.4 2021-04-14 10:33:59 +03:00
Marko Mäkelä
ef26a30486 Merge 10.2 into 10.3 2021-04-14 07:54:43 +03:00
Sergei Golubchik
55a7682a30 -DMYSQL_MAINTAINER_MODE=NO
also add =WARN as an alias for =OFF
and clarify the help text
2021-04-13 17:13:44 +02:00
Marko Mäkelä
e538cb095f Merge 10.5 into 10.6 2021-03-27 18:03:03 +02:00
Marko Mäkelä
80459bcbd4 Merge 10.4 into 10.5 2021-03-27 17:37:42 +02:00
Marko Mäkelä
7ae37ff74f Merge 10.3 into 10.4 2021-03-27 17:12:28 +02:00
Marko Mäkelä
3157fa182a Merge 10.2 into 10.3 2021-03-27 16:11:26 +02:00
Eugene Kosov
36a05268e7 cmake cleanup: drop support for ancient clang in WITH_ASAN option 2021-03-26 16:29:58 +03:00
Eugene Kosov
dfae51de36 MDEV-25238 add support for -fsanitize-address-use-after-scope
Use like this: cmake -DWITH_ASAN=ON -DWITH_ASAN_SCOPE=ON
2021-03-26 16:29:58 +03:00
Marko Mäkelä
e8113f7572 CMake cleanup: Make WITH_URING, WITH_PMEM Boolean
The new default values WITH_URING:BOOL=OFF, WITH_PMEM:BOOL=OFF imply
that the dependencies are optional.
An explicit request WITH_URING=ON or WITH_PMEM=ON will cause the
build to fail if the requested dependencies are not available.

Last, to prevent a feature to be built in even though the built-time
dependencies are available, the following can be used:

cmake -DCMAKE_DISABLE_FIND_PACKAGE_URING=1
cmake -DCMAKE_DISABLE_FIND_PACKAGE_PMEM=1

This cleanup was suggested by Vladislav Vaintroub.
2021-03-20 16:23:47 +02:00
Marko Mäkelä
783625d78f MDEV-24883 add io_uring support for tpool
liburing is a new optional dependency (WITH_URING=auto|yes|no)
that replaces libaio when it is available.

aio_uring: class which wraps io_uring stuff

aio_uring::bind()/unbind(): optional optimization

aio_uring::submit_io(): mutex prevents data race. liburing calls are
thread-unsafe. But if you look into it's implementation you'll see
atomic operations. They're used for synchronization between kernel and
user-space only. That's why our own synchronization is still needed.

For systemd, we add LimitMEMLOCK=524288 (ulimit -l 524288)
because the io_uring_setup system call that is invoked
by io_uring_queue_init() requests locked memory. The value
was found empirically; with 262144, we would occasionally
fail to enable io_uring when using the maximum values of
innodb_read_io_threads=64 and innodb_write_io_threads=64.

aio_uring::thread_routine(): Tolerate -EINTR return from
io_uring_wait_cqe(), because it may occur on shutdown
on Ubuntu 20.10 (Groovy Gorilla).

This was mostly implemented by Eugene Kosov. Systemd integration
and improved startup/shutdown error handling by Marko Mäkelä.
2021-03-15 11:30:17 +02:00
Vladislav Vaintroub
ac9c6f53a5 MDEV-24034 Policy CMP0075 is not set during compile
The policy is not set for 10.2
If it is set, CMake would complain about bundled zlib for which the policy
is not set.

Fix:
- Set policy for 10.2 for the top level project.
For 10.3+ it was already set

- Cleanup zlib to remove unneeded stuff. It is an internal static library,
it needs none of PROJECT, library versioning, RC file on Windows.
The name of the library on Unix does not make any difference, since it is
static and compiled in.
2020-12-15 12:27:13 +01:00
Monty
76a9227001 Added support of WITH_GPROF to cmake 2020-08-20 19:34:11 +03:00
Marko Mäkelä
4d4865de6f Merge 10.4 into 10.5 2020-07-20 15:55:59 +03:00
Marko Mäkelä
4b959bd8df Merge 10.3 into 10.4 2020-07-20 15:34:59 +03:00
Marko Mäkelä
acc58fd835 Merge 10.2 into 10.3 2020-07-20 15:11:59 +03:00
Marko Mäkelä
ca9276e37e Merge 10.1 into 10.2 2020-07-20 14:53:24 +03:00
Daniel Black
7473e1841c check_linker_flag: use for linker flags
-Wl,-z,relro,-z,now are linker flags and should
be checked as such.

TODO: perform module, exe shared checks separately
rather than a pure linker check.
2020-07-15 09:23:53 +03:00
Sergei Golubchik
263f8aff65 always use python3
because columnstore uses python3, so rocksdb can be picky too.
python3 is present in all supported distros.
and python2 is obsolete anyway.
2020-07-01 08:48:34 +02:00
Vladislav Vaintroub
e54723fa34 When compiling with RelWithDebInfo, always use -fno-omit-frame-pointer
(if this option is present). perf, and other tools that do stack walking
works much better with it.
2020-06-18 00:55:11 +02:00
Marko Mäkelä
701efbb25b Merge 10.4 into 10.5 2020-06-03 09:45:39 +03:00
Marko Mäkelä
8059148154 Merge 10.3 into 10.4 2020-06-03 07:32:09 +03:00
Marko Mäkelä
8300f639a1 Merge 10.2 into 10.3 2020-06-02 10:25:11 +03:00
mysqlonarm
dec3f8ca69
MDEV-22641: Provide SIMD optimized wrapper for zlib crc32() (#1558)
Existing implementation used my_checksum (from mysys)
for calculating table checksum and binlog checksum.

This implementation was optimized for powerpc only and lacked
SIMD implementation for x86 (using clmul) and ARM
(using ACLE) instead used zlib-crc32.

mariabackup had its own copy of the crc32 implementation
using hardware optimized implementation only for x86 and lagged
hardware based implementation for powerpc and ARM.

Patch helps unifies all such calls and help aggregate all of them
using an unified interface my_checksum().

Said unification also enables hardware optimized calls for all
architecture viz. x86, ARM, POWERPC.
Default always fallback to zlib crc32.

Thanks to Daniel Black for reviewing, fixing and testing
PowerPC changes. Thanks to Marko and Daniel for early code feedback.
2020-06-01 11:34:06 +03:00
Sergei Golubchik
4832b751ad cmake: quieter 2020-05-31 11:29:43 +02:00
Sergei Golubchik
13038e4705 Merge branch '10.4' into 10.5 2020-05-09 20:43:36 +02:00
Sergei Golubchik
f5844e7c4b Merge branch '10.3' into 10.4 2020-05-09 20:36:58 +02:00
Sergei Golubchik
7337abd2f7 MDEV-22123 On RHEL8 mariadb-server is not provided
setup alternative name for rhel8/centos8

use correct C/C version when providing mariadb-connector-c
and other changes for installation over distro packages to work:

  dnf install mariadb-server
  dnf install --allowerasing MariaDB-{server,common,client,shared}*.rpm
2020-05-09 20:06:10 +02:00
Oleksandr Byelkin
985f63cce1 Merge branch '10.1' into 10.2 2020-05-08 13:38:36 +02:00
Marko Mäkelä
7bcaa541aa Merge 10.4 into 10.5 2020-05-05 21:16:22 +03:00
Sergei Golubchik
9c5d06a6d3 MDEV-21437 MariaDB's SUSE/SLES packages don't "provide" all of the same capabilities as the platform's default packages 2020-05-05 19:37:01 +02:00
Marko Mäkelä
2c3c851d2c Merge 10.3 into 10.4 2020-05-05 20:33:10 +03:00
Oleksandr Byelkin
7fb73ed143 Merge branch '10.2' into 10.3 2020-05-04 16:47:11 +02:00
Vladislav Vaintroub
d50f776930 MDEV-22454 Allow -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
Disable IPO (interprocedural optimization, aka /GL) on Windows
on libraries, from which server.dll exports symbols -  exporting symbols
does not work for objects compiled with /GL.
2020-05-04 14:17:06 +02:00
Eugene Kosov
28325b0863 add WITH_DBUG_TRACE CMake variable
This is a way do disable DBUG_ENTER()/DBUG_EXIT() stuff which is
needed to dbug trace. Those who doesn't need it may avoid tests
slowdown with -DWITH_DBUG_TRACE=OFF

dbug/tests.c: add define which is neede always in this test

innodb.log_file_name_debug.test: do not depend on DBUG trace stuff
in test

Benchmark results: each test eats less CPU and you can have more
parallel jobs in MTR.

patched:
./mtr -mem -par=8 -suite=innodb  185.34s user 86.85s system 133% cpu 3:23.27 total
./mtr -mem -par=8 -suite=main    80.96s  user 36.01s system 182% cpu 1:04.07 total

main.select                              [ pass ]   1660
main.select                              [ pass ]   1513
main.select                              [ pass ]   1543
main.select                              [ pass ]   1660
main.select                              [ pass ]   1521
main.select                              [ pass ]   1511
main.select                              [ pass ]   1508
main.select                              [ pass ]   1520
main.select                              [ pass ]   1514
main.select                              [ pass ]   1522

vanilla:
./mtr -mem -par=8 -suite=innodb  203.61s user 92.16s system 140% cpu 3:30.16 total
./mtr -mem -par=8 -suite=main    94.11s  user 35.51s system 206% cpu 1:02.69 total

main.select                              [ pass ]   2032
main.select                              [ pass ]   2017
main.select                              [ pass ]   2040
main.select                              [ pass ]   2183
main.select                              [ pass ]   2253
main.select                              [ pass ]   2075
main.select                              [ pass ]   2109
main.select                              [ pass ]   2080
main.select                              [ pass ]   2098
main.select                              [ pass ]   2114
2020-04-29 20:13:14 +03:00
Marko Mäkelä
37c14690fc Merge 10.4 into 10.5 2020-03-30 19:07:25 +03:00
Marko Mäkelä
e2f1f88fa6 Merge 10.3 into 10.4 2020-03-30 14:50:23 +03:00
Marko Mäkelä
1a9b6c4c7f Merge 10.2 into 10.3 2020-03-30 11:12:56 +03:00
Eugene Kosov
a7cbce06d4 unoptimized -fsanitize=undefined build on clang requires more stack space 2020-03-23 17:42:57 +03:00
Varun Gupta
b753ac066b MDEV-21580: Allow packed sort keys in sort buffer
This task deals with packing the sort key inside the sort buffer, which  would
lead to efficient usage of the memory allocated for the sort buffer.

The changes brought by this feature are
  1) Sort buffers would have sort keys of variable length
  2) The format for sort keys inside the sort buffer would look like
     |<sort_length><null_byte><key_part1><null_byte><key_part2>.......|
      sort_length is the extra bytes that are required to store the variable
      length of a sort key.
  3) When packing of sort key is done we store the ORIGINAL VALUES inside
     the sort buffer and not the STRXFRM form (mem-comparable sort keys).
  4) Special comparison function packed_keys_comparison() is introduced
     to compare 2 sort keys.

This patch also contains contributions from Sergei Petrunia.
2020-03-10 15:09:17 +05:30
Daniel Black
6610532170 Update install layout to account for multi-arch setup
Cleanup install_layout to account for multi-arch setup and remove
redundant defines in debian rules.

Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
2020-03-08 09:25:22 +02:00
Sergey Vojtovich
daaa881cfe libpmem cmake macros
Also added support for MAP_SYNC. It allows to achieve decent performance
with DAX devices even when libpmem is unavailable.

Fixed Windows version of my_msync(): according to manual FlushViewOfFile()
may return before flush is actually completed. It is advised to issue
FlushFileBuffers() after FlushViewOfFile().
2020-02-04 23:23:50 +04:00
Alexey Botchkov
9dadfdcde5 MDEV-14024 PCRE2.
Related changes in the server code.
2019-12-21 10:34:02 +01:00
Vladislav Vaintroub
00ee8d85c9 MDEV-16264: Add threadpool library
The library is capable of
- asynchronous execution of tasks (and optionally waiting for them)
- asynchronous file IO
  This is implemented using libaio on Linux and completion ports on
  Windows. Elsewhere, async io is "simulated", which means worker threads
  are performing synchronous IO.
- timers, scheduling work asynchronously in some point of the future.
  Also periodic timers are implemented.
2019-11-15 16:50:22 +01:00
Marko Mäkelä
780d2bb8a7 Merge 10.4 into 10.5 2019-09-06 14:25:20 +03:00
Sergei Golubchik
6afe013cde always build wsrep libraries static
even if -DBUILD_SHARED_LIBS=ON was used
2019-08-26 23:33:42 +02:00
Sergei Golubchik
58bfe9da54 cleanup: SECURITY_HARDENED in CMakeLists.txt 2019-08-26 23:33:42 +02:00
Marko Mäkelä
efb8485d85 Merge 10.3 into 10.4, except for MDEV-20265
The MDEV-20265 commit e746f451d5
introduces DBUG_ASSERT(right_op == r_tbl) in
st_select_lex::add_cross_joined_table(), and that assertion would
fail in several tests that exercise joins. That commit was skipped
in this merge, and a separate fix of MDEV-20265 will be necessary in 10.4.
2019-08-23 08:06:17 +03:00
Marko Mäkelä
32ec5fb979 Merge 10.2 into 10.3 2019-08-21 15:23:45 +03:00
Marko Mäkelä
68e6c2d768 MDEV-20377: Introduce cmake -DWITH_MSAN:BOOL=ON
MemorySanitizer is a compile-time instrumentation layer in clang and GCC.
Together with AddressSanitizer mostly makes the run-time instrumentation
of Valgrind redundant. It is a little more tricky to set up, because
running with uninstrumented libraries will lead into false positives.

You will need an instrumented libc++, and you should use
-stdlib=libc++ instead of the default libstdc++. To build the
instrumented library, you can refer to
https://github.com/google/sanitizers/wiki/MemorySanitizerLibcxxHowTo
or you can adapt these steps that worked for me, for clang-8 version 8.0.1:

cd /mariadb
sudo apt source libc++-8-dev
cd llvm-toolchain-8-8.0.1
mkdir libc++msan; cd libc++msan
cmake ../libcxx -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_SANITIZER=Memory \
-DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8

Then, in your MariaDB build directory, you have to compile with
libc++ and bundled libraries, such as WITH_SSL=bundled, WITH_ZLIB=bundled.
For uninstrumented system libraries, you will get false positives for
uninitialized values. Like this:

cmake -DWITH_MSAN=ON -DWITH_SSL=bundled -DWITH_ZLIB=bundled \
-DCMAKE_CXX_FLAGS='-stdlib=libc++' ..

Note: you should also add -O2 to the compiler options, or you may
get crashes due to stack overflow.

Finally, to run tests, you must replace libc++ with the instrumented one:

LD_LIBRARY_PATH=/mariadb/llvm-toolchain-8-8.0.1/libc++msan/lib \
MSAN_OPTIONS=abort_on_error=1 \
./mtr --big-test --parallel=auto --force --retry=0

Failure to do so will report numerous false positives related to
operations on std::string and the like.

This is work in progress. Some issues will still have to be fixed
for WITH_MSAN to be usable. See MDEV-20377 for details.
2019-08-19 20:56:26 +03:00
Marko Mäkelä
624dd71b94 Merge 10.4 into 10.5 2019-08-13 18:57:00 +03:00
Marko Mäkelä
e9c1701e11 Merge 10.3 into 10.4 2019-07-25 18:42:06 +03:00
Sergei Golubchik
d78a14c599 cmake 3.14.3 warnings 2019-07-12 19:38:10 +02:00
Marko Mäkelä
3c88ce4cd1 Merge 10.4 into 10.5 2019-06-18 11:30:06 +03:00
Rasmus Johansson
24503d5711 MDEV-17592 Create MariaDB named commands/symlinks 2019-06-17 12:26:26 +02:00
Oleksandr Byelkin
f66d1850ac Merge branch '10.3' into 10.4 2019-06-14 22:10:50 +02:00
Oleksandr Byelkin
4a3d51c76c Merge branch '10.2' into 10.3 2019-06-14 07:36:47 +02:00
Marko Mäkelä
4bbd8be482 Merge 10.1 into 10.2 2019-06-12 10:30:01 +03:00
Sergey Vojtovich
e7695f95ae MDEV-19360 - Disable _FORTIFY_SOURCE for ASAN builds
Those two may work incorrectly together. Namely, ASAN may produce
false positives or false negatives. For details see
https://github.com/google/sanitizers/wiki/AddressSanitizer#faq

Make SECURITY_HARDENED disabled by default if WITH_ASAN=ON

Based on contribution by Eugene Kosov.
2019-06-07 12:47:41 +04:00
Marko Mäkelä
c0cd662b98 Merge 10.4 to 10.5 2019-05-27 11:08:51 +03:00
Vladislav Vaintroub
5f18bd3a35 Add new option NOT_EMBEDDED, for plugins
Means, plugin will not be available in embedded, even if compiled-in
2019-05-26 19:20:35 +02:00
Marko Mäkelä
826f9d4f7e Merge 10.4 into 10.5 2019-05-23 10:32:21 +03:00
Monty
ebfe8c4e0e Make it trivial to get stack traces from external programs.
To get a stacktrace in a program like aria_chk, one only have to do:

#include <my_stacktrace.h>

call my_init_stacktrace(1) in main().
2019-05-23 02:28:23 +03:00
Vladislav Vaintroub
5e4b657dd4 MDEV-18531 : Use WolfSSL instead of YaSSL as "bundled" SSL/encryption library
- Add new submodule for WolfSSL
- Build and use wolfssl and wolfcrypt instead of yassl/taocrypt
- Use HAVE_WOLFSSL instead of HAVE_YASSL
- Increase MY_AES_CTX_SIZE, to avoid compile time asserts in my_crypt.cc
(sizeof(EVP_CIPHER_CTX) is larger on WolfSSL)
2019-05-22 13:48:25 +02:00
Oleksandr Byelkin
c07325f932 Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
Marko Mäkelä
be85d3e61b Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
Vladislav Vaintroub
06b50da770 Fix typo THRASH_FREED_MEMORY->TRASH_FREED_MEMORY 2019-05-13 14:54:35 +00:00
Marko Mäkelä
26a14ee130 Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
Vladislav Vaintroub
0c188d5efc Make TRASH_FREED_MEMORY a cmake option, similar to SAFEMALLOC 2019-05-13 10:08:42 +00:00