summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-22387: Do not violate __attribute__((nonnull))Marko Mäkelä2020-11-021-2/+5
| | | | | | | | | | | This follows up commit commit 94a520ddbe39ae97de1135d98699cf2674e6b77e and commit 7c5519c12d46ead947d341cbdcbb6fbbe4d4fe1b. After these changes, the default test suites on a cmake -DWITH_UBSAN=ON build no longer fail due to passing null pointers as parameters that are declared to never be null, but plenty of other runtime errors remain.
* MDEV-23867: insert... select crash in compute_window_funcVarun Gupta2020-10-231-4/+5
| | | | | | | | | | | | | | | | | There are 2 issues here: Issue #1: memory allocation. An IO_CACHE that uses encryption uses a larger buffer (it needs space for the encrypted data, decrypted data, IO_CACHE_CRYPT struct to describe encryption parameters etc). Issue #2: IO_CACHE::seek_not_done When IO_CACHE objects are cloned, they still share the file descriptor. This means, operation on one IO_CACHE may change the file read position which will confuse other IO_CACHEs using it. The fix of these issues would be: Allocate the buffer to also include the extra size needed for encryption. Perform seek again after one IO_CACHE reads the file.
* compilation failure with new C/CSergei Golubchik2020-10-231-2/+5
| | | | define symbols as C/C does to avoid "macro redefined" warnings
* MDEV-23101 : SIGSEGV in lock_rec_unlock() when Galera is enabledJan Lindström2020-09-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove incorrect BF (brute force) handling from lock_rec_has_to_wait_in_queue and move condition to correct callers. Add a function to report BF lock waits and assert if incorrect BF-BF lock wait happens. wsrep_report_bf_lock_wait Add a new function to report BF lock wait. wsrep_assert_no_bf_bf_wait Add a new function to check do we have a BF-BF wait and if we have report this case and assert as it is a bug. lock_rec_has_to_wait Use new wsrep_assert_bf_wait to check BF-BF wait. lock_rec_create_low lock_table_create Use new function to report BF lock waits. lock_rec_insert_by_trx_age lock_grant_and_move_on_page lock_grant_and_move_on_rec Assert that trx is not Galera as VATS is not compatible with Galera. lock_rec_add_to_queue If there is conflicting lock in a queue make sure that transaction is BF. lock_rec_has_to_wait_in_queue Remove incorrect BF handling. If there is conflicting locks in a queue all transactions must wait. lock_rec_dequeue_from_page lock_rec_unlock If there is conflicting lock make sure it is not BF-BF case. lock_rec_queue_validate Add Galera record locking rules comment and use new function to report BF lock waits. All attempts to reproduce the original assertion have been failed. Therefore, there is no test case on this commit.
* Merge 10.1 into 10.2Marko Mäkelä2020-08-201-3/+0
|\
* | Use DBUG_ASSERT(ptr != NULL) to ease merging to 10.3Marko Mäkelä2020-08-121-2/+2
| | | | | | | | | | | | | | In 10.3, DBUG_ASSERT() may expand to something that includes __builtin_expect(), which expects integer arguments, not pointers. To avoid any compiler warnings, let us use an explicit rather than implicit comparison to the null pointer.
* | replace assert() with DBUG_ASSERT()Eugene Kosov2020-08-121-3/+5
| |
* | add debug assertion to ilistEugene Kosov2020-08-111-3/+4
| |
* | Merge 10.1 into 10.2Marko Mäkelä2020-07-141-8/+16
|\ \ | |/
| * MDEV-22173: socket accept - test for failureDaniel Black2020-07-061-8/+16
| | | | | | | | | | | | | | | | | | | | accept might return an error, including SOCKET_EAGAIN/ SOCKET_EINTR. The caller, usually handle_connections_sockets can these however and invalid file descriptor isn't something to call fcntl on. Thanks to Etienne Guesnet (ATOS) for diagnosis, sample patch description and testing.
* | MDEV-20377: Make WITH_MSAN more usableMarko Mäkelä2020-07-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MemorySanitizer (clang -fsanitize=memory) requires that all code be compiled with instrumentation enabled. The only exception is the C runtime library. Failure to use instrumented libraries will cause bogus messages about memory being uninitialized. In WITH_MSAN builds, we must avoid calling getservbyname(), because even though it is a standard library function, it is not instrumented, not even in clang 10. Note: Before MariaDB Server 10.5, ./mtr will typically fail due to the old PCRE library, which was updated in MDEV-14024. The following cmake options were tested on 10.5 in commit 94d0bb4dbeb28a94d1f87fdd55f4297ff3df0157: cmake \ -DCMAKE_C_FLAGS='-march=native -O2' \ -DCMAKE_CXX_FLAGS='-stdlib=libc++ -march=native -O2' \ -DWITH_EMBEDDED_SERVER=OFF -DWITH_UNIT_TESTS=OFF -DCMAKE_BUILD_TYPE=Debug \ -DWITH_INNODB_{BZIP2,LZ4,LZMA,LZO,SNAPPY}=OFF \ -DPLUGIN_{ARCHIVE,TOKUDB,MROONGA,OQGRAPH,ROCKSDB,CONNECT,SPIDER}=NO \ -DWITH_SAFEMALLOC=OFF \ -DWITH_{ZLIB,SSL,PCRE}=bundled \ -DHAVE_LIBAIO_H=0 \ -DWITH_MSAN=ON MEM_MAKE_DEFINED(): An alias for VALGRIND_MAKE_MEM_DEFINED() and __msan_unpoison(). MEM_GET_VBITS(), MEM_SET_VBITS(): Aliases for VALGRIND_GET_VBITS(), VALGRIND_SET_VBITS(), __msan_copy_shadow(). InnoDB: Replace the UNIV_MEM_ macros with corresponding MEM_ macros. ut_crc32_8_hw(), ut_crc32_64_low_hw(): Use the compiler built-in functions instead of inline assembler when building WITH_MSAN. This will require at least -msse4.2 when building for IA-32 or AMD64. The inline assembler would not be instrumented, and would thus cause bogus failures.
* | fix compilation with VS2019, preview of 16.7 versionEugene Kosov2020-06-051-2/+8
| | | | | | | | | | | | | | | | | | Compiler tells something about argument-dependent lookup. I do not understand how that ADL works. But I know that such operators should be free functions, instead of methods: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Ro-symmetric Such syntax defines 'friend' free functions.
* | MDEV-22721 Remove bloat caused by InnoDB logger classMarko Mäkelä2020-06-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new ATTRIBUTE_NOINLINE to ib::logger member functions, and add UNIV_UNLIKELY hints to callers. Also, remove some crash reporting output. If needed, the information will be available using debugging tools. Furthermore, remove some fts_enable_diag_print output that included indexed words in raw form. The code seemed to assume that words are NUL-terminated byte strings. It is not clear whether a NUL terminator is always guaranteed to be present. Also, UCS2 or UTF-16 strings would typically contain many NUL bytes.
* | fix compilationEugene Kosov2020-05-271-23/+18
| |
* | Fix the build with GCC 4.1.2Marko Mäkelä2020-05-271-6/+11
| | | | | | | | | | | | The build was broken on CentOS 5 and CentOS 6 as a result of commit 18d8f06f31cbe3913e1c80c0c5120f23e036bd3e introducing some constructs that old GCC versions could not cope with.
* | Fix the RelWithDebInfo buildMarko Mäkelä2020-05-271-1/+1
| | | | | | | | | | The build was broken in the parent commit 18d8f06f31cbe3913e1c80c0c5120f23e036bd3e.
* | intrusive::list fixesEugene Kosov2020-05-271-23/+78
| | | | | | | | | | | | | | | | | | | | namespace intrusive: removed split class into two: ilist<T> and sized_ilist<T> which has a size field. ilist<T> no more NULLify pointers to bring a slignly better performance. As a consequence, fil_space_t::is_in_unflushed_spaces and fil_space_t::is_in_rotation_list boolean members are needed now.
* | MDEV-22545: my_vsnprintf behaves not as in C standardOleksandr Byelkin2020-05-241-1/+5
| | | | | | | | Added parameter %T for string which should be visibly truncated.
* | Amend af784385b4a2b286000fa2c658e34283fe7bba60: Avoid vtable overheadMarko Mäkelä2020-05-151-1/+3
| | | | | | | | | | | | When neither MSAN nor Valgrind are enabled, declare Field::mark_unused_memory_as_defined() as an empty inline function, instead of declaring it as a virtual function.
* | span cleanupEugene Kosov2020-05-151-21/+41
| |
* | Fix for using uninitialized memoryMonty2020-05-151-6/+20
| | | | | | | | | | | | | | | | | | MDEV-22073 MSAN use-of-uninitialized-value in collect_statistics_for_table() Other things: innodb.analyze_table was changed to mainly test statistic collection. Was discussed with Marko.
* | Merge branch '10.1' into 10.2Oleksandr Byelkin2020-05-021-5/+5
|\ \ | |/
| * Merge branch '5.5' into 10.1Oleksandr Byelkin2020-04-301-5/+5
| |\
| | * BUG#30301356 - SOME EVENTS ARE DELAYED AFTER DROPPING EVENTSergei Golubchik2020-04-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | queues.c cleanup and refactoring. Restore old version of _downhead() (from before cd483c55209) that works well in an average case. Use it for queue_fix(). Move existing specialized version of _downhead() to queue_replace() where it'll be handling the case it was specifically optimized for (moving the element to the end of the queue). And correct it to fix the heap not only down, but also up (this fixes BUG#30301356). Add unit tests. Collateral cosmetic fixes.
* | | add WITH_DBUG_TRACE CMake variableEugene Kosov2020-04-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | MDEV-20685: compile fixes for Solaris/OSX/AIXDaniel Black2020-04-293-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sig_return: Solaris/OSX returns different function ptr Move defination to my_alarm.h as its the only use. prevents compile warnings (copied from 10.3 branch) mysys/my_sync.c:136:19: error: 'cur_dir_name' defined but not used [-Werror=unused-const-variable=] 136 | static const char cur_dir_name[]= {FN_CURLIB, 0}; | ^~~~~~~~~~~~ fix compile error (DEPRECATED) leaked from ssl headers. In file included from /export/home/dan/mariadb-server-10.4/sql/sys_vars.cc:37: /export/home/dan/mariadb-server-10.4/sql/sys_vars.ic:69: error: "DEPRECATED" redefined [-Werror] 69 | #define DEPRECATED(X) X | In file included from /export/home/dan/mariadb-server-10.4/include/violite.h:150, from /export/home/dan/mariadb-server-10.4/sql/sql_class.h:38, from /export/home/dan/mariadb-server-10.4/sql/sys_vars.cc:36: /usr/include/openssl/ssl.h:2356: note: this is the location of the previous definition 2356 | # define DEPRECATED __attribute__((deprecated)) | Avoid Werror condition on non-Linux: plugin/server_audit/server_audit.c:2267:7: error: variable 'db_len_off' set but not used [-Werror=unused-but-set-variable] 2267 | int db_len_off; | ^~~~~~~~~~ plugin/server_audit/server_audit.c:2266:7: error: variable 'db_off' set but not used [-Werror=unused-but-set-variable] 2266 | int db_off; | ^~~~~~ auth_gssapi fix include path for Solaris Consistent with the upstream packaged patch: https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/database/mariadb-103/patches/06-gssapi.h.patch compile warnings on Solaris [ 91%] Building C object plugin/server_audit/CMakeFiles/server_audit.dir/server_audit.c.o /plugin/server_audit/server_audit.c: In function 'auditing_v8': /plugin/server_audit/server_audit.c:2194:20: error: unused variable 'db_len_off' [-Werror=unused-variable] 2194 | static const int db_len_off= 128; | ^~~~~~~~~~ /plugin/server_audit/server_audit.c:2193:20: error: unused variable 'db_off' [-Werror=unused-variable] 2193 | static const int db_off= 120; | ^~~~~~ /plugin/server_audit/server_audit.c:2192:20: error: unused variable 'cmd_off' [-Werror=unused-variable] 2192 | static const int cmd_off= 4432; | ^~~~~~~ At top level: /plugin/server_audit/server_audit.c:2192:20: error: 'cmd_off' defined but not used [-Werror=unused-const-variable=] /plugin/server_audit/server_audit.c:2193:20: error: 'db_off' defined but not used [-Werror=unused-const-variable=] 2193 | static const int db_off= 120; | ^~~~~~ /plugin/server_audit/server_audit.c:2194:20: error: 'db_len_off' defined but not used [-Werror=unused-const-variable=] 2194 | static const int db_len_off= 128; | ^~~~~~~~~~ cc1: all warnings being treated as errors tested on: $ uname -a SunOS openindiana 5.11 illumos-b97b1727bc i86pc i386 i86pc
* | | cleanup THR_KEY_mysysEugene Kosov2020-04-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | read TLS with my_thread_var write TLS with set_mysys_var() my_thread_var is no longer __attribute__ ((const)): this attribute is simply incorrect here. Read gcc manual for more information. sql/threadpool_generic.cc fails with that attribute.
* | | unoptimized -fsanitize=undefined build on clang requires more stack spaceEugene Kosov2020-03-231-1/+1
| | |
* | | st_::span fixesEugene Kosov2020-03-201-0/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | move span.h to a proper place to make it available for the whole server Reformat it. Constuctors from a contigous container are fixed to use cont.data() instead of cont.begin() span<>::index_type is replaced with span<>::size_type
* | | MDEV-21981 Replace arithmetic + with bitwise OR when possibleMarko Mäkelä2020-03-194-72/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several macros such as sint2korr() and uint4korr() are using the arithmetic + operator while a bitwise or operator would suffice. GCC 5 and clang 5 and later can detect patterns consisting of bitwise or and shifts by multiples of 8 bits, such as those used in the InnoDB function mach_read_from_4(). They actually translate that verbose low-level code into high-level machine language (i486 bswap instruction or fused into the Haswell movbe instruction). We should do the same for MariaDB Server code that is outside InnoDB. Note: The Microsoft C compiler is lacking this optimization. There, we might consider using _byteswap_ushort(), _byteswap_ulong(), _byteswap_uint64(). But, those would lead to unaligned reads, which are bad for reasons stated in MDEV-20277. Besides, outside InnoDB, most data is already being stored in the native little-endian format of that compiler.
* | | Merge branch '10.1' into 10.2Oleksandr Byelkin2020-01-2011-36/+112
|\ \ \ | |/ /
| * | Merge branch 'merge-perfschema-5.6' into 10.1Oleksandr Byelkin2020-01-1911-36/+112
| |\ \
| | * | 5.6.47Oleksandr Byelkin2020-01-1911-36/+112
| | | |
| | * | 5.6.31Sergei Golubchik2016-06-213-22/+22
| | | |
* | | | Lets add another intrusive double linked list!Eugene Kosov2020-01-041-0/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Features: * STL-like interface * Fast modification: no branches on insertion or deletion * Fast iteration: one pointer dereference and one pointer comparison * Your class can be a part of several lists Modeled after std::list<T> but currently has fewer methods (not complete yet) For even more performance it's possible to customize list with templates so it won't have size counter variable or won't NULLify unlinked node. How existing lists differ? No existing lists support STL-like interface. I_List: * slower iteration (one more branch on iteration) * element can't be a part of two lists simultaneously I_P_List: * slower modification (branches, except for the fastest push_back() case) * slower iteration (one more branch on iteration) UT_LIST_BASE_NODE_T: * slower modification (branches) Three UT_LISTs were replaced: two in fil_system_t and one in dyn_buf_t.
* | | | CONC-447 ERROR 2026 (HY000): SSL connection error: Certificate signature ↵Vladislav Vaintroub2019-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | check failed Enable CRL checking on Windows. Enable certificate verification testing in client testing.
* | | | MDEV-21082: isnan/isinf compilation errors, isfinite warnings on MacOSVlad Lesin2019-11-191-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix consists of three commits backported from 10.3: 1) Cleanup isnan() portability checks (cherry picked from commit 7ffd7fe9627d1f750a3712aebb4503e5ae8aea8e) 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 bc469a0bdf85400f7a63834f5b7af1a513dcdec9) 3) Use std::isfinite in C++ code This is addition to parent revision fixing build failures. (cherry picked from commit 54999f4e75f42baca484ae436b382ca8817df1dd)
* | | | Merge 10.1 to 10.2Marko Mäkelä2019-11-061-1/+1
|\ \ \ \ | |/ / /
| * | | Merge 5.5 into 10.1mariadb-10.1.43Marko Mäkelä2019-11-061-1/+1
| |\ \ \ | | | |/ | | |/|
| | * | MDEV-20971 ASAN heap-use-after-free in list_delete / heap_closeSergei Golubchik2019-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't save/restore HP_INFO as it could be changed by a concurrent thread. different parts of HP_INFO are protected by different mutexes and the mutex that protect most of the HP_INFO does not protect its open_list data. As a bonus, make heap_check_heap() to take const HP_INFO* and not make any changes there whatsoever.
* | | | MDEV-18562 [ERROR] InnoDB: WSREP: referenced FK check fail: Lock wait indexJan Lindström2019-10-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Lock wait can happen on secondary index when doing FK checks for wsrep. We should just return error to upper layer and applier will retry operation when needed.
* | | | Merge 10.1 into 10.2Marko Mäkelä2019-08-281-1/+1
|\ \ \ \ | |/ / /
| * | | fix clang warningsEugene Kosov2019-08-281-1/+1
| | | |
* | | | Merge 10.1 into 10.2Marko Mäkelä2019-08-121-1/+8
|\ \ \ \ | |/ / /
| * | | Merge 5.5 into 10.1Marko Mäkelä2019-08-121-1/+9
| |\ \ \ | | |/ /
| | * | Document TRASH_FILL, TRASH_ALLOC, TRASH_FREEMarko Mäkelä2019-08-121-1/+9
| | | |
| * | | imporve clang buildEugene Kosov2019-06-253-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug Maintainer mode makes all warnings errors. This patch fix warnings. Mostly about deprecated `register` keyword. Too much warnings came from Mroonga and I gave up on it.
* | | | Remove the unused function maria_cloneMarko Mäkelä2019-06-241-2/+1
| | | |
* | | | MDEV-19750 mysql command wrong encodingVladislav Vaintroub2019-06-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restore the detection of default charset in command line utilities. It worked up to 10.1, but was broken by Connector/C. Moved code for detection of default charset from sql-common/client.c to mysys, and make command line utilities to use this code if charset was not specified on the command line.
* | | | Merge branch '10.1' into 10.2Oleksandr Byelkin2019-06-131-0/+1
|\ \ \ \ | |/ / /