- 09 Jul, 2015 1 commit
-
-
Monty authored
- Cache variables.lc_messages->errmsgs->errmsgs in variables.errmsgs This gives us 15 byte less code space and 2 memory references for any access to language dependent message, of which there are 500 in the server..
-
- 06 Jul, 2015 1 commit
-
-
Monty authored
- Renaming variables so that they don't shadow others (After this patch one 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.
-
- 05 Jul, 2015 2 commits
-
-
Monty authored
-
Monty authored
Fixed several optimizer issues relatied to GROUP BY: a) Refering to a SELECT column in HAVING sometimes calculated it twice, which caused problems with non determinstic functions b) Removing duplicate fields and constants from GROUP BY was done too late for "using index for group by" optimization to work c) EXPLAIN SELECT ... GROUP BY did wrongly show 'Using filesort' in some cases involving "Using index for group-by" a) was fixed by: - Changed last argument to Item::split_sum_func2() from bool to int to allow more flags - Added flag argument to Item::split_sum_func() to allow on to specify if the item was in the SELECT part - Mark all split_sum_func() calls from SELECT with SPLIT_SUM_SELECT - Changed split_sum_func2() to do nothing if called with an argument that is not a sum function and doesn't include sum functions, if we are not an argument to SELECT. This ensures that in a case like select a*sum(b) as f1 from t1 where a=1 group by c having f1 <= 10; That 'a' in the SELECT part is stored as a reference in the temporary table togeher with sum(b) while the 'a' in having isn't (not needed as 'a' is already a reference to a column in the result) b) was fixed by: - Added an extra remove_const() pass for GROUP BY arguments before make_join_statistics() in case of one table SELECT. This allowes get_best_group_min_max() to optimize things better. c) was fixed by: - Added test for group by optimization in JOIN::exec_inner for select->quick->get_type() == QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX item.cc: - Simplifed Item::split_sum_func2() - Split test to make them faster and easier to read - Changed last argument to Item::split_sum_func2() from bool to int to allow more flags - Added flag argument to Item::split_sum_func() to allow on to specify if the item was in the SELECT part - Changed split_sum_func2() to do nothing if called with an argument that is not a sum function and doesn't include sum functions, if we are not an argument to SELECT. opt_range.cc: - Simplified get_best_group_min_max() by calcuating first how many group_by elements. - Use join->group instead of join->group_list to test if group by, as join->group_list may be NULL if everything was optimized away. sql_select.cc: - Added an extra remove_const() pass for GROUP BY arguments before make_join_statistics() in case of one table SELECT. - Use group instead of group_list to test if group by, as group_list may be NULL if everything was optimized away. - Moved printing of "Error in remove_const" to remove_const() instead of having it in caller. - Simplified some if tests by re-ordering code. - update_depend_map_for_order() and remove_const() fixed to handle the case where make_join_statistics() has not yet been called (join->join_tab is 0 in this case)
-
- 29 Jun, 2015 6 commits
-
-
Jan Lindström authored
Crypt data was used when it was already freed. Delete crypt data more thorougly when freed.
-
Jan Lindström authored
Analysis: Flush changed page bitmaps calls log_online_follow_redo_log that later calls log_group_read_log_seg with release_mutex = true and that causes the log_sys mutex being released before log_decrypt_after_read function that later required log_sys mutex. Fix: Enter log_sys mutex before log_decrypt_after_read if mutex is released and release the mutex after the function if we acquired it before function call.
-
Sergey Vojtovich authored
Time column of SHOW PROCESSLIST was returned in microseconds after rev. 8f603bcb. Revert original timescale (seconds).
-
Sergey Vojtovich authored
TDC_element::free_tables_back() had pre-lfhash leftover code, which referenced TDC_element::free_tables via TDC_element::share. This is not correct as share may be NULL (newly inserted or to be removed), instead access free_tables directly.
-
Sergey Vojtovich authored
ORDER BY against union may confuse name resolution context, causing valid SQL statements to fail. The purpose of context change was presumably intended for the duration of gathering field list for ORDER BY. However it isn't actually required (name resolution context is never accessed by the latter). See also alternative solution (in MySQL 5.7): 92145b95.
-
Jan Lindström authored
Test create_or_replace should make sure that background decrypt operation is finished and flush all dirty pages using restart to clean up the database before ending.
-
- 28 Jun, 2015 6 commits
-
-
Sergei Golubchik authored
-
Alexander Barkov authored
It's now needed outside of Item_bool_func2 any more.
-
Sergei Golubchik authored
-
Alexander Barkov authored
-
Sergei Golubchik authored
-
Sergei Golubchik authored
fix two #if MYSQL_VERSION_ID > 100105
-
- 27 Jun, 2015 15 commits
-
-
Sergei Golubchik authored
-
Sergei Golubchik authored
-
Sergei Golubchik authored
-
Sergei Golubchik authored
-
Sergei Golubchik authored
SEQ_READ_APPEND is for two threads (reader and writer) simultaneously accessing the IO_CACHE
-
Sergei Golubchik authored
Pretend that CREATE TABLE and CREATE TEMPORARY TABLE are two different commands internally. The user doesn't need to know that they both are SQLCOM_CREATE_TABLE. Same for DROP [TEMPORARY] TABLE
-
Sergei Golubchik authored
* keep all com_xxx constants together in struct system_status_var * fix an outdated comment in sql_cmd.h * fix an off-by-one bug in mysqld.cc
-
Sergei Golubchik authored
-
Sergei Golubchik authored
as a bonus that makes CREATE TEMPORARY TEMPORARY TABLE illegal
-
Sergei Golubchik authored
Old code worked because plugin locking guaranteed that encryption plugin is deinitialized last. But compiled-in plugins are never locked. This fixes encryption failures on fulltest builder
-
Sergei Golubchik authored
-
Sergei Golubchik authored
* support statically compiled file_key_management when possible * rename encryption.encryption_create_or_replace -> encryption.create_or_replace * delete unnecessary *.opt file (including have_key_management_plugin.inc is enough) * remove unnecessary LOWER() for strings that are compared case insensitively anyway
-
Sergei Golubchik authored
Disable sys_vars.all_vars test. There's no need to write boilerplate tests for every new system variable, our INFORMATION_SCHEMA.SYSTEM_VARIABLES and sysvar_* tests are now used to show all basic properties of all variables.
-
Sergei Golubchik authored
fix aes_decrypt of yassl to support zero-length input
-
Sergei Golubchik authored
-
- 26 Jun, 2015 9 commits
-
-
Alexander Barkov authored
Moving Item_func_spatial_rel from Item_bool_func to Item_bool_func2. to make OP(const,field) use indexes. - MBR functions supported OP(const,field) optimization in 10.0, but were inintentionally broken in an earlier 10.1 change that introduced a common parent for Item_func_spatial_mbr_rel and Item_func_spatial_precise_rel. - Precise functions never supported optimization for OP(const,field). Now both MBR and precise functions support OP(const,field) optimization.
-
Alexander Barkov authored
any of the optimizer related functionality.
-
Alexander Barkov authored
count_sargable_conds() instead for Item_func_in, Item_func_null_predicate, Item_bool_func2. There other Item_int_func descendants that used to set "sargable" to true (Item_func_between, Item_equal) already have their own implementation of count_sargable_conds(). There is no sense to have two parallel coding models for the same thing.
-
Alexander Barkov authored
adding a separte class Item_func_spatial_relate for ST_RELATE(). This is a preparatory patch for: MDEV-8239 Reverse spatial operations OP(const, field) do not get optimized
-
Alexander Barkov authored
-
Jan Lindström authored
Change session only variable enforce_storage_engine to be session variable and make sure that also global value is used if session variable is not set.
-
Alexander Barkov authored
Item_func_eq's created during conversion of a ROW equality to a conjunction of scalar equalities did not set cmp_context for its arguments properly, so some of these created Item_func_eq could be later erroneously eliminated.
-
Alexander Barkov authored
MDEV-8373 Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field
-
Alexander Barkov authored
-