summaryrefslogtreecommitdiff
path: root/mysql-test/t
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'github/10.2' into 10.3Sergei Golubchik2018-05-222-70/+0
|\
| * Merge branch '10.1' into 10.2Sergei Golubchik2018-05-207-18/+112
| |\
| | * Merge branch '10.0' into 10.1Sergei Golubchik2018-05-197-18/+110
| | |\
| | | * Merge branch '5.5' into 10.0Sergei Golubchik2018-05-195-18/+71
| | | |\
| | | | * MDEV-16220 MTR - do not pass UTF8 on the command line for mysql client.Vladislav Vaintroub2018-05-184-18/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It should work ok on all Unixes, but on Windows ,only worked by accident in the past, with client not being Unicode safe. It stopped working with Visual Studio 2017 15.7 update now.
| | | | * MDEV-15318 CREATE .. SELECT VALUES produces invalid table structureSergei Golubchik2018-05-171-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Item_insert_value needs a dummy field, use zero-length Field_string, not Field_null. The latter isn't compatible with CREATE ... SELECT.
| | | * | MDEV-11129 CREATE OR REPLACE TABLE t1 AS SELECT spfunc() crashes if spfunc() ↵Monty2018-05-161-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | references t1 Fixed by extending unique_table() with a flag to not allow usage of the replaced table. I also cleaned up find_dup_table() to not use goto next. I also added more comments to the code in find_dup_table()
| | | * | Fix that FLUSH TABLES FOR EXPORT also works for Aria tables.Monty2018-05-161-0/+13
| | | | | | | | | | | | | | | | | | | | - Added missing test case for MyISAM
| | * | | MDEV-15347: Valgrind or ASAN errors in mysql_make_view on query from ↵Oleksandr Byelkin2018-05-151-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | information_schema Make each lex pointing to statement lex instead of global pointer in THD (no need store and restore the global pointer and put it on SP stack).
| * | | | MDEV-16153 Server crashes in Apc_target::disable, ASAN heap-use-after-free ↵Sergei Golubchik2018-05-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in Explain_query::~Explain_query upon/after EXECUTE IMMEDIATE Explain_query must be created in the execution arena. But JOIN::optimize_inner temporarily switches to the statement arena under `if (sel->first_cond_optimization)`. This might cause Explain_query to be allocated in the statement arena. Usually it is harmless (although technically incorrect and a waste of memory), but in case of EXECUTE IMMEDIATE, Prepared_statement object and its statement arena are destroyed before log_slow_statement() call, which uses Explain_query. Fix: 1. Create Explain_query before switching arenas. 2. Before filling earlier-created Explain_query with data, set thd->mem_root from the Explain_query::mem_root
| * | | | MDEV-15581 Incorrect result (missing row) with UNION DISTINCT in anchor partsIgor Babaev2018-05-171-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code does not support recursive CTEs whose specifications contain a mix of ALL UNION and DISTINCT UNION operations. This patch catches such specifications and reports errors for them.
| * | | | MDEV-16212 Memory leak with recursive CTE that uses global ORDER BYIgor Babaev2018-05-171-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with recursive subquery There were two problems: 1. The code did not report that usage of global ORDER BY / LIMIT clauses was not supported yet. 2. The code just reset fake_select_lex of the the unit specifying a recursive CTE to NULL and that caused memory leaks in some cases.
* | | | | Merge 10.2 into 10.3Marko Mäkelä2018-05-172-0/+70
|\ \ \ \ \ | |/ / / /
| * | | | MDEV-14695: Assertion `n < m_size' failed in ↵Varun Gupta2018-05-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bounds_checked_array<Element_type>::operator In this issue we hit the assert because we are adding addition fields to the field JOIN::all_fields list. This is done because HEAP tables can't index BIT fields so we need to use an additional hidden field for grouping because later it will be converted to a LONG field. Original field will remain of the BIT type and will be returned. This happens when we convert DISTINCT to GROUP BY. The solution is to take into account the number of such hidden fields that would be added to the field JOIN::all_fields list while calculating the size of the ref_pointer_array.
| * | | | MDEV-15461 Check Constraints with binary logging makes insert inconsistentMonty2018-05-151-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that verify_constraints() didn't check if there was an error as part of evaluating constraints (can happen in strict mode). In one-row-insert the error was ignored when using binary logging as binary logging clear errors if insert succeeded. In multi-row-insert the error was noticed for the second row. After this fix one will get an error for both one and multi-row inserts if the constraints generates a warning in strict mode.
| * | | | MDEV-16110 ALTER with ALGORITHM=INPLACE breaks temporary table with virtual ↵Sergei Golubchik2018-05-151-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | columns Part one, non-temporary tables. Rrenaming a column can make destructive changes to the TABLE. This TABLE cannot be used anymore and needs to be reopened even if ALTER TABLE was aborted with an error.
| * | | | MDEV-15755 Query crashing MariaDB in cleanup_after_querySergei Golubchik2018-05-151-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | set the pointer to NULL to avoid double-free when the item is cleaned up many times (once in JOIN_TAB::cleanup(): tmp->jtbm_subselect->cleanup() and once at the end of the query, with all other items)
| * | | | MDEV-16101: ADD PARTITION on table partitioned by list does not work with ↵Jacob Mathew2018-05-141-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | more than 32 list values. This problem occured because the reorganization of the list of values when the number of elements exceeds 32 was not handled correctly. I have fixed the problem by fixing the way that the list values are reorganized when the number of list values exceeds 32. Author: Jacob Mathew. Reviewer: Alexey Botchkov. Merged From: Commit 8e01598 on branch bb-10.3-MDEV-16101
| * | | | MDEV-16090: Server crash in in Item_func_in::val_int or assertion `in_item'Galina Shalygina2018-05-121-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | failure upon SELECT with impossible condition The problem appears because of a wrong implementation of the Item_func_in::build_clone() method. It didn't clone 'array' and 'cmp_fields' fields for the cloned IN predicate and this could cause crashes. The Item_func_in::fix_length_and_dec() method was refactored and a new method named Item_func_in::create_array() was created. It allowed to create 'array' for cloned IN predicates in a proper way.
| * | | | MDEV-16088: Pushdown into materialized views/derived tables doesn'tGalina Shalygina2018-05-121-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | work in the IN subqueries The pushdown into the materialized derived table/view wasn't done because optimize() for the derived was called before any conditions that can be pushed down were extracted. So optimize() in convert_join_subqueries_to_semijoins() method is called too early and is unnecessary. The second optimize() call in mysql_handle_single_derived() is enough.
| * | | | MDEV-15853: Assertion `tab->filesort_result == 0' failedVarun Gupta2018-05-111-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue here is that the window function execution is not called for the correct join tab, when we have GROUP BY where we create extra temporary tables then we need to call window function execution for the last join tab. For doing so the current code does not take into account the JOIN::aggr_tables. Fixed by introducing a new function JOIN::total_join_tab_cnt that takes in account the temporary tables also.
| * | | | Merge branch '10.1' into 10.2Sergei Golubchik2018-05-105-0/+97
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.0' into 10.1Sergei Golubchik2018-05-082-0/+13
| | |\ \ \ | | | |/ /
| | | * | MDEV-15216 Assertion `! is_set() || m_can_overwrite_status' failed in ↵Sergei Golubchik2018-05-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Diagnostics_area::set_error_status upon operation inside XA don't implicitly commit or rollback in mysql_admin_table() unless the statement has CF_IMPLICIT_COMMIT_END flag.
| | | * | rename a testSergei Golubchik2018-05-071-0/+0
| | | | |
| | * | | Merge branch '10.0' into 10.1Sergei Golubchik2018-05-053-0/+84
| | |\ \ \ | | | |/ /
| | | * | Merge branch '5.5' into 10.0mariadb-10.0.35Sergei Golubchik2018-05-011-0/+12
| | | |\ \ | | | | |/
| | | | * Use after free in authenticationSergei Golubchik2018-05-011-0/+12
| | | | |
| | | * | Merge branch '5.5' into 10.0Sergei Golubchik2018-04-292-0/+72
| | | |\ \ | | | | |/
| | | | * MDEV-15035 Wrong results when calling a stored procedureIgor Babaev2018-04-251-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | multiple times with different arguments. If the ON expression of an outer join is an OR formula with one of the disjunct being a constant formula then the expression cannot be null-rejected if the constant formula is true. Otherwise it can be null-rejected and if so the outer join can be converted into inner join. This optimization was added in the patch for mdev-4817. Yet the code had a defect: if the query was used in a stored procedure with parameters and the constant item contained some of them then the value of this constant item depended on the values of the parameters. With some parameters it may be true, for others not. The validity of conversion to inner join is checked only once and it happens only for the first call of procedure. So if the parameters in the first call allowed the conversion it was done and next calls used the transformed query though there could be calls whose parameters made the conversion invalid. Fixed by cheking whether the constant disjunct in the ON expression originally contained an SP parameter. If so the expression is not considered as null-rejected. For this check a new item's attribute was intruduced: Item::with_param. It is calculated for each item by fix fields() functions. Also moved the call of optimize_constant_subqueries() in JOIN::optimize after the call of simplify_joins(). The reason for this is that after the optimization introduced by the patch for mdev-4817 simplify_joins() can use the results of execution of non-expensive constant subqueries and this is not valid.
| | | | * MDEV-13699: Assertion `!new_field->field_name.str || ↵Oleksandr Byelkin2018-04-251-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strlen(new_field->field_name.str) == new_field->field_name.length' failed in create_tmp_table on 2nd execution of PS with semijoin The problem was that SJ (semi-join) used secondary list (array) of subquery select list. The items there was prepared once then cleaned up (but not really freed from memory because it was made in statement memory). Original list was not prepared after first execution because select was removed by conversion to SJ. The solution is to use original list but prepare it first.
| * | | | MDEV-15746 ASAN heap-use-after-free in ↵Sergei Golubchik2018-05-101-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Item_change_list::rollback_item_tree_changes on ALTER executed as PS don't try to convert a default value string from a user character set into a column character set, if this particular default value string did not came from the user at all (that is, if it's an ALTER TABLE and the default value string is the *old* default value of the unaltered column). This used to crash, because old defaults are allocated on the old table's memroot, which is freed mid-ALTER when the old table is closed. So thd->rollback_item_tree_changes() at the end of the ALTER was writing into the freed memory.
| * | | | Added the test case from MDEV-16086 tfixed by the patch for MDEV-15575Igor Babaev2018-05-071-0/+32
| | | | |
| * | | | Changed the test case for MDEV-15571Igor Babaev2018-04-241-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It has been done to demonstrate that the fix of this bug is good for 10.3 as well. The previous test case is not good for this purpose because 10.2 and 10.3 use different rules for determining the types of recursive CTEs.
| * | | | Merge 10.1 into 10.2Marko Mäkelä2018-04-245-0/+83
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.0 into 10.1Marko Mäkelä2018-04-245-0/+83
| | |\ \ \ | | | |/ /
| | | * | Merge branch '5.5' into 10.0Sergei Golubchik2018-04-205-0/+83
| | | |\ \ | | | | |/
| | | | * BUG#26881798: SERVER EXITS WHEN PRIMARY KEY IN MYSQL.PROC IS DROPPEDSergei Golubchik2018-04-191-0/+10
| | | | | | | | | | | | | | | | | | | | test case
| | | | * MDEV-14515 ifnull result depends on number of rows in joined tableIgor Babaev2018-04-161-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Any expensive WHERE condition for a table-less query with implicit aggregation was lost. As a result the used aggregate functions were calculated over a non-empty set of rows even in the case when the condition was false.
| | | | * MDEV-14185 CREATE TEMPORARY TABLE AS SELECT causes error 1290 with read_only ↵Alexey Botchkov2018-04-071-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and InnoDB. handler::ha_create_handler_files shouldn't call the mark_trx_read_write() for the temporary table.
| | | | * MDEV-15624 Changing the default character set to utf8mb4 changes query ↵Alexander Barkov2018-04-042-0/+41
| | | | | | | | | | | | | | | | | | | | evaluation in a very surprising way
| * | | | MDEV-15894 Error, while using aggregated functions/window functions in ↵Igor Babaev2018-04-171-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | anchor part Usage of aggregate/window functions in non-recursive parts of recursive CTEs is allowed. Error messages complaining about this were reported by mistake.
| * | | | MDEV-15556 MariaDB crash with big_tables=1 and CTEIgor Babaev2018-04-161-1/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug manifested itself when the optimizer chose an execution plan with an access of the recursive CTE in a recursive query by key and ARIA/MYISAM temporary tables were used to store recursive tables. The problem appeared due to passing an incorrect parameter to the call of instantiate_tmp_table() in the function With_element::instantiate_tmp_tables().
| * | | | MDEV-15571 Wrong results with big_tables=1 and CTEIgor Babaev2018-04-161-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | The cause of this bug was the same as for the bug mdev-15575. Fixed by the patch for the latter.
| * | | | MDEV-15575 different results when using CTE and big_tables=1.Igor Babaev2018-04-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug happened due to a defect of the implementation of the handler function ha_delete_all_rows() for the ARIA engine. The function maria_delete_all_rows() truncated the table, but it didn't touch the write cache, so the cache's write offset was not reset. In the scenario like in the function st_select_lex_unit::exec_recursive when first all records were deleted from the table and then several new records were added some metadata became inconsistent with the state of the cache. As a result the table scan function could not read records at the end of the table. The same defect could be found in the implementation of ha_delete_all_rows() for the MYISAM engine mi_delete_all_rows(). Additionally made late instantiation for the temporary table used to store rows that were used for each new iteration when executing a recursive CTE.
| * | | | Fixed mdev-15765 BETWEEN not working in certain casesIgor Babaev2018-04-101-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementations of the convert_to_basic_const_item() virtual function for the Item_cache classes should call cache_value() when value_cached == NULL.
| * | | | Merge branch '10.1' into 10.2Vicențiu Ciorbaru2018-04-1012-9/+307
| |\ \ \ \ | | |/ / /
| | * | | Update test cases post MDEV-10286Vicențiu Ciorbaru2018-04-093-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Table_open_cache gets adjusted on server startup to prevent an out of file descriptor error. However this means that when we reset its value to default, it does not get re-adjusted. This leads to the mtr consistency check to fail with different server status at the end of the test case as opposed to when it started. To fix the problem, do not make use of the DEFAULT keyword to set the variable back, instead save the value before any modifications and restore it from there.
| | * | | Merge branch '10.0' into 10.1Vicențiu Ciorbaru2018-04-075-0/+270
| | |\ \ \ | | | |/ /
| | | * | Merge branch '5.5' into 10.0Vicențiu Ciorbaru2018-04-033-0/+216
| | | |\ \ | | | | |/