summaryrefslogtreecommitdiff
path: root/sql/event_data_objects.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.5 into 10.6Marko Mäkelä2023-02-101-6/+2
|\
| * Merge 10.4 into 10.5Marko Mäkelä2023-02-101-6/+2
| |\
| | * Apply clang-tidy to remove empty constructors / destructorsVicențiu Ciorbaru2023-02-091-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is the result of running run-clang-tidy -fix -header-filter=.* -checks='-*,modernize-use-equals-default' . Code style changes have been done on top. The result of this change leads to the following improvements: 1. Binary size reduction. * For a -DBUILD_CONFIG=mysql_release build, the binary size is reduced by ~400kb. * A raw -DCMAKE_BUILD_TYPE=Release reduces the binary size by ~1.4kb. 2. Compiler can better understand the intent of the code, thus it leads to more optimization possibilities. Additionally it enabled detecting unused variables that had an empty default constructor but not marked so explicitly. Particular change required following this patch in sql/opt_range.cc result_keys, an unused template class Bitmap now correctly issues unused variable warnings. Setting Bitmap template class constructor to default allows the compiler to identify that there are no side-effects when instantiating the class. Previously the compiler could not issue the warning as it assumed Bitmap class (being a template) would not be performing a NO-OP for its default constructor. This prevented the "unused variable warning".
* | | Merge 10.5 into 10.6Jan Lindström2022-09-051-0/+1
|\ \ \ | |/ /
| * | Merge 10.4 into 10.5Jan Lindström2022-09-051-0/+1
| |\ \ | | |/
| | * Reduce compilation dependencies on wsrep_mysqld.hDaniele Sciascia2022-08-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Reduce usage of strlen()Monty2021-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes: - To detect automatic strlen() I removed the methods in String that uses 'const char *' without a length: - String::append(const char*) - Binary_string(const char *str) - String(const char *str, CHARSET_INFO *cs) - append_for_single_quote(const char *) All usage of append(const char*) is changed to either use String::append(char), String::append(const char*, size_t length) or String::append(LEX_CSTRING) - Added STRING_WITH_LEN() around constant string arguments to String::append() - Added overflow argument to escape_string_for_mysql() and escape_quotes_for_mysql() instead of returning (size_t) -1 on overflow. This was needed as most usage of the above functions never tested the result for -1 and would have given wrong results or crashes in case of overflows. - Added Item_func_or_sum::func_name_cstring(), which returns LEX_CSTRING. Changed all Item_func::func_name()'s to func_name_cstring()'s. The old Item_func_or_sum::func_name() is now an inline function that returns func_name_cstring().str. - Changed Item::mode_name() and Item::func_name_ext() to return LEX_CSTRING. - Changed for some functions the name argument from const char * to to const LEX_CSTRING &: - Item::Item_func_fix_attributes() - Item::check_type_...() - Type_std_attributes::agg_item_collations() - Type_std_attributes::agg_item_set_converter() - Type_std_attributes::agg_arg_charsets...() - Type_handler_hybrid_field_type::aggregate_for_result() - Type_handler_geometry::check_type_geom_or_binary() - Type_handler::Item_func_or_sum_illegal_param() - Predicant_to_list_comparator::add_value_skip_null() - Predicant_to_list_comparator::add_value() - cmp_item_row::prepare_comparators() - cmp_item_row::aggregate_row_elements_for_comparison() - Cursor_ref::print_func() - Removes String_space() as it was only used in one cases and that could be simplified to not use String_space(), thanks to the fixed my_vsnprintf(). - Added some const LEX_CSTRING's for common strings: - NULL_clex_str, DATA_clex_str, INDEX_clex_str. - Changed primary_key_name to a LEX_CSTRING - Renamed String::set_quick() to String::set_buffer_if_not_allocated() to clarify what the function really does. - Rename of protocol function: bool store(const char *from, CHARSET_INFO *cs) to bool store_string_or_null(const char *from, CHARSET_INFO *cs). This was done to both clarify the difference between this 'store' function and also to make it easier to find unoptimal usage of store() calls. - Added Protocol::store(const LEX_CSTRING*, CHARSET_INFO*) - Changed some 'const char*' arrays to instead be of type LEX_CSTRING. - class Item_func_units now used LEX_CSTRING for name. Other things: - Fixed a bug in mysql.cc:construct_prompt() where a wrong escape character in the prompt would cause some part of the prompt to be duplicated. - Fixed a lot of instances where the length of the argument to append is known or easily obtain but was not used. - Removed some not needed 'virtual' definition for functions that was inherited from the parent. I added override to these. - Fixed Ordered_key::print() to preallocate needed buffer. Old code could case memory overruns. - Simplified some loops when adding char * to a String with delimiters.
* | | MDEV-8334: Rename utf8 to utf8mb3Rucha Deodhar2021-05-191-3/+3
| | | | | | | | | | | | | | | | | | This patch changes the main name of 3 byte character set from utf8 to utf8mb3. New old_mode UTF8_IS_UTF8MB3 is added and set TRUE by default, so that utf8 would mean utf8mb3. If not set, utf8 would mean utf8mb4.
* | | MDEV-9609 : wsrep_debug only logs DDL information on originating nodeJan Lindström2021-05-151-1/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added DDL logging to applier and replaying also so that DDL is logged on other than originating node. wsrep.h Removed wsrep_thd_is_local conditions and cleaned up the macros. Removed WSREP_TO_ISOLATION_END. Event_job_data::execute change_password acl_set_default_role mysql_execute_command Replaced macro by function call wsrep_to_isolation_begin wsrep_to_isolation_end If execution is not local log DDL-information when wsrep_debug is enabled No new tests required as current regression setting is already testing these code paths.
* | Merge 10.4 into 10.5Marko Mäkelä2021-04-221-0/+1
|\ \ | |/
| * Merge 10.3 into 10.4st-10.4Marko Mäkelä2021-04-221-0/+1
| |\
| | * Merge 10.2 into 10.3Marko Mäkelä2021-04-221-0/+1
| | |\
| | | * MDEV-24807:A possibility for double free in dtor of ↵Vicențiu Ciorbaru2021-04-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Event_queue_element_for_exec in the case of OOM Eliminate a memory leak when init can fail by forgetting to delete the Event_queue_element_for_exec object.
* | | | Merge branch '10.4' into 10.5Oleksandr Byelkin2020-08-041-1/+1
|\ \ \ \ | |/ / /
| * | | Merge branch '10.3' into 10.4Oleksandr Byelkin2020-08-031-1/+1
| |\ \ \ | | |/ /
| | * | Merge branch '10.2' into 10.3Oleksandr Byelkin2020-08-031-1/+1
| | |\ \ | | | |/
| | | * Merge branch '10.1' into 10.2Oleksandr Byelkin2020-08-021-1/+1
| | | |\
| | | | * Code comment spellfixesIan Gilfillan2020-07-221-1/+1
| | | | |
* | | | | MDEV-21743 Split up SUPER privilege to smaller privilegesAlexander Barkov2020-03-101-2/+1
| | | | |
* | | | | perfschema compilation, test and misc fixesSergei Golubchik2020-03-101-2/+2
| | | | |
* | | | | perfschema statement instrumentation related changesSergei Golubchik2020-03-101-1/+23
| | | | |
* | | | | perfschema sp instrumentation related changesSergei Golubchik2020-03-101-0/+4
| | | | |
* | | | | perfschema memory related instrumentation changesSergei Golubchik2020-03-101-4/+6
| | | | |
* | | | | perfschema - various collateral cleanups and small changesSergei Golubchik2020-03-101-4/+2
| | | | |
* | | | | MDEV-21702 Add a data type for privilegesAlexander Barkov2020-02-111-3/+1
|/ / / /
* | | | 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
| | | * | MW-416 DDL replication moved after acl checkingsjaakola2017-12-191-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | galera_events test shows a regression with the original fix for MW-416 Reason was that Events::drop_event() can be called also from inside event execution, and there we have a speacial treatment for event, which executes "DROP EVENT" statement, and runs TOI replication inside the event processing body. This resulted in executing WSREP_TO_ISOLATION two times for such DROP EVENT statement. Fix is to call WSREP_TO_ISOLATION_BEGIN only in Events::drop_event()
* | | | | Galera4Brave Galera Crew2019-01-231-1/+11
| | | | |
* | | | | MDEV-16991 Rounding vs truncation for TIME, DATETIME, TIMESTAMPbb-10.4-mdev16991Alexander Barkov2018-11-261-6/+16
| | | | |
* | | | | MDEV-17317 Add THD* parameter into Item::get_date() and stricter data type ↵Alexander Barkov2018-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | control to "fuzzydate"
* | | | | Merge 10.3 into 10.4Marko Mäkelä2018-08-161-3/+7
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-16891 EVENTs created with SQL_MODE=ORACLE fail to executeAlexander Barkov2018-08-071-3/+7
| | | | |
* | | | | A cleanup for MDEV-16852Alexander Barkov2018-08-071-2/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing data types for: - seconds from longlong to ulonglong - microseconds from long to ulong in: - parameters of calc_time_diff() - parameters of calc_time_from_sec() - Members of Sec6_add This will help to reuse the code easier: all other functions use ulonglong+long for seconds/microsecond, e.g.: - number_to_time() - number_to_datetime() - number_to_datetime_with_warn() - Field_temporal_with_date::store_decimal() - my_decimal2seconds() - Item::get_seconds()
* | | | Add likely/unlikely to speed up executionMonty2018-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 'origin/bb-10.2-ext' into 10.3Alexander Barkov2018-02-041-1/+1
|\ \ \ \
| * | | | Added name to MEM_ROOT for esier debuggingMonty2018-02-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will make it easier to how memory allocation is done when debugging with either DBUG or gdb. Will especially help when debugging stored procedures Main change is a name argument as second argument to init_alloc_root() init_sql_alloc() Other things: - Added DBUG_ENTER/EXIT to some Virtual_tmp_table functions
* | | | | Change C_STRING_WITH_LEN to STRING_WITH_LENMonty2018-01-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This preserves const str for constant strings Other things - A few variables where changed from LEX_STRING to LEX_CSTRING - Incident_log_event::Incident_log_event and record_incident where changed to take LEX_CSTRING* as an argument instead of LEX_STRING
* | | | | Changed database, tablename and alias to be LEX_CSTRINGMonty2018-01-301-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 remote-tracking branch 'origin/bb-10.2-ext' into 10.3Alexander Barkov2017-10-301-10/+24
|\ \ \ \ \ | |/ / / / | | | | | | | | | | TODO: enable MDEV-13049 optimization for 10.3
| * | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-10-181-8/+22
| |\ \ \ \ | | |/ / /
| | * | | MW-416 DDL replication moved after acl checkingsjaakola2017-10-101-8/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | galera_events test shows a regression with the original fix for MW-416 Reason was that Events::drop_event() can be called also from inside event execution, and there we have a speacial treatment for event, which executes "DROP EVENT" statement, and runs TOI replication inside the event processing body. This resulted in executing WSREP_TO_ISOLATION two times for such DROP EVENT statement. Fix is to call WSREP_TO_ISOLATION_BEGIN only in Events::drop_event()
| * | | | MDEV-14013 : sql_mode=EMPTY_STRING_IS_NULLhalfspawn2017-10-141-2/+2
| | | | |
* | | | | Merge bb-10.2-ext into 10.3Marko Mäkelä2017-10-041-3/+3
|\ \ \ \ \ | |/ / / /
| * | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-10-021-3/+3
| |\ \ \ \ | | |/ / /
| | * | | MDEV-13384 - misc Windows warnings fixedVladislav Vaintroub2017-09-281-1/+1
| | | | |
| | * | | MDEV-13844 : Fix Windows warnings. Fix DBUG_PRINT.Vladislav Vaintroub2017-09-281-2/+2
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix win64 pointer truncation warnings (usually coming from misusing 0x%lx and long cast in DBUG) - Also fix printf-format warnings Make the above mentioned warnings fatal. - fix pthread_join on Windows to set return value.