summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* | 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)
* | Merge 10.1 into 10.2Marko Mäkelä2020-03-201-3/+3
|\ \ | |/
| * all status variables above `questions` MUST be ulongSergei Golubchik2020-03-141-3/+3
| | | | | | | | see e.g. `add_to_status()`
* | MDEV-18027: Running out of file descriptors and eventual crashOleksandr Byelkin2020-02-051-3/+11
| | | | | | | | For automatic number of opened files limit take into account number of table instances for table cache
* | Merge branch '10.1' into 10.2Oleksandr Byelkin2019-12-031-2/+2
|\ \ | |/
| * Merge branch '5.5' into 10.1Oleksandr Byelkin2019-12-031-2/+2
| |\
| | * Using `variables` instead of `values` in mysqld --help documentation would ↵Anel Husakovic2019-12-021-1/+1
| | | | | | | | | | | | be more accurate
* | | MDEV-20778 UBSAN: call to function free_rpl_filter() through pointer to ↵Eugene Kosov2019-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | incorrect function type Proper C-style type erasure is done via void*, not via char* or something else. free_key_cache() free_rpl_filter(): types were fixed to avoid function pointer type cast which is still undefined behavior. Note, that casting from void* to any other pointer type is safe and correct.
* | | Fix -Wunused for CMAKE_BUILD_TYPE=RelWithDebInfoMarko Mäkelä2019-09-301-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | For release builds, do not declare unused variables. unpack_row(): Omit a debug-only variable from WSREP diagnostic message. create_wsrep_THD(): Fix -Wmaybe-uninitialized for the PSI_thread_key.
* | | Updated mtr files to support different compiled in optionsMonty2019-09-011-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows one to run the test suite even if any of the following options are changed: - character-set-server - collation-server - join-cache-level - log-basename - max-allowed-packet - optimizer-switch - query-cache-size and query-cache-type - skip-name-resolve - table-definition-cache - table-open-cache - Some innodb options etc Changes: - Don't print out the value of system variables as one can't depend on them to being constants. - Don't set global variables to 'default' as the default may not be the same as the test was started with if there was an additional option file. Instead save original value and reset it at end of test. - Test that depends on the latin1 character set should include default_charset.inc or set the character set to latin1 - Test that depends on the original optimizer switch, should include default_optimizer_switch.inc - Test that depends on the value of a specific system variable should set it in the test (like optimizer_use_condition_selectivity) - Split subselect3.test into subselect3.test and subselect3.inc to make it easier to set and reset system variables. - Added .opt files for test that required specfic options that could be changed by external configuration files. - Fixed result files in rockdsb & tokudb that had not been updated for a while.
* | | MDEV-19746: Galera test failures because of wsrep_slave_threads identificationJan Lindström2019-07-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that tests select INFORMATION_SCHEMA.PROCESSLIST processes from user system user and empty state. Thus, there is not clear state for slave threads. Changes: - Added new status variables that store current amount of applier threads (wsrep_applier_thread_count) and rollbacker threads (wsrep_rollbacker_thread_count). This will make clear how many slave threads of certain type there is. - Added THD state "wsrep applier idle" when applier slave thread is waiting for work. This makes finding slave/applier threads easier. - Added force-restart option for mtr to always restart servers between tests to avoid race on start of the test - Added wait_condition_with_debug to wait until the passed statement returns true, or the operation times out. If operation times out, the additional error statement will be executed Changes to be committed: new file: mysql-test/include/force_restart.inc new file: mysql-test/include/wait_condition_with_debug.inc modified: mysql-test/mysql-test-run.pl modified: mysql-test/suite/galera/disabled.def modified: mysql-test/suite/galera/r/MW-336.result modified: mysql-test/suite/galera/r/galera_kill_applier.result modified: mysql-test/suite/galera/r/galera_var_slave_threads.result new file: mysql-test/suite/galera/t/MW-336.cnf modified: mysql-test/suite/galera/t/MW-336.test modified: mysql-test/suite/galera/t/galera_kill_applier.test modified: mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test modified: mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test modified: mysql-test/suite/galera/t/galera_var_slave_threads.test modified: mysql-test/suite/wsrep/disabled.def modified: mysql-test/suite/wsrep/r/variables.result modified: mysql-test/suite/wsrep/t/variables.test modified: sql/mysqld.cc modified: sql/wsrep_mysqld.cc modified: sql/wsrep_mysqld.h modified: sql/wsrep_thd.cc modified: sql/wsrep_var.cc
* | | Support skip-plugin-loadMonty2019-06-061-0/+2
| | | | | | | | | | | | | | | - --disable-plugin-load or --skip-plugin-load will now reset plugin load list. Needed for future changes to mtr tests
* | | Ensure that tests and programs can restore variablesMonty2019-06-031-2/+4
| | | | | | | | | | | | | | | | | | | | | - --default-character-set can now be disabled in mysqldump - --skip-resolve can be be disabled in mysqld - mysql_client_test now resets global variables it changes - mtr couldn't handle [mysqldump] in config files (wrong regexp used)
* | | MDEV-19472: eq_range_index_dive_limit cannot be configured in server.cnfVarun Gupta2019-05-171-1/+0
| | | | | | | | | | | | Fixed, now server can be configured with eq_range_index_dive_limit set in cnf file
* | | Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
|\ \ \ | |/ /
| * | Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| |\ \ | | |/
| | * Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | | | | | | | | | * Update wrong zip-code
* | | Merge branch '10.1' into 10.2Oleksandr Byelkin2019-05-041-12/+36
|\ \ \ | |/ /
| * | MDEV-19243 Fix timezone handling on Windows to report standard timezone namesVladislav Vaintroub2019-04-301-13/+36
| | |
* | | Merge 10.1 into 10.2Marko Mäkelä2019-03-271-1/+2
|\ \ \ | |/ /
| * | Merge 10.0 into 10.1Marko Mäkelä2019-03-271-1/+2
| |\ \
| | * \ Merge 5.5 into 10.0bb-10.0-mergeMarko Mäkelä2019-03-261-1/+2
| | |\ \ | | | |/
| | | * MDEV-17119 replicate_rewrite_db does not work for single chardatabase namesachin2019-03-221-1/+2
| | | | | | | | | | | | | | | | Fixed issue in logic.
* | | | Merge branch '10.1' into 10.2Sergei Golubchik2019-03-151-1/+1
|\ \ \ \ | |/ / /
| * | | MDEV-14033: wsrep_on=off + binlog = mixed on MariaDB 10.2.9Jan Lindström2019-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | If wsrep provider (i.e. galera library) is defined but wsrep_on=OFF we should not force row binlog row format.
| * | | MDEV-9519: Data corruption will happen on the Galera cluster size changeJulius Goryavsky2019-02-251-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we have a 2+ node cluster which is replicating from an async master and the binlog_format is set to STATEMENT and multi-row inserts are executed on a table with an auto_increment column such that values are automatically generated by MySQL, then the server node generates wrong auto_increment values, which are different from what was generated on the async master. In the title of the MDEV-9519 it was proposed to ban start slave on a Galera if master binlog_format = statement and wsrep_auto_increment_control = 1, but the problem can be solved without such a restriction. The causes and fixes: 1. We need to improve processing of changing the auto-increment values after changing the cluster size. 2. If wsrep auto_increment_control switched on during operation of the node, then we should immediately update the auto_increment_increment and auto_increment_offset global variables, without waiting of the next invocation of the wsrep_view_handler_cb() callback. In the current version these variables retain its initial values if wsrep_auto_increment_control is switched on during operation of the node, which leads to inconsistent results on the different nodes in some scenarios. 3. If wsrep auto_increment_control switched off during operation of the node, then we must return the original values of the auto_increment_increment and auto_increment_offset global variables, as the user has set. To make this possible, we need to add a "shadow copies" of these variables (which stores the latest values set by the user). https://jira.mariadb.org/browse/MDEV-9519
* | | | Make a size_t-to-uint conversion explicitMarko Mäkelä2019-03-041-2/+2
| | | |
* | | | bugfix: set mysql_real_data_home_len correctlySergei Golubchik2019-03-011-0/+2
| | | | | | | | | | | | | | | | after mysql_real_data_home was updated in get_options()
* | | | MDEV-9519: Data corruption will happen on the Galera cluster size changeJulius Goryavsky2019-02-261-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we have a 2+ node cluster which is replicating from an async master and the binlog_format is set to STATEMENT and multi-row inserts are executed on a table with an auto_increment column such that values are automatically generated by MySQL, then the server node generates wrong auto_increment values, which are different from what was generated on the async master. In the title of the MDEV-9519 it was proposed to ban start slave on a Galera if master binlog_format = statement and wsrep_auto_increment_control = 1, but the problem can be solved without such a restriction. The causes and fixes: 1. We need to improve processing of changing the auto-increment values after changing the cluster size. 2. If wsrep auto_increment_control switched on during operation of the node, then we should immediately update the auto_increment_increment and auto_increment_offset global variables, without waiting of the next invocation of the wsrep_view_handler_cb() callback. In the current version these variables retain its initial values if wsrep_auto_increment_control is switched on during operation of the node, which leads to inconsistent results on the different nodes in some scenarios. 3. If wsrep auto_increment_control switched off during operation of the node, then we must return the original values of the auto_increment_increment and auto_increment_offset global variables, as the user has set. To make this possible, we need to add a "shadow copies" of these variables (which stores the latest values set by the user). https://jira.mariadb.org/browse/MDEV-9519
* | | | MDEV-17479 Assertion `mysql_socket.fd != -1' failed in ↵Vladislav Vaintroub2019-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | inline_mysql_socket_send on server shutdown Do not try to write ER_SHUTDOWN error message to socket, when it is forcefully closed by the shutdown. This will avoid the race condition (attempt to write to closed socket, if connection shuts down by itself).
* | | | Merge 10.1 into 10.2Marko Mäkelä2018-11-061-0/+12
|\ \ \ \ | |/ / /
| * | | Merge branch '10.0' into 10.1Sergei Golubchik2018-10-301-0/+12
| |\ \ \ | | |/ /
| | * | Fix typo in 5936d43afb6ad5a75d9eed17eb39e8c00a08a684Marko Mäkelä2018-10-121-1/+1
| | | |
| | * | threadpool_size can contribute to the wanted_filesDaniel Black2018-10-121-0/+4
| | | |
| | * | MDEV-17413 Crash in my_malloc_size_cb_func() during shutdown withVladislav Vaintroub2018-10-091-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | forceful connection close. Fix is to ensure that when close_connection() is called from shutdown thread, current_thd is set. This that allocation callback for THD specific memory won't assert(in debug version), or crash (in 10.1 and later) close_connection() allocates THD specific memory e.g when it writes the final error packet, and compression is ON for the connection.
* | | | Merge 10.1 into 10.2Marko Mäkelä2018-10-111-7/+9
|\ \ \ \ | |/ / /
| * | | MDEV-17413 - Don't crash in my_malloc_size_cb_func()Vladislav Vaintroub2018-10-091-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | if thread specific memory is requested and current_thd is NULL. Leave DBUG_ASSERT() in place, to check in DBUG version.
* | | | MDEV-14581 Server does not clear diagnostics between sessionsVladislav Vaintroub2018-10-051-4/+0
| | | | | | | | | | | | | | | | | | | | Amend previous patch, so it works in all cases (also for "change user" command, and for RESET CONNECTION in 10.3)
* | | | Merge branch '10.1' into 10.2Oleksandr Byelkin2018-09-141-1/+1
|\ \ \ \ | |/ / /
| * | | MDEV-15436: If log_bin and log_bin_index is different SST with rsync fails.Jan Lindström2018-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that in SST log_bin_index name and directory was not handled and passed to rsync SST script. wsrep_sst_common.sh Read binlog index dirname and filename if --binlog-index parameter is provided. Read binlog filenames from that file from donor and write transfered binlog filenames to that file in joiner. mysqld.cc, mysqld.h Moved opt_binlog_index_name from static to global and added it to extern. wsrep_sst.cc generate_binlog_index_opt_val New function to generate binlog index name if opt_binlog_index_name is given on configuration. sst_prepare_other Add binlog index configuration to SST command. wsrep_sst.h Add new SST parameter --binlog-index Add test case.
* | | | Merge 10.1 into 10.2Marko Mäkelä2018-08-311-14/+0
|\ \ \ \ | |/ / /
| * | | Revert MDEV-9519 due to regressionsMarko Mäkelä2018-08-311-14/+0
| | | | | | | | | | | | | | | | This reverts commit 75dfd4acb995789ca5f86ccbd361fff9d2797e79.
* | | | Merge 10.1 into 10.2Marko Mäkelä2018-08-211-11/+25
|\ \ \ \ | |/ / /
| * | | Merge branch '10.0' into 10.1Oleksandr Byelkin2018-08-211-11/+11
| |\ \ \ | | |/ /
| | * | Merge branch '5.5' into 10.0Oleksandr Byelkin2018-08-151-11/+11
| | |\ \ | | | |/
| | | * MDEV-16963 Tighten named pipe access controlVladislav Vaintroub2018-08-131-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | Use real DACL instead of NULL DACL. Grant Everyone just read/write access to pipe (instead of all access like previously with NULL ACL)