summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
Commit message (Collapse)AuthorAgeFilesLines
* Enusure that my_global.h is included firstMichael Widenius2017-08-241-1/+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
* This first patch prepared for the task MDEV-13369:Igor Babaev2017-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Optimization for equi-joins of derived tables with GROUP BY" should be considered rather as a 'proof of concept'. The task itself is targeted at an optimization that employs re-writing equi-joins with grouping derived tables / views into lateral derived tables. Here's an example of such transformation: select t1.a,t.max,t.min from t1 [left] join (select a, max(t2.b) max, min(t2.b) min from t2 group by t2.a) as t on t1.a=t.a; => select t1.a,tl.max,tl.min from t1 [left] join lateral (select a, max(t2.b) max, min(t2.b) min from t2 where t1.a=t2.a) as t on 1=1; The transformation pushes the equi-join condition t1.a=t.a into the derived table making it dependent on table t1. It means that for every row from t1 a new derived table must be filled out. However the size of any of these derived tables is just a fraction of the original derived table t. One could say that transformation 'splits' the rows used for the GROUP BY operation into separate groups performing aggregation for a group only in the case when there is a match for the current row of t1. Apparently the transformation may produce a query with a better performance only in the case when - the GROUP BY list refers only to fields returned by the derived table - there is an index I on one of the tables T used in FROM list of the specification of the derived table whose prefix covers the the fields from the proper beginning of the GROUP BY list or fields that are equal to those fields. Whether the result of the re-writing can be executed faster depends on many factors: - the size of the original derived table - the size of the table T - whether the index I is clustering for table T - whether the index I fully covers the GROUP BY list. This patch only tries to improve the chosen execution plan using this transformation. It tries to do it only when the chosen plan reaches the derived table by a key whose prefix covers all the fields of the derived table produced by the fields of the table T from the GROUP BY list. The code of the patch does not evaluates the cost of the improved plan. If certain conditions are met the transformation is applied.
* Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-07-071-1/+3
|\
| * Merge branch '10.1' into 10.2Sergei Golubchik2017-07-051-1/+3
| |\
| | * MDEV-12819 order by ordering expression changed to empty string when creatin ↵Oleksandr Byelkin2017-06-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | view with union prepare of "fake_select" for union made in JOIN::prepare only if we do not execute it then before reset, i.e it was for PS prepare and now required for CREATE VIEW to make global ORDER BY which belongs to "fake_select" prepared.
| | * Merge branch '10.0' into 10.1Sergei Golubchik2016-08-251-0/+6
| | |\
| | | * Merge branch '5.5' into 10.0Sergei Golubchik2016-08-101-0/+6
| | | |\
| | | | * MDEV-9304: MariaDB crash with specific queryVicențiu Ciorbaru2016-08-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | tmp_join may get its tables freed twice during JOIN cleanup. Set them to NULL when the tmp_join is different than the current join.
| | | * | Fix for MDEV-8321, MDEV-6223Sergei Petrunia2015-10-061-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EXPLAIN INSERT ... SELECT tried to use SELECT's execution path. This caused a collection of problems: - SELECT_DESCRIBE flag was not put into select_lex->options, which means it was not in JOIN::select_options either (except for the first member of the UNION). - This caused UNION members to be executed. They would attempt to write join output rows to the output. - (Actual cause of the crash) second join sibling would call result->send_eof() when finished execution. Then, Explain_query::print_explain would attempt to write to query output again, and cause an assertion due to non-empty query output.
* | | | | MDEV-12775 Reuse data type aggregation code for hybrid functions and UNIONAlexander Barkov2017-05-151-35/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introducing a new class Type_holder (used internally in sql_union.cc), to reuse exactly the same data type attribute aggregation Type_handler API for hybrid functions and UNION. This fixes a number of bugs in UNION: - MDEV-9495 Wrong field type for a UNION of a signed and an unsigned INT expression - MDEV-9497 UNION and COALESCE produce different field types for DECIMAL+INT - MDEV-12594 UNION between fixed length double columns does not always preserve scale - MDEV-12595 UNION converts INT to BIGINT - MDEV-12599 UNION is not symmetric when mixing INT and CHAR Details: - sql_union.cc: Reusing attribute aggregation for UNION. Adding new methods: * st_select_lex_unit::join_union_type_handlers() * st_select_lex_unit::join_union_type_attributes() * st_select_lex_unit::join_union_item_types() Removing the old join_types()-based code. - Changing Type_handler::Item_hybrid_func_fix_attributes() to accept "name", Type_handler_hybrid_field_type, Type_all_attributes as three separate parameters instead of a single Item_hybrid_func parameter, to make it possible to pass both Item_hybrid_func and Type_holder. - Moving the former special GEOMETRY and ENUM/SET attribute aggregation code from Item_type_holder::join_types() to * Type_handler_typelib::Item_hybrid_func_fix_attributes(). * Type_handler_geometry::Item_hybrid_func_fix_attrubutes(). This makes GEOMETRY/ENUM/SET symmetric with all other data types (from the UNION point of view). Removing Item_type_holder::join_types() and Item_type_holder::get_full_info(). - Adding new methods into Type_all_attributes: * Type_all_attributes::set_geometry_type() and Item_hybrid_func::set_geometry_type(). * Adding Type_all_attributes::get_typelib(). * Adding Type_all_attributes::set_typelib(). - Adding Type_handler_typelib as a common parent for Type_handler_enum and Type_handler_set, to avoid code duplication: they have already had two common methods, and we're adding one more shared method. - Adding Type_all_attributes::set_maybe_null(), as some type handlers may want to set maybe_null (e.g. Type_handler_geometry) during data type attribute aggregation. - Changing Type_geometry_attributes() to accept Type_handler and Type_all_attributes as two separate parameters, instead of a single Item parameter, to make it possible to pass Type_holder. - Adding Item_args::add_argument(). - Moving Item_args::alloc_arguments() from "protected" to "public". - Moving Item_type_holder::Item_type_holder() from item.cc to item.h, as now it's very simple. Btw, this constructor should probably be eventually removed. It's now used only in sql_show.cc, which could be modified to use Item_return_decimal (for symmetry with Item_return_xxx created for all other data types). Or, another option: remove all Item_return_xxx and use Item_type_holder for all data types instead. - storage/tokudb/mysql-test/tokudb/r/type_float.result Recording new results (MDEV-12594). - mysql-test/r/cte_recursive.result Recording new results (MDEV-9497) - mysql-test/r/subselect*.result Recording new results (MDEV-12595) - mysql-test/r/metadata.result Recording new results (MDEV-9495) - mysql-test/r/temp_table.result Recording new results (MDEV-12594) - mysql-test/r/type_float.result Recording new results (MDEV-12594)
* | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-05-051-3/+11
|\ \ \ \ \ | |/ / / /
| * | | | Fixed the bug mdev-12556.Igor Babaev2017-04-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the rows produced on the current iteration are sent to the temporary table T of the UNION type created for CTE the rows that were not there simultaneously are sent to the temporary table D that contains rows for the next iteration. The test whether a row was in T checks the return code of writing into T. If just a HEAP table is used for T then the return code is HA_ERR_FOUND_DUPP_KEY, but if an ARIA table is used for T then the return code is HA_ERR_FOUND_DUPP_UNIQUE. The implementation of select_union_recursive::send_data() erroneously checked only for the first return code. So if an Aria table was used for T then all rows produced by the current iteration went to D and and in most cases D grew with each iteration. Whether T has reached stabilization is detected by checking whether D is empty. So as a result, the iterations were never stopped unless a limit for them was set. Fixed by checking for both HA_ERR_FOUND_DUPP_KEY and HA_ERR_FOUND_DUPP_UNIQUE as return codes returned by the function writing a row into the temporary table T.
| * | | | Fixed the bug mdev-12554.Igor Babaev2017-04-221-1/+1
| | | | | | | | | | | | | | | | | | | | When the WHERE condition is always FALSE then JOIN::join_tab is NULL.
| * | | | Fixed the bug mdev-12519.Igor Babaev2017-04-211-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixed some problems that occurred with subqueries that contained directly or indirectly recursive references to recursive CTEs. 1. A [NOT] IN predicate with a constant left operand and a non-correlated subquery as the right operand used in the specification of a recursive CTE was considered as a constant predicate and was evaluated only once. Now such a predicate is re-evaluated after every iteration of the process that produces the records of the recursive CTE. 2. The Exists-To-IN transformation could be applied to [NOT] IN predicates with recursive references. This opened a possibility of materialization for the subqueries used as right operands. Yet, materialization is prohibited for the subqueries if they contain a recursive reference. Now the Exists-To-IN transformation cannot be applied for subquery predicates with recursive references. The function st_select_lex::check_subqueries_with_recursive_references() is called now only for the first execution of the SELECT.
* | | | | Moving a part of st_select_lex_unit::prepare() into a new method prepare_join()Alexander Barkov2017-04-261-49/+70
| | | | | | | | | | | | | | | | | | | | | | | | | This is to simplify the logic inside st_select_lex_unit::prepare(), to implement data type aggregation for pluggable data types.
* | | | | Changing field::field_name and Item::name to LEX_CSTRINGMonty2017-04-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* | | | | Merge remote-tracking branch 'origin/10.2' into bb-10.2-extAlexander Barkov2017-03-291-1/+1
|\ \ \ \ \ | |/ / / /
| * | | | Fixed bug mdev-12375.Igor Babaev2017-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function st_select_lex_unit::exec_recursive() incorrectly determined that a CTE mutually recursive with some others was stabilized in the case when the non-recursive part of the CTE returned an empty set. As a result the server fell into an infinite loop when executing a query using this CTE.
* | | | | MDEV-10141: Add support for INTERSECT (and common parts for EXCEPT)Oleksandr Byelkin2017-03-141-54/+309
|/ / / / | | | | | | | | | | | | MDEV-10140: Add support for EXCEPT
* | | | Fixed bug mdev-10773.Igor Babaev2017-01-281-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The temporary tables created for recursive table references should be closed in close_thread_tables(), because they might be used in the statements like ANALYZE WITH r AS (...) SELECT * from r where r is defined through recursion.
* | | | Fixed bug mdev-11674.Igor Babaev2017-01-041-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. The rows of a recursive CTE at some point may overflow the HEAP temporary table containing them. At this point the table is converted to a MyISAM temporary table and the new added rows are placed into this MyISAM table. A bug in the of select_union_recursive::send_data prevented the server from writing the row that caused the overflow into the temporary table used for the result of the iteration steps. This could lead, in particular,to a premature end of the iterations. 2. The method TABLE::insert_all_rows_into() that was used to copy all rows of one temporary table into another did not take into account that the destination temporary table must be converted to a MyISAM table at some point. This patch fixed this problem. It also renamed the method into TABLE::insert_all_rows_into_tmp_table() and added an extra parameter needed for the conversion.
* | | | Fixed bug mdev-11081.Igor Babaev2016-11-211-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of this fix was taken from the patch by Roy Lyseng for mysql-5.6 bug iBug#14740889: "Wrong result for aggregate functions when executing query through cursor". Here's Roy's comment for his patch: " The problem was that a grouped query did not behave properly when executed using a cursor. On further inspection, the query used one intermediate temporary table for the grouping. Then, Select_materialize::send_result_set_metadata created a temporary table for storing the query result. Notice that get_unit_column_types() is used to retrieve column meta-data for the query. The items contained in this list are later modified so that their result_field points to the row buffer of the materialized temporary table for the cursor. But prior to this, these result_field objects have been prepared for use in the grouping operation, by JOIN::make_tmp_tables_info(), hence the grouping operation operates on wrong column buffers. The problem is solved by using the list JOIN::fields when copying data to the materialized table. This list is set by JOIN::make_tmp_tables_info() and points to the columns of the last intermediate temporary table of the executed query. For a UNION, it points to the temporary table that is the result of the UNION query. Notice that we have to assign a value to ::fields early in JOIN::optimize() in case the optimization shortcuts due to a const plan detection. A more optimal solution might be to avoid creating the final temporary table when the query result is already stored in a temporary table. " The patch does not contain a test case, but the description of the problem corresponds exactly what could be observed in the test case for mdev-11081.
* | | | valgrind failuresSergei Golubchik2016-09-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | and a couple of collaterals: * debugging assert in my_valgrind.h * trivial cleanup in sql_union.cc
* | | | Fixed bug mdev-10736 that caused crashes.Igor Babaev2016-09-061-6/+0
| | | | | | | | | | | | | | | | | | | | The bug manifested itself for recursive definitions that used anchors over tables with blobs.
* | | | Merge 10.2 into 10.2-mdev9864.Igor Babaev2016-08-301-4/+3
|\ \ \ \
| * | | | cleanup: change Item::walk() to take void* not uchar*Sergei Golubchik2016-06-301-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | and remove all related casts to uchar* also remove a couple of unused methods
| * | | | Merge branch '10.2' into bb-10.2-mdev9543Sergei Petrunia2016-03-281-3/+13
| |\ \ \ \
| * | | | | This is the consolidated patch for mdev-8646:bb-10.2-mdev8646Igor Babaev2016-02-091-24/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Re-factor the code for post-join operations". The patch mainly contains the code ported from mysql-5.6 and created for two essential architectural changes: 1. WL#5558: Resolve ORDER BY execution method at the optimization stage 2. WL#6071: Inline tmp tables into the nested loops algorithm The first task was implemented for mysql-5.6 by Ole John Aske. It allows to make all decisions on ORDER BY operation at the optimization stage. The second task implemented for mysql-5.6 by Evgeny Potemkin adds JOIN_TAB nodes for post-join operations that require temporary tables. It allows to execute these operations within the nested loops algorithm that used to be used before this task only for join queries. Besides these task moves all planning on the execution of these operations from the execution phase to the optimization phase. Some other re-factoring changes of mysql-5.6 were pulled in, mainly because it was easier to pull them in than roll them back. In particular all changes concerning Ref_ptr_array were incorporated. The port required some changes in the MariaDB code that concerned the functionality of EXPLAIN and ANALYZE. This was done mainly by Sergey Petrunia.
* | | | | | mdev-9864: cleanup, re-factoring.Igor Babaev2016-08-291-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added comments. Added reaction for exceeding maximum number of elements in with clause. Added a test case to check this reaction. Added a test case where the specification of a recursive table uses two non-recursive with tables.
* | | | | | mdev-9864: cleanup, re-factoring.Igor Babaev2016-08-261-18/+21
| | | | | | | | | | | | | | | | | | | | | | | | Added comments.
* | | | | | Removed the parameter from st_select_lex_unit::exec_recursive.Igor Babaev2016-08-101-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moved checking whether the limit set for the number of iterations when executing a recursive query has been reached from st_select_lex_unit::exec_recursive to TABLE_LIST::fill_recursive. Changed the name of the system variable max_recursion_level for max_recursive_iterations. Adjusted test cases.
* | | | | | MDEV-10372: EXPLAIN fixes for recursive CTEs, including FORMAT=JSONSergei Petrunia2016-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Tabular EXPLAIN now prints "RECURSIVE UNION". - There is a basic implementation of EXPLAIN FORMAT=JSON. - it produces "recursive_union" JSON struct - No other details or ANALYZE support, yet.
* | | | | | Fixed the following problem:Igor Babaev2016-07-261-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Temporary tables created for recursive CTE were instantiated at the prepare phase. As a result these temporary tables missed indexes for look-ups and optimizer could not use them.
* | | | | | Simplified the code that fills recursive tables.Igor Babaev2016-06-251-84/+64
| | | | | |
* | | | | | The method With_element::reset_for_exec was not called in non-debugIgor Babaev2016-06-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | builds.
* | | | | | Fixed numerous problems for mutually recursive CTE.Igor Babaev2016-06-061-19/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Actually mutually recursive CTE were not functional. Now the code for mutually recursive CTE looks like functional, but still needs re-writing. Added many new test cases for mutually recursive CTE.
* | | | | | Fixed the problem of wrong identification of WITH tables defined in WITH ↵Galina Shalygina2016-05-241-39/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clauses without RECURSIVE. Added test cases to check the fix. Fixed the problem of wrong types of recursive tables when the type of anchor part does not coincide with the type of recursive part. Prevented usage of marerialization and subquery cache for subqueries with recursive references. Introduced system variables 'max_recursion_level'. Added a test case to test usage of this variable.
* | | | | | Fixed many problems in the code of With_element::check_unrestricted_recursive().Galina Shalygina2016-05-191-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added the check whether there are set functions in the specifications of recursive CTE. Added the check whether there are recursive references in subqueries. Introduced boolean system variable 'standards_compliant_cte'. By default it's set to 'on'. When it's set to 'off' non-standard compliant CTE can be executed.
* | | | | | Fixed a bug that caused crashes for SHOW CREATE VIEW <view> when <view> was ↵Galina Shalygina2016-05-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | recursive. Added a test case to check the fix.
* | | | | | Made prepared statement, explain and views working with recursuve CTE.Galina Shalygina2016-05-121-3/+7
| | | | | |
* | | | | | Fixed merge problems to allow mysql-test suite 'main' to passGalina Shalygina2016-05-101-1/+1
| | | | | |
* | | | | | Main patch for mdev-9864Galina Shalygina2016-05-091-7/+246
| | | | | |
* | | | | | Merge branch '10.2' into 10.2-mdev9864Galina Shalygina2016-05-081-24/+15
| |/ / / / |/| | | |
* | | | | Merge branch '10.1' into 10.2Sergei Golubchik2016-03-231-0/+11
|\ \ \ \ \ | | |/ / / | |/| | |
| * | | | MDEV-9701: CREATE VIEW with GROUP BY or ORDER BY and constant produces ↵Oleksandr Byelkin2016-03-181-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | invalid definition Fixed printing integer constant in the ORDER clause (MySQL solution) Removed workaround for double resolving counter in the ORDER.
* | | | | Removed TABLE->sort to make it possible to have multiple active calls toMonty2016-03-221-3/+2
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | filesort and init_read_record() for the same table. This will simplify code for WINDOW FUNCTIONS (MDEV-6115) - Filesort_info renamed to SORT_INFO and moved to filesort.h - filesort now returns SORT_INFO - init_read_record() now takes a SORT_INFO parameter. - unique declaration is moved to uniques.h - subselect caching of buffers is now more explicit than before - filesort_buffer is now reusable even if rec_length has changed. - filsort_free_buffers() and free_io_cache() calls are removed - Remove one malloc() when using get_addon_fields() Other things: - Added --debug-assert-on-not-freed-memory option to make it easier to debug some not-freed-memory issues.
* | | | MDEV-9215 Detect cmp_type() and result_type() from field_type()Alexander Barkov2015-12-031-1/+1
|/ / / | | | | | | | | | Part6: Deriving Item_type_holder from Type_handler_hybrid_real_field_type
* | | Merge branch '10.0' into 10.1Sergei Golubchik2015-09-031-1/+2
|\ \ \ | |/ / | | | | | | | | | referenced_by_foreign_key2(), needed for InnoDB to compile, was taken from 10.0-galera
| * | Merge commit '96badb16afcf' into 10.0Jan Lindström2015-08-031-1/+2
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: client/mysql_upgrade.c mysql-test/r/func_misc.result mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result mysql-test/suite/innodb/r/innodb-fk.result mysql-test/t/subselect_sj_mat.test sql/item.cc sql/item_func.cc sql/log.cc sql/log_event.cc sql/rpl_utility.cc sql/slave.cc sql/sql_class.cc sql/sql_class.h sql/sql_select.cc storage/innobase/dict/dict0crea.c storage/innobase/dict/dict0dict.c storage/innobase/handler/ha_innodb.cc storage/xtradb/dict/dict0crea.c storage/xtradb/dict/dict0dict.c storage/xtradb/handler/ha_innodb.cc vio/viosslfactories.c
| | * Fixed crashing bug when using ONLY_FULL_GROUP_BY in a stored ↵Monty2015-06-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | procedure/trigger that is repeatedly executed. This is MDEV-7601, including it's sub tasks MDEV-7594, MDEV-7555, MDEV-7590, MDEV-7581, MDEV-7589 The problem was that select_lex->non_agg_fields was not properly reset for re-execution and this caused an overwrite of a random memory position. The fix was move non_agg_fields from select_lext to JOIN, which is properly reset.