summaryrefslogtreecommitdiff
path: root/sql/sql_partition_admin.cc
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Merge remote-tracking branch 'origin/10.3' into 10.4Alexander Barkov2019-10-011-1/+1
|\
| * Merge remote-tracking branch 'origin/10.2' into 10.3Alexander Barkov2019-10-011-1/+1
| |\
| | * Fix -Wunused for CMAKE_BUILD_TYPE=RelWithDebInfoMarko Mäkelä2019-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-1/+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
* | | | | Merge 10.3 into 10.4Marko Mäkelä2019-03-201-3/+2
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MDEV-17262 commit 26432e49d37a37d09b862bb49a021e44bdf4789c was skipped. In Galera 4, the implementation would seem to require changes to the streaming replication. In the tests archive.rnd_pos main.profiling, disable_ps_protocol for SHOW STATUS and SHOW PROFILE commands until MDEV-18974 has been fixed.
| * | | | post-merge: gcc 8 warningsSergei Golubchik2019-03-171-2/+2
| | | | |
| * | | | Merge branch '10.2' into 10.3Sergei Golubchik2019-03-171-1/+0
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.1 into 10.2Marko Mäkelä2019-03-041-1/+0
| | |\ \ \ | | | |/ /
| | | * | MDEV-18333 Slow_queries count doesn't increase when slow_query_log is turned offAlexander Barkov2019-03-041-1/+0
| | | | |
* | | | | Merge 10.3 into 10.4Marko Mäkelä2018-11-061-2/+2
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.2 into 10.3Marko Mäkelä2018-11-061-2/+2
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | main.derived_cond_pushdown: Move all 10.3 tests to the end, trim trailing white space, and add an "End of 10.3 tests" marker. Add --sorted_result to tests where the ordering is not deterministic. main.win_percentile: Add --sorted_result to tests where the ordering is no longer deterministic.
| | * | | Merge 10.1 into 10.2Marko Mäkelä2018-11-061-2/+2
| | |\ \ \ | | | |/ /
* | | | | MDEV-11953: support of brackets in UNION/EXCEPT/INTERSECT operationsOleksandr Byelkin2018-07-041-2/+2
|/ / / /
* | | | Remove mem_alloc_error()Michael Widenius2018-05-071-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As thd->alloc() and new automatically calls my_error(ER_OUTOFMEORY) there is no reason to call mem_alloc_error() Other things: - Fixed bug in mysql_unpack_partition() where lex.part_info was changed even if it would be a null pointer
* | | | Add likely/unlikely to speed up executionMonty2018-05-071-51/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 10.2 into 10.3Marko Mäkelä2018-04-241-1/+1
|\ \ \ \ | |/ / /
| * | | Merge 10.1 into 10.2Marko Mäkelä2018-04-241-1/+1
| |\ \ \ | | |/ /
| | * | Merge 10.0 into 10.1Marko Mäkelä2018-04-241-1/+1
| | |\ \
| | | * | MDEV-15456 Server crashes upon adding or dropping a partition in ALTER under ↵Sergei Golubchik2018-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LOCK TABLE after ER_SAME_NAME_PARTITION ALTER TABLE ... ADD PARTITION modifies the open TABLE structure, and sets table->need_reopen=1 to reset these modifications in case of an error. But under LOCK TABLES the table isn't get reopened, despite need_reopen. Fixed by reopening need_reopen tables under LOCK TABLE.
* | | | | Move alter partition flags to alter_info->partition_flagsMonty2018-03-291-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is done to get more free flag bits for alter_info->flags Renamed all ALTER PARTITION defines to start with ALTER_PARTITION_ Renamed ALTER_PARTITION to ALTER_PARTITION_INFO Renamed ALTER_TABLE_REORG to ALTER_PARTITION_TABLE_REORG Other things: - Shifted some ALTER_xxx defines to get empty bits at end
* | | | | Changed static const in Alter_info and Alter_online_info to definesMonty2018-03-291-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Main reason was to make it easier to print the above structures in a debugger. Additional benefits is that I was able to use same defines for both structures, which simplifes some code. Most of the code is just removing Alter_info:: and Alter_inplace_info:: from alter table flags. Following renames was done: HA_ALTER_FLAGS -> alter_table_operations CHANGE_CREATE_OPTION -> ALTER_CHANGE_CREATE_OPTION Alter_info::ADD_INDEX -> ALTER_ADD_INDEX DROP_INDEX -> ALTER_DROP_INDEX ADD_UNIQUE_INDEX -> ALTER_ADD_UNIQUE_INDEX DROP_UNIQUE_INDEx -> ALTER_DROP_UNIQUE_INDEX ADD_PK_INDEX -> ALTER_ADD_PK_INDEX DROP_PK_INDEX -> ALTER_DROP_PK_INDEX Alter_info:ALTER_ADD_COLUMN -> ALTER_PARSE_ADD_COLUMN Alter_info:ALTER_DROP_COLUMN -> ALTER_PARSE_DROP_COLUMN Alter_inplace_info::ADD_INDEX -> ALTER_ADD_NON_UNIQUE_NON_PRIM_INDEX Alter_inplace_info::DROP_INDEX -> ALTER_DROP_NON_UNIQUE_NON_PRIM_INDEX Other things: - Added typedef alter_table_operatons for alter table flags - DROP CHECK CONSTRAINT can now be done online - Added checks for Aria tables in alter_table_online.test - alter_table_flags now takes an ulonglong as argument. - Don't support online operations if checksum option is used. - sql_lex.cc doesn't add ALTER_ADD_INDEX if index is not created
* | | | | Changed database, tablename and alias to be LEX_CSTRINGMonty2018-01-301-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 "")
* | | | | MDEV-11084 Select statement with partition selection against MyISAM table ↵Alexey Botchkov2018-01-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | opens all partitions. Now we don't open partitions if it was explicitly cpecified. ha_partition::m_opened_partition bitmap added to track partitions that were actually opened.
* | | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-01-051-8/+4
|\ \ \ \ \
| * \ \ \ \ Merge remote-tracking branch 'origin/10.2' into bb-10.2-extMonty2018-01-051-8/+4
| |\ \ \ \ \ | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mysql-test/r/cte_nonrecursive.result mysql-test/suite/galera/r/galera_bf_abort.result mysql-test/suite/galera/r/galera_bf_abort_get_lock.result mysql-test/suite/galera/r/galera_bf_abort_sleep.result mysql-test/suite/galera/r/galera_enum.result mysql-test/suite/galera/r/galera_fk_conflict.result mysql-test/suite/galera/r/galera_insert_multi.result mysql-test/suite/galera/r/galera_many_indexes.result mysql-test/suite/galera/r/galera_mdl_race.result mysql-test/suite/galera/r/galera_nopk_bit.result mysql-test/suite/galera/r/galera_nopk_blob.result mysql-test/suite/galera/r/galera_nopk_large_varchar.result mysql-test/suite/galera/r/galera_nopk_unicode.result mysql-test/suite/galera/r/galera_pk_bigint_signed.result mysql-test/suite/galera/r/galera_pk_bigint_unsigned.result mysql-test/suite/galera/r/galera_serializable.result mysql-test/suite/galera/r/galera_toi_drop_database.result mysql-test/suite/galera/r/galera_toi_lock_exclusive.result mysql-test/suite/galera/r/galera_toi_truncate.result mysql-test/suite/galera/r/galera_unicode_pk.result mysql-test/suite/galera/r/galera_var_auto_inc_control_off.result mysql-test/suite/galera/r/galera_wsrep_log_conficts.result sql/field.cc sql/rpl_gtid.cc sql/share/errmsg-utf8.txt sql/sql_acl.cc sql/sql_parse.cc sql/sql_partition_admin.cc sql/sql_prepare.cc sql/sql_repl.cc sql/sql_table.cc sql/sql_yacc.yy
| | * | | | Fixed wrong arguments to printf and related functionsMonty2018-01-041-18/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Other things, mainly to get create_mysqld_error_find_printf_error tool to work: - Added protection to not include mysqld_error.h twice - Include "unireg.h" instead of "mysqld_error.h" in server - Added protection if ER_XX messages are already defined - Removed wrong calls to my_error(ER_OUTOFMEMORY) as my_malloc() and my_alloc will do this automatically - Added missing %s to ER_DUP_QUERY_NAME - Removed old and wrong calls to my_strerror() when using MY_ERROR_ON_RENAME (wrong merge) - Fixed deadlock error message from Galera. Before the extra information given to ER_LOCK_DEADLOCK was missing because ER_LOCK_DEADLOCK doesn't provide any extra information. I kept #ifdef mysqld_error_find_printf_error_used in sql_acl.h to make it easy to do this kind of check again in the future
* | | | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-11-101-1/+1
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Add more execution stages (commit, rollback, etc)Monty2017-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was done to get more information about where time is spent. Now we can get proper timing for time spent in commit, rollback, binlog write etc. Following stages was added: - Commit - Commit_implicit - Rollback - Rollback implicit - Binlog write - Init for update - This is used instead of "Init" for insert, update and delete. - Staring cleanup Following stages where changed: - "Unlocking tables" stage reset stage to previous stage at end - "binlog write" stage resets stage to previous stage at end - "end" -> "end of update loop" - "cleaning up" -> "Reset for next command" - Added stage_searching_rows_for_update when searching for rows to be deleted. Other things: - Renamed all stages to start with big letter (before there was no consitency) - Increased performance_schema_max_stage_classes from 150 to 160. - Most of the test changes in performance schema comes from renaming of stages. - Removed duplicate output of variables and inital state in a lot of performance schema tests. This was done to make it easier to change a default value for a performance variable without affecting all tests. - Added start_server_variables.test to check configuration - Removed some duplicate "closing tables" stages - Updated position for "stage_init_update" and "stage_updating" for delete, insert and update to be just before update loop (for more exact timing). - Don't set "Checking permissions" twice in a row. - Remove stage_end stage from creating views (not done for create table either). - Updated default performance history size from 10 to 20 because of new stages - Ensure that ps_enabled is correct (to be used in a later patch)
* | | | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-09-211-2/+5
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.2 into bb-10.2-extMarko Mäkelä2017-09-201-2/+5
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge branch '10.1' into 10.2Vicențiu Ciorbaru2017-09-191-2/+5
| | |\ \ \ \ | | | |/ / /
| | | * | | MDEV-13157 Specifying DATA DIRECTORY in tables leads to failing EXCHANGE ↵Sergei Golubchik2017-09-181-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | PARTITION
* | | | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-09-181-15/+6
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.2 into bb-10.2-extMarko Mäkelä2017-09-171-15/+6
| |\ \ \ \ \ | | |/ / / /
| | * | | | MW-394sjaakola2017-09-151-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * recorded new result file, original was copied from MariaDB which produces syntactically a bit different result * semantics are same in MariaDB and ours result file
| | * | | | MW-394sjaakola2017-09-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ported the partition.test from MariaDB 10.3 code tree * fix to TOI replicate ALTER TABLE EXCHANGE PARTITION statement
* | | | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-09-011-1/+1
|\ \ \ \ \ \ | |/ / / / /
| * | | | | Merge 10.2 into bb-10.2-extMarko Mäkelä2017-09-011-1/+1
| |\ \ \ \ \ | | |/ / / /
| | * | | | Merge 10.1 into 10.2Marko Mäkelä2017-08-311-1/+1
| | |\ \ \ \ | | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For running the Galera tests, the variable my_disable_leak_check was set to true in order to avoid assertions due to memory leaks at shutdown. Some adjustments due to MDEV-13625 (merge InnoDB tests from MySQL 5.6) were performed. The most notable behaviour changes from 10.0 and 10.1 are the following: * innodb.innodb-table-online: adjustments for the DROP COLUMN behaviour change (MDEV-11114, MDEV-13613) * innodb.innodb-index-online-fk: the removal of a (1,NULL) record from the result; originally removed in MySQL 5.7 in the Oracle Bug #16244691 fix https://github.com/mysql/mysql-server/commit/377774689bf6a16af74182753fe950d514c2c6dd * innodb.create-index-debug: disabled due to MDEV-13680 (the MySQL Bug #77497 fix was not merged from 5.6 to 5.7.10) * innodb.innodb-alter-autoinc: MariaDB 10.2 behaves like MySQL 5.6/5.7, while MariaDB 10.0 and 10.1 assign different values when auto_increment_increment or auto_increment_offset are used. Also MySQL 5.6/5.7 exhibit different behaviour between LGORITHM=INPLACE and ALGORITHM=COPY, so something needs to be tested and fixed in both MariaDB 10.0 and 10.2. * innodb.innodb-wl5980-alter: disabled because it would trigger an InnoDB assertion failure (MDEV-13668 may need additional effort in 10.2)
| | | * | | Merge remote-tracking branch 'origin/10.0-galera' into 10.1Jan Lindström2017-08-211-2/+2
| | | |\ \ \
| | | | * | | Refs: MW-360 * reverted WSREP_TO_ISOLATION macros back to original formsjaakola2017-08-111-2/+2
| | | | | | |
| | | | * | | Refs: MW-360 * splitting DROP TABLE query in separate DROP commands for ↵sjaakola2017-08-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | temporary and real tables * not replicating temporary table DROP command * using wsrep_sidno GTID group only for innodb table drop command part all this follows more or less the logic of how mysql wants to split drop table list
| | | | * | | Merge tag 'mariadb-10.0.32' into 10.0-galeraJan Lindström2017-08-091-4/+4
| | | | |\ \ \ | | | | | |/ /
* | | | | | | New option for slow logging (log_slow_disable_statements)Monty2017-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes MDEV-7742 and MDEV-8305 (Allow user to specify if stored procedures should be logged in the slow and general log) New functionality: - Added new variables log_slow_disable_statements and log_disable_statements that can be used to disable logging of certain queries to slow and general log. Currently supported options are 'admin', 'call', 'slave' and 'sp'. Defaults are as before. Only 'sp' (stored procedure statements) is disabled for slow and general_log. - Slow log to files now includes the following new information: - When logging stored procedure statements the name of stored procedure is logged. - Number of created tmp_tables, tmp_disk_tables and the space used by temporary tables. - When logging 'call', the logged status now contains the sum of all included statements. Before only 'time' was correct. - Added filsort_priority_queue as an option for log_slow_filter (this variable existed before, but was not exposed) - Added support for BIT types in my_getopt() Mapped some old variables to bitmaps (old variables can still be used) - Variable 'log_queries_not_using_indexes' is mapped to log_slow_filter='not_using_index' - Variable 'log_slow_slave_statements' is mapped to log_slow_disabled_statements='slave' - Variable 'log_slow_admin_statements' is mapped to log_slow_disabled_statements='admin' - All the above variables are changed to session variables from global variables Other things: - Simplified LOGGER::log_command. We don't need to check for super if OPTION_LOG_OFF is set as this flag can only be set if one is a super user. - Removed some setting of enable_slow_log as it's guaranteed to be set by mysql_parse() - mysql_admin_table() now sets thd->enable_slow_log - Added prepare_logs_for_admin_command() to reset thd->enable_slow_log if needed. - Added new functions to store, restore and add slow query status - Added new functions to store and restore query start time - Reorganized Sub_statement_state according to types - Added code in dispatch_command() to ensure that thd->reset_for_next_command() is always called for a query. - Added thd->last_sql_command to simplify checking of what was the type of the last command. Needed when logging to slow log as lex->sql_command may have changed before slow logging is called. - Moved QPLAN_TMP_... to where status for tmp tables are updated - Added new THD variable, affected_rows, to be able to correctly log number of affected rows to slow log.
* | | | | | | Enusure that my_global.h is included firstMichael Widenius2017-08-241-0/+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