summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.4 into 10.5Marko Mäkelä2020-07-201-3/+5
|\
| * Merge 10.3 into 10.4Marko Mäkelä2020-07-201-3/+5
| |\
| | * Merge 10.2 into 10.3Marko Mäkelä2020-07-201-3/+5
| | |\
| | | * MDEV-20401: Server incorrectly auto-sets lower_case_file_system valueJulius Goryavsky2020-07-161-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Server auto-sets lower_case_file_system value based on default datadir's behavior instead of instead of using the directory specified by the user through the configuration file or command line options. This patch fixes this problem.
| * | | Merge 10.3 into 10.4Marko Mäkelä2020-07-021-0/+2
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2020-07-021-0/+2
| | |\ \ | | | |/
| | | * MDEV-20377: Make WITH_MSAN more usableMarko Mäkelä2020-07-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | MDEV-23038 Service registered with deprecated "mysqld.exe --install" crashes ↵Vladislav Vaintroub2020-06-291-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on startup Services, which is registered with 2 arguments "C:\path\to\mysqld.exe service_name" would pass non-null terminated command line to win_main(), and this would crash in defaults handling. Make sure win_main() gets null-terminated argv.
* | | | more "removed" mysqld command-line optionsSergei Golubchik2020-06-181-78/+65
| | | | | | | | | | | | | | | | and put them all together in mysqld.cc
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-05-311-1/+0
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2020-05-301-1/+0
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2020-05-291-1/+0
| | |\ \ | | | |/
| | | * Revert "MDEV-12445 : Rocksdb does not shutdown worker threads and aborts in ↵Sergei Golubchik2020-05-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | memleak check on server shutdown" This reverts commit 6f1f9114971c3c158e9ac97313c92a24f6554415. because it doesn't do anything now (the server doesn't check my_disable_leak_check) and it never did anything before (because without `extern` it simply created a local instance of my_disable_leak_check, did not affect server's my_disable_leak_check).
* | | | Merge remote-tracking branch 'origin/10.4' into 10.5Alexander Barkov2020-05-191-1/+1
|\ \ \ \ | |/ / /
| * | | Merge remote-tracking branch 'origin/10.3' into 10.4Alexander Barkov2020-05-191-1/+1
| |\ \ \ | | |/ /
| | * | MDEV-22615 system_time_zone may be incorrectly reported as "unknown".Vladislav Vaintroub2020-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TIME_ZONE_ID_UNKNOWN return code from GetDynamicTimeZoneInformation() does not mean failure. It only means, daylight saving dates in the returned strct are not valid. TIME_ZONE_ID_INVALID means failure, in this case "unknown" should be returned
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-05-131-1/+5
|\ \ \ \ | |/ / /
| * | | MDEV-22487 WolfSSL - server prints "Please supply a buffer for error string"Vladislav Vaintroub2020-05-071-1/+5
| | | | | | | | | | | | | | | | Supplied buffer for error string, on WolfSSL's request.
* | | | Move all thread cache specific code to a new classSergey Vojtovich2020-05-061-121/+19
| | | | | | | | | | | | | | | | | | | | Part of MDEV-18353 - Shutdown may miss to wait for connection thread
* | | | MDEV-22437 make THR_THD* variable thread_localEugene Kosov2020-05-051-14/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now all access goes through _current_thd() and set_current_thd() functions. Some functions like THD::store_globals() can not fail now.
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-04-291-5/+5
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2020-04-271-5/+5
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2020-04-271-1/+3
| | |\ \ | | | |/
| | | * Merge 10.1 into 10.2Marko Mäkelä2020-04-271-1/+3
| | | |\
| | | | * MDEV-22271 Excessive stack memory usage due to WSREP_LOGSergei Golubchik2020-04-271-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix embedded innodb_plugin tests followup for 7198c6ab2dc
| | | | * MDEV-22203: WSREP_ON is unnecessarily expensive to evaluateMarko Mäkelä2020-04-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a backport of the applicable part of commit 93475aff8de80a0ef53cbee924bcb70de6e86f2c and commit 2c39f69d34e64a5cf94720e82e78c0ee91bd4649 from 10.4. Before 10.4 and Galera 4, WSREP_ON is a macro that points to a global Boolean variable, so it is not that expensive to evaluate, but we will add an unlikely() hint around it. WSREP_ON_NEW: Remove. This macro was introduced in commit c863159c320008676aff978a7cdde5732678f975 when reverting WSREP_ON to its previous definition. We replace some use of WSREP_ON with WSREP(thd), like it was done in 93475aff8de80a0ef53cbee924bcb70de6e86f2c. Note: the macro WSREP() in 10.1 is equivalent to WSREP_NNULL() in 10.4. Item_func_rand::seed_random(): Avoid invoking current_thd when WSREP is not enabled.
| | | | * MDEV-22271: Follow-up fix of --embeddedMarko Mäkelä2020-04-271-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 7198c6ab2dc8f8286f6732824ab985a76ebaaddc the ./mtr --embedded tests would fail to start innodb_plugin because of an undefined reference to the symbol wsrep_log(). Let us define a stub for that function. The embedded server is never built WITH_WSREP, but there are no separate storage engine builds for the embedded server. Hence, by default, the dynamic InnoDB storage engine plugin would be built WITH_WSREP and it would fail to load into the embedded server library due to a reference to the undefined symbol.
| | * | | After-merge fixMarko Mäkelä2020-04-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysqld_exit(): Change the assertion failure on global_status_var.global_memory_used == 0 to fprintf, like in 0bcb65d358087bf94e217254f812f913343a6f5d It appears that in some cases, that variable may be nonzero even when LeakSanitizer (WITH_ASAN) would not report errors. This was observed in 10.4 88cf6f1c7ff5d56138c8b53a5adaca4c61752f86 with the MDEV-22348 test case (Aria startup failure when running main.default_storage_engine).
* | | | | Merge 10.4 into 10.5Marko Mäkelä2020-04-251-22/+23
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | The functional changes of commit 5836191c8f0658d5d75484766fdcc3d838b0a5c1 (MDEV-21168) are omitted due to MDEV-742 having addressed the issue.
| * | | | MDEV-22203: WSREP_ON is unnecessarily expensive WITH_WSREP=OFFMarko Mäkelä2020-04-241-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the server is compiled WITH_WSREP=OFF, we should avoid evaluating conditions on a global variable that is constant. WSREP_ON_: Renamed from WSREP_ON. Defined only WITH_WSREP=ON. WSREP_ON: Defined as unlikely(WSREP_ON_). wsrep_on(): Defined as WSREP_ON && wsrep_service->wsrep_on_func(). The reason why we have wsrep_on() at all is that the macro WSREP(thd) depends on the definition of THD, and that is intentionally an opaque data type for InnoDB. So, we cannot avoid invoking wsrep_on(), but we can evaluate the less expensive condition WSREP_ON before calling the function.
| * | | | MDEV-22203: WSREP_ON is unnecessarily expensive to evaluateJan Lindström2020-04-241-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced WSREP_ON macro by single global variable WSREP_ON that is then updated at server statup and on wsrep_on and wsrep_provider update functions.
| * | | | Merge 10.3 into 10.4Marko Mäkelä2020-04-221-6/+2
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.2 into 10.3Marko Mäkelä2020-04-221-6/+2
| | |\ \ \ | | | |/ /
| | | * | Don't write warning about uninitialized mutex if there is a memory leakMonty2020-04-181-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of: MDEV-21056 Assertion `global_status_var.global_memory_used == 0' failed upon shutdown after query with DEFAULT on a geometry field Fixed by changing the ASSERT for memory leaks to a printf() on stderr. This has needed as all mutex in mysys has been deleted and we can't call functions like my_open() anymore. Also added printing of leaks if safemalloc is used (like we do in 10.5)
| * | | | Shrink my_atomic.h and my_cpu.h scopeSergey Vojtovich2020-04-151-0/+1
| | | | |
| * | | | slave_open_temp_tables to Atomic_counterSergey Vojtovich2020-04-151-15/+3
| | | | |
* | | | | Updated client and server to use new binary names in --debug tracesMonty2020-04-191-2/+2
| | | | |
* | | | | MDEV-22214 mariadbd.exe calls function mysqld.exe, and crashesVladislav Vaintroub2020-04-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stop linking plugins to the server executable on Windows. Instead, extract whole server functionality into a large DLL, called server.dll. Link both plugins, and small server "stub" exe to it. This eliminates plugin dependency on the name of the server executable. It also reduces the size of the packages (since tiny mysqld.exe and mariadbd.exe are now both linked to one big DLL) Also, simplify the functionality of exporing all symbols from selected static libraries. Rely on WINDOWS_EXPORT_ALL_SYMBOLS, rather than old self-backed solution. fix compile error replace GetProcAddress(GetModuleHandle(NULL), "variable_name") for server exported data with actual variable names. Runtime loading was never required,was error prone , since symbols could be missing at runtime, and now it actually failed, because we do not export symbols from executable anymore, but from a shared library This did require a MYSQL_PLUGIN_IMPORT decoration for the plugin, but made the code more straightforward, and avoids missing symbols at runtime (as mentioned before). The audit plugin is still doing some dynamic loading, as it aims to work cross-version. Now it won't work cross-version on Windows, as it already uses some symbols that are *not* dynamically loaded, e.g fn_format and those symbols now exported from server.dll , when earlier they were exported by mysqld.exe Windows, fixes for storage engine plugin loading after various rebranding stuff Create server.dll containing functionality of the whole server make mariadbd.exe/mysqld.exe a stub that is only calling mysqld_main() fix build
* | | | | HAVE_LARGE_PAGES no longer globalDaniel Black2020-04-051-2/+0
| | | | |
* | | | | Simplified away my_get_large_page_size()Sergey Vojtovich2020-04-041-5/+0
| | | | |
* | | | | HAVE_LARGE_PAGE_OPTION to HAVE_LARGE_PAGESSergey Vojtovich2020-04-041-2/+2
| | | | | | | | | | | | | | | | | | | | It isn't an "option" anymore.
* | | | | Coding style fixesSergey Vojtovich2020-04-041-2/+4
| | | | |
* | | | | Merge pull request #1221 from ↵Daniel Black2020-04-021-69/+15
| | | | | | | | | | | | | | | | | | | | | | | | | grooverdan/10.4-MDEV-18851-multiple-sized-large-page-support MDEV-18851: multiple sized large page support (linux)
* | | | | Merge 10.4 into 10.5Marko Mäkelä2020-03-301-1/+11
|\ \ \ \ \ | |/ / / /
| * | | | num_worker_threads my_atomic to Atomic_counterSergey Vojtovich2020-03-271-1/+11
| | | | |
* | | | | MDEV-20377: Make WITH_MSAN more usableMarko Mäkelä2020-03-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MemorySanitizer (clang -fsanitize=memory) requires that all code be compiled with instrumentation enabled. The C runtime library is an exception. 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. The following cmake options were tested: -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 in the future, __msan_unpoison(). For now, neither MEM_MAKE_DEFINED() nor MEM_UNDEFINED() perform any action under MSAN. Enabling them will catch more bugs, but will also require some more fixes or work-arounds. Json_writer::add_double(): Work around a frequently occurring failure in optimizer tests, related to EXPLAIN FORMAT=JSON. dtoa(): Disable MSAN altogether. For some reason, this function is triggering a lot of trouble, especially when invoked for DBUG functions. The MDL default timeout is dd=86400 seconds, and for some reason it is claimed to be uninitialized. InnoDB: Define UNIV_DEBUG_VALGRIND also WITH_MSAN. 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.
* | | | | mysqld --help will now load mysqld.options tableMonty2020-03-241-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes: - Initalize Aria early to allow it to load mysql.plugin table with --help - Don't print 'aborting' when doing --help - Don't write 'loose' error messages on log_warning < 2 (2 is default) - Don't write warnings about disabled plugings when doing --help - Don't write aria_log_control or aria log files when doing --help - When using --help, open all Aria tables in read only mode (safety) - If aria_init() fails, do a cleanup(). (Frees used memory) - If aria_log_control is locked with --help, then don't wait 30 seconds but instead return at once without initialzing Aria plugin.
* | | | | Merge 10.4 into 10.5Marko Mäkelä2020-03-231-2/+2
|\ \ \ \ \ | |/ / / /
| * | | | global_query_id: my_atomic to Atomic_counterSergey Vojtovich2020-03-211-1/+1
| | | | |
| * | | | tc_active_instances: my_atomic to std::atomicSergey Vojtovich2020-03-211-1/+1
| | | | |