summaryrefslogtreecommitdiff
path: root/sql/sql_alter.cc
Commit message (Collapse)AuthorAgeFilesLines
* 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 branch '10.2' into 10.3Sergei Golubchik2019-03-171-8/+3
|\ \ \ \ | |/ / /
| * | | Merge branch '10.1' into 10.2Sergei Golubchik2019-03-151-5/+5
| |\ \ \ | | |/ /
| | * | fix gcc 8 compiler warningsSergei Golubchik2019-03-141-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two newly enabled warnings: 1. cast for a function pointers. Affected sql_analyse.h, mi_write.c and ma_write.cc, mf_iocache-t.cc, mysqlbinlog.cc, encryption.cc, etc 2. memcpy/memset of nontrivial structures. Fixed as: * the warning disabled for InnoDB * TABLE, TABLE_SHARE, and TABLE_LIST got a new method reset() which does the bzero(), which is safe for these classes, but any other bzero() will still cause a warning * Table_scope_and_contents_source_st uses `TABLE_LIST *` (trivial) instead of `SQL_I_List<TABLE_LIST>` (not trivial) so it's safe to bzero now. * added casts in debug_sync.cc and sql_select.cc (for JOIN) * move assignment method for MDL_request instead of memcpy() * PARTIAL_INDEX_INTERSECT_INFO::init() instead of bzero() * remove constructor from READ_RECORD() to make it trivial * replace some memcpy() with c++ copy assignments
| * | | Merge 10.1 into 10.2Marko Mäkelä2019-03-041-4/+0
| |\ \ \ | | |/ /
| | * | MDEV-18333 Slow_queries count doesn't increase when slow_query_log is turned offAlexander Barkov2019-03-041-4/+0
| | | |
* | | | Merge 10.2 into 10.3Marko Mäkelä2018-11-061-7/+3
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-7/+4
| |\ \ \ | | |/ /
| | * | wsrep: create a macro for the error: labelSergei Golubchik2018-10-241-7/+4
| | | | | | | | | | | | | | | | | | | | that is used by WSREP_TO_ISOLATION_BEGIN and other galera macros, to avoid the need for wrapping this label in #ifdef WITH_WSREP/#endif
* | | | Merge branch '10.2' into 10.3Sergei Golubchik2018-09-281-10/+14
|\ \ \ \ | |/ / /
| * | | Merge branch '10.1' into 10.2Oleksandr Byelkin2018-09-141-7/+13
| |\ \ \ | | |/ /
| | * | Merge branch '10.0-galera' into 10.1Sergei Golubchik2018-09-071-7/+13
| | |\ \
| | | * | Add missing WSREP(thd) condition and remove unnecessary DBUG_RETURN.Jan Lindström2018-08-021-3/+2
| | | | |
| | | * | Merge remote-tracking branch 'origin/5.5-galera' into 10.0-galeraJan Lindström2018-08-021-5/+12
| | | |\ \
| | | | * | Follow up to previous commit for codership/mysql-wsrep#332mariadb-galera-5.5.61Daniele Sciascia2018-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fix misplaced `DBUG_RETURN` in `Alter_table_statement::execute`.
| | | | * | Fix FK constraint violation in applier, after ALTER TABLE ADD FKDaniele Sciascia2018-08-021-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding a FK constraint to an existing table (ALTER TABLE ADD FOREIGN KEY) causes the applier to fail, if a concurrent DML statement that violate the new constraint (i.e. a DELETE or UPDATE of record in the parent table). For exmaple, the following scenario causes a crash in the applier: 1. ALTER successfully adds FK constraint in node_1 2. On node_2 is UPDATE is in pre_commit() and has certified successfully 3. ALTER is delivered in node_2 and BF aborts DML 4. Applying UPDATE event causes FK violation in node_1 To avoid this situation it is necessary for UPDATE to fail during certification. And for the UPDATE to fail certfication it is necessary that ALTER appends certification keys for both the child and the parent table. Before this patch, ALTER TABLE ADD FK only appended keys for child table which is ALTERed.
| | | | * | MDEV#6148 main.flush_read_lock fails due to conflictingNirbhay Choubey2014-04-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | read lock TOI was being attempted even when WSREP_ON was not enabled (off). So, with FTWRL in place TOI later gets aborted & thus the failure. Fixed by adding a check to skip TOI if wsrep is not enabled.
| | | | * | Merged revisions 3931--3942 from from lp:~codership/codership-mysql/5.5-23.Jan Lindström2013-11-251-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------ revno: 3942 committer: Seppo Jaakola <seppo.jaakola@codership.com> branch nick: wsrep-5.5-23 timestamp: Thu 2013-11-07 17:37:10 +0200 message: References: lp:1248921 - checking if index is foreign earlier to adhere to lat ch order protocol ------------------------------------------------------------ revno: 3941 fixes bug: https://launchpad.net/bugs/1248908 committer: Teemu Ollakka <teemu.ollakka@codership.com> branch nick: 5.5-23 timestamp: Thu 2013-11-07 14:31:04 +0200 message: References lp:1248908 - Fixed access to trx sys header Pass trx sys header as argument for trx_sys_update_wsrep_checkpoint() and trx_sys_update_mysql_binlog_offset() to avoid successive calls to trx_sysf_get(). ------------------------------------------------------------ revno: 3940 fixes bug: https://launchpad.net/bugs/1244100 committer: Teemu Ollakka <teemu.ollakka@codership.com> branch nick: 5.5-23 timestamp: Tue 2013-11-05 15:31:12 +0200 message: References lp:1244100 - assign value for check_purge before return ------------------------------------------------------------ revno: 3939 fixes bug: https://launchpad.net/bugs/1247978 committer: Teemu Ollakka <teemu.ollakka@codership.com> branch nick: 5.5-23 timestamp: Tue 2013-11-05 01:01:36 +0200 message: References lp:1247978 - force release transactional MDL locks if wsrep is on a nd no active transaction at the end of mysql_execute_command() ------------------------------------------------------------ revno: 3938 committer: Vladislav Klyachin <vladislav.klyachin@codership.com> branch nick: 5.5-23 timestamp: Sun 2013-11-03 20:48:06 +0400 message: References lp:1232789 - fix FLUSH STATUS zeroes up wsrep_cluster_size and wsre p_local_index ------------------------------------------------------------ revno: 3937 5kB/s - committer: Vladislav Klyachin <vladislav.klyachin@codership.com> branch nick: 5.5-23 timestamp: Sun 2013-11-03 17:06:31 +0400 message: References lp:587170 - reset auto_increment_* vars to defaults for TOI operati ons ------------------------------------------------------------ revno: 3936 committer: Vladislav Klyachin <vladislav.klyachin@codership.com> branch nick: 5.5-23 timestamp: Sun 2013-11-03 00:10:45 +0400 message: References lp:1072839 - fix for memory leaks with wsrep variables ------------------------------------------------------------ revno: 3935 committer: Seppo Jaakola <seppo.jaakola@codership.com> branch nick: wsrep-5.5-23 timestamp: Wed 2013-10-30 14:34:32 +0200 message: References: lp:1246257 - skipping replication for CREATE TEMPORARY TABLE LIKE. .. constructs ------------------------------------------------------------ revno: 3934 6kB/s \ fixes bug: https://launchpad.net/bugs/1241760 committer: Teemu Ollakka <teemu.ollakka@codership.com> branch nick: 5.5-23 timestamp: Mon 2013-10-28 11:01:53 +0200 message: References lp:1241760 - save thd->db to wsrep_thd_shadow before replay ------------------------------------------------------------ revno: 3933 fixes bug: https://launchpad.net/bugs/1206129 committer: Teemu Ollakka <teemu.ollakka@codership.com> branch nick: 5.5-23 timestamp: Sun 2013-10-27 18:15:12 +0200 message: References lp:1206129 - check binlog_hton->commit() return value, call wsrep_p ost_commit() instead of wsrep_cleanup_transaction() ------------------------------------------------------------ revno: 3932 fixes bug: https://launchpad.net/bugs/1244661 committer: Teemu Ollakka <teemu.ollakka@codership.com> branch nick: 5.5-23 timestamp: Sun 2013-10-27 13:14:02 +0200 message: References lp:1244661 - added wsrep_register_hton() to trans_rollback_implicit () ------------------------------------------------------------ revno: 3931 fixes bug: https://launchpad.net/bugs/1244667 committer: Teemu Ollakka <teemu.ollakka@codership.com> branch nick: 5.5-23 timestamp: Sun 2013-10-27 11:08:49 +0200 message: References lp:1244667 - restore thd->server_status after replay
| | | | * | Merged changes from lp:codership-mysql up to rev 3743Seppo Jaakola2012-04-261-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -r3725..3737 -r3738..3740 -r3741..3743
| | | | * | Initial push of codership-wsrep API implementation for MariaDB. Seppo Jaakola2012-04-131-1/+16
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge of: lp:maria/5.5, #3334: http://bazaar.launchpad.net/~maria-captains/maria/5.5/revision/3334 lp:codership-mysql/5.5, #3725: http://bazaar.launchpad.net/~codership/codership-mysql/wsrep-5.5/revision/3725
| * | | | Merge branch '10.1' into 10.2Sergei Golubchik2018-06-211-3/+0
| |\ \ \ \ | | |/ / /
| | * | | fix compilation w/o partitioningSergei Golubchik2018-06-141-1/+0
| | | | | | | | | | | | | | | | | | | | followup for d8da920264a
* | | | | MDEV-16102 Wrong ER_DUP_ENTRY upon ADD UNIQUE KEY on versioned tableAleksey Midenkov2018-06-301-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | | | | Merge 10.2 into 10.3Marko Mäkelä2018-05-291-2/+5
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.1 into 10.2Marko Mäkelä2018-05-291-2/+5
| |\ \ \ \ | | |/ / /
| | * | | MDEV-10679 Crash in performance schema and partitioning with discoveryMonty2018-05-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Crash happened because in discover, table->work_part_info was not properly reset before execution. Fixed by resetting before calling execute alter table, create table or mysql_create_frm_image.
* | | | | MDEV-13134 Introduce ALTER TABLE attributes ALGORITHM=NOCOPY and ↵Thirunarayanan Balathandayuthapani2018-05-071-0/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Add likely/unlikely to speed up executionMonty2018-05-071-1/+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()
* | | | | Added version of lex_string_eq that compares with const char *Monty2018-04-301-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change all my_stcasecmp() calls that uses lexical keywords to use lex_string_eq. This is faster as we only call strcasecmp() for strings of different lengths. Removed not used function lex_string_syseq()
* | | | | Move alter partition flags to alter_info->partition_flagsMonty2018-03-291-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+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
* | | | | Changed database, tablename and alias to be LEX_CSTRINGMonty2018-01-301-28/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 "")
* | | | | New option for slow logging (log_slow_disable_statements)Monty2017-08-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Added DBUG_ASSERT_AS_PRINTF compile flagMonty2017-08-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | 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
* | | | | Changing field::field_name and Item::name to LEX_CSTRINGMonty2017-04-231-7/+13
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* | | | various cleanupsSergei Golubchik2016-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | MDEV-5535: Cannot reopen temporary tableNirbhay Choubey2016-06-101-4/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysqld maintains a list of TABLE objects for all temporary tables created within a session in THD. Here each table is represented by a TABLE object. A query referencing a particular temporary table for more than once, however, failed with ER_CANT_REOPEN_TABLE error because a TABLE_SHARE was allocate together with the TABLE, so temporary tables always had only one TABLE per TABLE_SHARE. This patch lift this restriction by separating TABLE and TABLE_SHARE objects and storing TABLE_SHAREs for temporary tables in a list in THD, and TABLEs in a list within their respective TABLE_SHAREs.
* | | - Renaming variables so that they don't shadow others (After this patch one ↵Monty2015-07-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | can compile with -Wshadow and get much fewer warnings) - Changed ER(ER_...) to ER_THD(thd, ER_...) when thd was known or if there was many calls to current_thd in the same function. - Changed ER(ER_..) to ER_THD_OR_DEFAULT(current_thd, ER...) in some places where current_thd is not necessary defined. - Removing calls to current_thd when we have access to thd Part of this is optimization (not calling current_thd when not needed), but part is bug fixing for error condition when current_thd is not defined (For example on startup and end of mysqld) Notable renames done as otherwise a lot of functions would have to be changed: - In JOIN structure renamed: examined_rows -> join_examined_rows record_count -> join_record_count - In Field, renamed new_field() to make_new_field() Other things: - Added DBUG_ASSERT(thd == tmp_thd) in Item_singlerow_subselect() just to be safe. - Removed old 'tab' prefix in JOIN_TAB::save_explain_data() and use members directly - Added 'thd' as argument to a few functions to avoid calling current_thd.
* | | Merge 10.0-galera into 10.1Sergei Golubchik2015-02-061-9/+11
|\ \ \ | |/ /
| * | bzr merge -r4123..4144 codership/5.6Nirbhay Choubey2014-09-301-10/+10
| | |
| * | Fixes for some test failures.Nirbhay Choubey2014-04-091-1/+2
| | |
| * | * bzr merge -rtag:mariadb-10.0.9 maria/10.0Nirbhay Choubey2014-03-261-13/+2
| |\ \ | | | | | | | | | | | | | | | | * Fix for post-merge build failures.
| * \ \ Merge 10.0 to galera-10.0Jan Lindström2013-09-031-12/+261
| |\ \ \
| * | | | Initial merge result with mariaDB 10: lp:mariaSeppo Jaakola2013-07-131-1/+19
| | |_|/ | |/| |
* | | | MDEV-6247: Merge 10.0-galera to 10.1.Jan Lindström2014-08-261-0/+17
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | Merged lp:maria/maria-10.0-galera up to revision 3879. Added a new functions to handler API to forcefully abort_transaction, producing fake_trx_id, get_checkpoint and set_checkpoint for XA. These were added for future possiblity to add more storage engines that could use galera replication.