summaryrefslogtreecommitdiff
path: root/sql/sql_reload.cc
Commit message (Collapse)AuthorAgeFilesLines
* Set thd->query() for internal (startup) transactionsMonty2023-02-031-0/+2
| | | | | This helps with debugging as 'Query: ' in DBUG traces will show something useful, for internal transactions, instead of just "".
* Merge 10.6 into 10.7Jan Lindström2022-09-051-0/+3
|\
| * Merge 10.5 into 10.6Jan Lindström2022-09-051-0/+3
| |\
| | * Merge 10.4 into 10.5Jan Lindström2022-09-051-0/+3
| | |\
| | | * Reduce compilation dependencies on wsrep_mysqld.hDaniele Sciascia2022-08-311-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Making changes to wsrep_mysqld.h causes large parts of server code to be recompiled. The reason is that wsrep_mysqld.h is included by sql_class.h, even tough very little of wsrep_mysqld.h is needed in sql_class.h. This commit introduces a new header file, wsrep_on.h, which is meant to be included from sql_class.h, and contains only macros and variable declarations used to determine whether wsrep is enabled. Also, header wsrep.h should only contain definitions that are also used outside of sql/. Therefore, move WSREP_TO_ISOLATION* and WSREP_SYNC_WAIT macros to wsrep_mysqld.h. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* | | | Merge 10.6 into 10.7Marko Mäkelä2022-07-271-0/+2
|\ \ \ \ | |/ / /
| * | | MDEV-26456: SIGSEGV in flush_tables_with_read_lock on FLUSH TABLEOleksandr Byelkin2022-07-211-0/+2
| | | | | | | | | | | | | | | | | | | | It is legal that open table can leave unopened tables in SP and other parts of the code shoud expect it.
* | | | Failed change master could leave around old relay log filesMonty2021-09-141-1/+1
|/ / / | | | | | | | | | | | | The reason was that there where no cleanup after a failed 'change master'. Fixed by doing a cleanup of created relay log files in remove_master_info()
* | | MDEV-25906: SIGSEGV in flush_tables_with_read_lock on FTWRL or FTFE | ↵Sergei Golubchik2021-07-021-1/+1
| | | | | | | | | | | | SIGSEGV in ha_maria::extra
* | | MDEV-15888 Implement FLUSH TABLES tbl_name [, tbl_name] ... WITH READ LOCK ↵Sergei Golubchik2021-07-021-13/+13
| | | | | | | | | | | | | | | | | | for views. privilege checks for tables flushed via views
* | | MDEV-15888 Implement FLUSH TABLES tbl_name [, tbl_name] ... WITH READ LOCK ↵Alexey Botchkov2021-05-311-2/+4
|/ / | | | | | | | | | | for views. Enable the FLUSH TABLES for views. It works now.
* | Merge 10.4 into 10.5Marko Mäkelä2021-04-211-0/+8
|\ \ | |/
| * MDEV-22668: "Flush SSL" command doesn't reload wsrep certbb-10.4-MDEV-22668mkaruza2021-04-151-0/+8
| | | | | | | | | | | | | | Trigger `socket.ssl_reload` when FLUSH SSL is issued. To triger reloading of certificate, key and CA, files needs to be physically changed. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
* | Merge 10.4 to 10.5Marko Mäkelä2020-10-221-1/+9
|\ \ | |/
| * MDEV-20945: BACKUP UNLOCK + FTWRL assertion failureRinat Ibragimov2020-10-221-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-20945: BACKUP UNLOCK + FTWRL assertion failure | SIGSEGV in I_P_List from MDL_context::release_lock on INSERT w/ BACKUP LOCK (on optimized builds) | Assertion `ticket->m_duration == MDL_EXPLICIT' failed BACKUP LOCK behavior is modified so it won't be used wrong: - BACKUP LOCK should commit any active transactions. - BACKUP LOCK should not be allowed in stored procedures. - When BACKUP LOCK is active, don't allow any DDL's for that connection. - FTWRL is forbidden on the same connection while BACKUP LOCK is active. Reviewed-by: monty@mariadb.com
* | Move all thread cache specific code to a new classSergey Vojtovich2020-05-061-1/+2
| | | | | | | | | | Part of MDEV-18353 - Shutdown may miss to wait for connection thread
* | Merge 10.4 into 10.5Marko Mäkelä2020-04-251-0/+2
|\ \ | |/ | | | | | | 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 to evaluateJan Lindström2020-04-241-0/+2
| | | | | | | | | | | | 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.
* | Let "FTWRL <table_list>" use extra(HA_EXTRA_FLUSH)Sergey Vojtovich2020-04-031-9/+12
| | | | | | | | | | | | | | | | Rather than flushing caches with tdc_remove_table(TDC_RT_REMOVE_UNUSED) flush them with extra(HA_EXTRA_FLUSH) instead. This goes inline with regular FTWRL. Part of MDEV-17882 - Cleanup refresh version
* | Merge branch '10.4' into 10.5Oleksandr Byelkin2020-03-111-0/+6
|\ \ | |/
| * MDEV-20867 - Perform careful review of "Server crashes with BACKUP STAGE and ↵Sergey Vojtovich2020-02-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | FLUSH TABLE table_name" Reverted original patch (c2e0a0b). For consistency with "LOCK TABLE <table_name> READ" and "FLUSH TABLES WITH READ LOCK", which are forbidden under "BACKUP STAGE", forbid "FLUSH TABLE <table_name> FOR EXPORT" and "FLUSH TABLE <table_name> WITH READ LOCK" as well. It'd allow consistent fixes for problems like MDEV-18643.
* | Removed kill_delayed_threads_for_table()Sergey Vojtovich2019-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | After 7fb9d64 it is used only by ALTER/DROP SERVER, which most probably wasn't intentional as Federated never supported delayed inserts anyway. If delayed inserts will ever become an issue with ALTER/DROP SERVER, we should kill them by acquiring X-lock instead. Part of MDEV-17882 - Cleanup refresh version
* | MDEV-17709 Remove handlerton::stateRobert Bindar2019-06-061-1/+1
|/
* Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-8/+1
|\
| * Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
| |\
| | * 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
| * | | | MDEV-17710 "unknown error" with FLUSH LOGS if log directory is not writeableSergei Golubchik2019-05-071-7/+0
| | | | |
* | | | | MDEV-16266 - New command FLUSH SSL to reload server's SSL ↵Vladislav Vaintroub2018-12-121-0/+5
| | | | | | | | | | | | | | | | | | | | certificate(private key,CRL,etc)
* | | | | Added syntax and implementation for BACKUP STAGE'sMonty2018-12-091-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of MDEV-5336 Implement LOCK FOR BACKUP - Changed check of Global_only_lock to also include BACKUP lock. - We store latest MDL_BACKUP_DDL lock in thd->mdl_backup_ticket to be able to downgrade lock during copy_data_between_tables()
* | | | | Added new MDL_BACKUP locks for all backup stagesMonty2018-12-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of MDEV-5336 Implement LOCK FOR BACKUP - Added new locks to MDL_BACKUP for all stages of backup locks and a new MDL lock needed for backup stages. - Renamed MDL_BACKUP_STMT to MDL_BACKUP_DDL - flush_tables() takes a new parameter that decides what should be flushed. - InnoDB, Aria (transactional tables with checksums), Blackhole, Federated and Federatedx tables are marked to be safe for online backup. We are using MDL_BACKUP_TRANS_DML instead of MDL_BACKUP_DML locks for these which allows any DML's to proceed for these tables during the whole backup process until BACKUP STAGE COMMIT which will block the final commit.
* | | | | Combine GLOBAL and COMMIT namespaces into BACKUP namespace.Sergey Vojtovich2018-12-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of MDEV-5336 Implement LOCK FOR BACKUP Other things: - Added printing of MDL locks to DBUG.
* | | | | Changed FLUSH TABLES to not change share versionMonty2018-12-091-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of MDEV-5336 Implement LOCK FOR BACKUP Originally both table metadata lock and global read lock protection were acquired before getting TABLE from table cache. This will be reordered in a future commit with MDL_BACKUP_XXX locks so that we first take table metadata lock, then get TABLE from table cache, then acquire analogue of global read lock. This patch both simplifies FLUSH TABLES code, makes FLUSH TABLES to lock less and also enables FLUSH TABLES code to be used with backup locks. The usage of FLUSH TABLES changes slightly: - FLUSH TABLES without any arguments will now only close not used tables and tables locked by the FLUSH TABLES connection. All not used table shares will be closed. Tables locked by the FLUSH TABLES connection will be reopened and re-locked after all others has stoped using the table (as before). If there was no locked tables, then FLUSH TABLES is instant and will not cause any waits. FLUSH TABLES will not wait for any in use table. - FLUSH TABLES with a table list, will ensure that the tables are closed before statement returns. The code is now only using MDL locks and not table share versions, which simplices the code greatly. One visible change is that the server will wait for the end of the transaction that are using the tables. Before FLUSH TABLES only waited for the statements to end. Signed-off-by: Monty <monty@mariadb.org>
* | | | | Optimize flush tables with read lock (FTWRL) to not wait for select'sMonty2018-12-091-8/+5
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of MDEV-5336 Implement LOCK FOR BACKUP The idea is that instead of waiting in close_cached_tables() for all tables to be closed, we instead call flush_tables() that does: - Flush not used objects in table cache to free memory - Collect all tables that are open - Call HA_EXTRA_FLUSH on the objects, to get them into "closed state" - Added HA_EXTRA_FLUSH support to archive and CSV - Added multi-user protection to HA_EXTRA_FLUSH in MyISAM and Aria The benefit compared to old code is: - FTWRL doesn't have to wait for long running read operations or open HANDLER's
* | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-09-281-3/+11
|\ \ \ \ | |/ / /
| * | | Merge branch '10.1' into 10.2Oleksandr Byelkin2018-09-141-2/+11
| |\ \ \ | | |/ /
| | * | MDEV-15890 Strange error message if you try to FLUSH TABLES <view> after ↵Alexey Botchkov2018-09-021-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | LOCK TABLES <view>. Check if the argument of the FLUSH TABLE is a VIEW and handle it accordingly.
* | | | Add likely/unlikely to speed up executionMonty2018-05-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added to: - if (error) - Lex - sql_yacc.yy and sql_yacc_ora.yy - In header files to alloc() calls - Added thd argument to thd_net_is_killed()
* | | | Merge remote-tracking branch '10.2' into 10.3Vicențiu Ciorbaru2018-04-121-0/+2
|\ \ \ \ | |/ / /
| * | | MDEV-12466 : Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt ↵Sergei Petrunia2018-04-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | || ... When "FLUSH TABLE ... FOR EXPORT" fails, the SQL layer should rollback the statement. Otherwise we hit an assert when we try to close the tables while having a non-empty list of statement transaction participants.
* | | | Changed database, tablename and alias to be LEX_CSTRINGMonty2018-01-301-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was done in, among other things: - thd->db and thd->db_length - TABLE_LIST tablename, db, alias and schema_name - Audit plugin database name - lex->db - All db and table names in Alter_table_ctx - st_select_lex db Other things: - Changed a lot of functions to take const LEX_CSTRING* as argument for db, table_name and alias. See init_one_table() as an example. - Changed some function arguments from LEX_CSTRING to const LEX_CSTRING - Changed some lists from LEX_STRING to LEX_CSTRING - threads_mysql.result changed because process list_db wasn't always correctly updated - New append_identifier() function that takes LEX_CSTRING* as arguments - Added new element tmp_buff to Alter_table_ctx to separate temp name handling from temporary space - Ensure we store the length after my_casedn_str() of table/db names - Removed not used version of rename_table_in_stat_tables() - Changed Natural_join_column::table_name and db_name() to never return NULL (used for print) - thd->get_db() now returns db as a printable string (thd->db.str or "")
* | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-11-301-1/+4
|\ \ \ \
| * \ \ \ Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-11-291-1/+4
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.1' into 10.2Sergei Golubchik2017-11-211-1/+4
| | |\ \ \ | | | |/ /
| | | * | MDEV-12012/MDEV-11969 Can't remove GTIDs for a stale GTID Domain IDAndrei Elkin2017-11-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported in MDEV-11969 "there's no way to ditch knowledge" about some domain that is no longer updated on a server. Besides being of annoyance to clutter output in DBA console stale domains can prevent the slave to connect the master as MDEV-12012 witnesses. What domain is obsolete must be evaluated by the user (DBA) according to whether the domain info is still relevant and will the domain ever receive any update. This patch introduces a method to discard obsolete gtid domains from the server binlog state. The removal requires no event group from such domain present in existing binlog files though. If there are any the containing logs must be first PURGEd in order for FLUSH BINARY LOGS DELETE_DOMAIN_ID=(list-of-domains) succeed. Otherwise the command returns an error. The list of obsolete domains can be computed through intersecting two sets - the earliest (first) binlog's Gtid_list and the current value of @@global.gtid_binlog_state - and extracting the domain id components from the intersection list items. The new DELETE_DOMAIN_ID featured FLUSH continues to rotate binlog omitting the deleted domains from the active binlog file's Gtid_list. Notice though when the command is ineffective - that none of requested to delete domain exists in the binlog state - rotation does not occur. Obsolete domain deletion is not harmful for connected slaves as long as master side binlog files *purge* is synchronized with FLUSH-DELETE_DOMAIN_ID. The slaves must have the last event from purged files processed as usual, in order not to bump later into requesting a gtid from a file which was already gone. While the command is not replicated (as ordinary FLUSH BINLOG LOGS is) slaves, even though having extra domains, won't suffer from reconnection errors thanks to master-slave gtid connection protocol allowing the master to be ignorant about a gtid domain. Should at failover such slave to be promoted into master role it may run the ex-master's FLUSH BINARY LOGS DELETE_DOMAIN_ID=(list-of-domains) to clean its own binlog state. NOTES. suite/perfschema/r/start_server_low_digest.result is re-recorded as consequence of internal parser codes changes.
* | | | | Enusure that my_global.h is included firstMichael Widenius2017-08-241-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added sql/mariadb.h file that should be included first by files in sql directory, if sql_plugin.h is not used (sql_plugin.h adds SHOW variables that must be done before my_global.h is included) - Removed a lot of include my_global.h from include files - Removed include's of some files that my_global.h automatically includes - Removed duplicated include's of my_sys.h - Replaced include my_config.h with my_global.h
* | | | Merge 10.2 into bb-10.2-extMarko Mäkelä2017-06-191-1/+2
|\ \ \ \ | |/ / /
| * | | Merge 10.1 into 10.2Marko Mäkelä2017-06-191-1/+2
| |\ \ \ | | |/ / | | | | | | | | | | | | This will also change the minimum and maximum value of innodb_log_file_size to 1MiB and 512GiB, respectively.
| | * | MDEV-12620 - set lock_wait_timeout = 1;flush tables with read lock;Sergey Vojtovich2017-06-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | lock not released after timeout Release GRL if FLUSH TABLES phase failed.