summaryrefslogtreecommitdiff
path: root/sql/sql_alter.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.2' into 10.3Sergei Golubchik2019-03-171-1/+1
|\
| * Merge branch '10.1' into 10.2Sergei Golubchik2019-03-151-1/+1
| |\
| | * pass the slow logging information in thd->query_plan_flagsSergei Golubchik2019-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This solves the following issues: * unlike lex->m_sql_cmd and lex->sql_command, thd->query_plan_flags is not reset in Prepared_statement::execute, it survives till the log_slow_statement(), so slow logging behaves correctly in --ps * using thd->query_plan_flags for both slow_log_filter and log_slow_admin_statements means the definition of "admin" statements for the slow log is the same no matter how it is filtered out.
* | | Merge 10.2 into 10.3Marko Mäkelä2019-03-051-1/+1
|\ \ \ | |/ / | | | | | | | | | | | | FIXME: Properly resolve conflicts between MDEV-18883 and MDEV-7742/MDEV-8305, and record the correct result for main.log_slow
| * | Merge 10.1 into 10.2Marko Mäkelä2019-03-041-1/+1
| |\ \ | | |/
| | * MDEV-18333 Slow_queries count doesn't increase when slow_query_log is turned offAlexander Barkov2019-03-041-1/+1
| | |
* | | Merge 10.2 into 10.3Marko Mäkelä2018-11-061-1/+1
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| |\ \ | | |/
| | * Correct a typo in a commentMarko Mäkelä2018-10-011-1/+1
| | |
* | | MDEV-16102 Wrong ER_DUP_ENTRY upon ADD UNIQUE KEY on versioned tableAleksey Midenkov2018-06-301-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ignore CHECK constraint for historical rows; * FOREIGN KEY test case. TODO: MDEV-16301 IB: use real table name for error messages on ALTER Closes tempesta-tech/mariadb#491 Closes #748
* | | MDEV-13134 Introduce ALTER TABLE attributes ALGORITHM=NOCOPY and ↵Thirunarayanan Balathandayuthapani2018-05-071-4/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ALGORITHM=INSTANT Introduced new alter algorithm type called NOCOPY & INSTANT for inplace alter operation. NOCOPY - Algorithm refuses any alter operation that would rebuild the clustered index. It is a subset of INPLACE algorithm. INSTANT - Algorithm allow any alter operation that would modify only meta data. It is a subset of NOCOPY algorithm. Introduce new variable called alter_algorithm. The values are DEFAULT(0), COPY(1), INPLACE(2), NOCOPY(3), INSTANT(4) Message to deprecate old_alter_table variable and make it alias for alter_algorithm variable. alter_algorithm variable for slave is always set to default.
* | | dead code - related to vtmdSergei Golubchik2018-04-101-12/+0
| | | | | | | | | | | | (will be added back when it'll be used)
* | | Move alter partition flags to alter_info->partition_flagsMonty2018-03-291-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-74/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | MDEV-14798 Add, drop system versioning semantic and syntaxSergei Golubchik2018-02-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | SQL: DROP PERIOD FOR SYSTEM_TIME syntax and remove ER_VERS_SYS_FIELD_EXISTS originally by: Eugene Kosov
* | | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-02-151-64/+62
|\ \ \
| * \ \ Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2018-02-121-1/+2
| |\ \ \ | | |/ /
| | * | MDEV-13508 ALTER TABLE that renames columns and CHECK constraintsMonty2018-02-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixed by adding Item::rename_fields_processor Signed-off-by: Monty <monty@mariadb.org>
* | | | Changed database, tablename and alias to be LEX_CSTRINGMonty2018-01-301-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-14632 Assertion `!((new_col->prtype ^ col->prtype) & ~256U)' failed in ↵Eugene Kosov2017-12-201-0/+2
| | | | | | | | | | | | | | | | | | | | row_log_table_apply_convert_mrec SQL, IB: proper fix is to disable unimplemented Online DDL for system-versioned tables inside InnoDB
* | | | SQL, IB: unversioned fields with ALTER TABLE [fixes #401]Eugene Kosov2017-12-151-1/+2
| | | |
* | | | System Versioning 1.0 pre3Aleksey Midenkov2017-12-111-2/+4
|\ \ \ \ | | | | | | | | | | | | | | | Merge branch '10.3' into trunk
| * \ \ \ Merge bb-10.2-ext into 10.3Marko Mäkelä2017-11-301-2/+4
| |\ \ \ \ | | |/ / /
| | * | | MDEV-14404 Don't use LEX::check_exists in ALTER SEQUENCEAlexander Barkov2017-11-151-2/+4
| | | | |
* | | | | SQL: versioning_alter_history ERROR mode [closes #350]Aleksey Midenkov2017-11-271-4/+9
| | | | | | | | | | | | | | | | | | | | Disabled DROP and SURVIVE modes.
* | | | | System Versioning pre0.12Aleksey Midenkov2017-11-071-0/+16
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | Merge remote-tracking branch 'origin/archive/2017-10-17' into 10.3
| * | | | SQL, IB: (0.10) VTMD tracking [closes #124]Aleksey Midenkov2017-06-191-0/+16
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IB: Fixes in logic when to do versioned or usual row updates. Now it is able to do unversioned updates for versioned tables just by disabling `TABLE_SHARE::versioned` flag. SQL: DDL tracking for: * RENAME TABLE, ALTER TABLE .. RENAME TO; * DROP TABLE; * data-modifying operations (f.ex. ALTER TABLE .. ADD/DROP COLUMN).
* | | | Added DBUG_ASSERT_AS_PRINTF compile flagMonty2017-08-241-1/+1
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If compiling a non DBUG binary with -DDBUG_ASSERT_AS_PRINTF asserts will be changed to printf + stack trace (of stack trace are enabled). - Changed #ifndef DBUG_OFF to #ifdef DBUG_ASSERT_EXISTS for those DBUG_OFF that was just used to enable assert - Assert checking that could greatly impact performance where changed to DBUG_ASSERT_SLOW which is not affected by DBUG_ASSERT_AS_PRINTF - Added one extra option to my_print_stacktrace() to get more silent in case of stack trace printing as part of assert.
* | | MDEV-10139 Support for SEQUENCE objectsMonty2017-05-081-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - SETVAL(sequence_name, next_value, is_used, round) - ALTER SEQUENCE, including RESTART WITH Other things: - Added handler::extra() option HA_EXTRA_PREPARE_FOR_ALTER_TABLE to signal ha_sequence() that it should allow write_row statments. - ALTER ONLINE TABLE now works with SEQUENCE:s
* | | Changing field::field_name and Item::name to LEX_CSTRINGMonty2017-04-231-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Benefits of this patch: - Removed a lot of calls to strlen(), especially for field_string - Strings generated by parser are now const strings, less chance of accidently changing a string - Removed a lot of calls with LEX_STRING as parameter (changed to pointer) - More uniform code - Item::name_length was not kept up to date. Now fixed - Several bugs found and fixed (Access to null pointers, access of freed memory, wrong arguments to printf like functions) - Removed a lot of casts from (const char*) to (char*) Changes: - This caused some ABI changes - lex_string_set now uses LEX_CSTRING - Some fucntions are now taking const char* instead of char* - Create_field::change and after changed to LEX_CSTRING - handler::connect_string, comment and engine_name() changed to LEX_CSTRING - Checked printf() related calls to find bugs. Found and fixed several errors in old code. - A lot of changes from LEX_STRING to LEX_CSTRING, especially related to parsing and events. - Some changes from LEX_STRING and LEX_STRING & to LEX_CSTRING* - Some changes for char* to const char* - Added printf argument checking for my_snprintf() - Introduced null_clex_str, star_clex_string, temp_lex_str to simplify code - Added item_empty_name and item_used_name to be able to distingush between items that was given an empty name and items that was not given a name This is used in sql_yacc.yy to know when to give an item a name. - select table_name."*' is not anymore same as table_name.* - removed not used function Item::rename() - Added comparision of item->name_length before some calls to my_strcasecmp() to speed up comparison - Moved Item_sp_variable::make_field() from item.h to item.cc - Some minimal code changes to avoid copying to const char * - Fixed wrong error message in wsrep_mysql_parse() - Fixed wrong code in find_field_in_natural_join() where real_item() was set when it shouldn't - ER_ERROR_ON_RENAME was used with extra arguments. - Removed some (wrong) ER_OUTOFMEMORY, as alloc_root will already give the error. TODO: - Check possible unsafe casts in plugin/auth_examples/qa_auth_interface.c - Change code to not modify LEX_CSTRING for database name (as part of lower_case_table_names)
* | | Change "static int" to enum in classesMichael Widenius2017-04-181-86/+63
|/ / | | | | | | This was done when static int where used as bit fields or enums
* | Merge branch '10.1' into 10.2Sergei Golubchik2017-03-301-19/+16
|\ \ | |/
| * MDEV-6390 CONVERT TO CHARACTER SET utf8 doesn't change DEFAULT CHARSET.Alexey Botchkov2017-02-261-19/+16
| | | | | | | | | | ALTER_CONVERT flag removed and replaced for ALTER_OPTIONS for the CONVERT TO CHARACTER SET command.
* | MDEV-10421 duplicate CHECK CONSTRAINTs.Alexey Botchkov2016-09-061-0/+2
| | | | | | | | | | | | mysql_prepare_create_table fixed so it doesn't let duplicating constraint names. Syntax for CONSTRAINT IF NOT EXISTS added and handled in mysql_alter_table.
* | various cleanupsSergei Golubchik2016-06-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * remove a confusing method name - Field::set_default_expression() * remove handler::register_columns_for_write() * rename stuff * add asserts * remove unlikely unlikely * remove redundant if() conditions * fix mark_unsupported_function() to report the most important violation * don't scan vfield list for default values (vfields don't have defaults) * move handling for DROP CONSTRAINT IF EXIST where it belongs * don't protect engines from Alter_inplace_info::ALTER_ADD_CONSTRAINT * comments
* | MDEV-7563 Support CHECK constraint as in (or close to) SQL StandardMichael Widenius2016-06-301-0/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-10134 Add full support for DEFAULT - Added support for using tables with MySQL 5.7 virtual fields, including MySQL 5.7 syntax - Better error messages also for old cases - CREATE ... SELECT now also updates timestamp columns - Blob can now have default values - Added new system variable "check_constraint_checks", to turn of CHECK constraint checking if needed. - Removed some engine independent tests in suite vcol to only test myisam - Moved some tests from 'include' to 't'. Should some day be done for all tests. - FRM version increased to 11 if one uses virtual fields or constraints - Changed to use a bitmap to check if a field has got a value, instead of setting HAS_EXPLICIT_VALUE bit in field flags - Expressions can now be up to 65K in total - Ensure we are not refering to uninitialized fields when handling virtual fields or defaults - Changed check_vcol_func_processor() to return a bitmap of used types - Had to change some functions that calculated cached value in fix_fields to do this in val() or getdate() instead. - store_now_in_TIME() now takes a THD argument - fill_record() now updates default values - Add a lookahead for NOT NULL, to be able to handle DEFAULT 1+1 NOT NULL - Automatically generate a name for constraints that doesn't have a name - Added support for ALTER TABLE DROP CONSTRAINT - Ensure that partition functions register virtual fields used. This fixes some bugs when using virtual fields in a partitioning function
* merge of "BUG# 13975227: ONLINE OPTIMIZE TABLE FOR INNODB TABLES"Sergei Golubchik2014-05-071-1/+3
| | | | | | | | | revno: 5820 committer: Nisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com> branch nick: mysql-5.6-13975225 timestamp: Mon 2014-02-17 15:12:16 +0530 message: BUG# 13975227: ONLINE OPTIMIZE TABLE FOR INNODB TABLES
* Temporary commit of 10.0-mergeMichael Widenius2013-03-261-17/+378
|
* Updated/added copyright headersKent Boortz2011-06-301-1/+1
|
* Rename of sql_alter_table -> sql_alter and sql_table_maintenance -> sql_adminMattias Jonsson2010-08-161-0/+66