summaryrefslogtreecommitdiff
path: root/mysql-test/main
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.2 into 10.3Marko Mäkelä2018-12-074-5/+57
|
* Merge 10.2 into 10.3Marko Mäkelä2018-12-042-0/+87
|
* Check that default() do not see invisible field.Oleksandr Byelkin2018-11-202-0/+4
|
* Merge 10.2 into 10.3Marko Mäkelä2018-11-201-0/+4
|
* Merge 10.2 into 10.3Marko Mäkelä2018-11-1919-9/+597
|
* MDEV-17278 CURSOR FOR LOOP - ERROR: unexpected end of stream, read 0 bytes ↵Alexander Barkov2018-11-142-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | (SERVER CRASH) sp_instr_cursor_copy_struct::exec_core() created TYPELIBs on a wrong mem_root, the one which is initialized in sp_head::execute(), this code: /* init per-instruction memroot */ init_sql_alloc(&execute_mem_root, "per_instruction_memroot", MEM_ROOT_BLOCK_SIZE, 0, MYF(0)); This memory root cleans up after every sp_instr_xxx executed, so later sp_instr_cfetch::execute() tried to use already freed and trashed memory. Changing sp_instr_cursor_copy_struct::exec_core() to call tmp.export_structure() inside this block (not outside of it): thd->set_n_backup_active_arena(thd->spcont->callers_arena, &current_arena); ... thd->restore_active_arena(thd->spcont->callers_arena, &current_arena); So now TYPELIBs created by sp_instr_cursor_copy_struct::exec_core() are still available and valid when sp_instr_cfetch::execute() is called. They are freed at the end of dispatch_command() corresponding to the "CALL p1" statement.
* MDEV-17253 Oracle compatibility: The REVERSE key word for FOR loop behaves ↵Alexander Barkov2018-11-133-8/+8
| | | | incorrectly
* MDEV-16241 Assertion `inited==RND' failed in handler::ha_rnd_end()Aleksey Midenkov2018-11-132-0/+21
| | | | | | | Discrepancy in open indexes due to overwritten `read_partitions` upon `ha_open()` in `ha_partition::clone()`. [Fixes tempesta-tech/mariadb#551]
* MDEV-17693 Shift/reduce conflicts for NAMES,ROLE,PASSWORD in the ↵Alexander Barkov2018-11-132-0/+139
| | | | option_value_no_option_type grammar
* Merge 10.2 into 10.3Marko Mäkelä2018-11-082-0/+214
|
* Merge 10.2 into 10.3Marko Mäkelä2018-11-072-0/+27
|
* MDEV-16697: Fix difference between 32bit/windows and 64bit systems in ↵Oleksandr Byelkin2018-11-072-0/+38
| | | | allowed select nest level
* MDEV-14429 sql_safe_updates in my.cnf not workSergei Golubchik2018-11-063-0/+8
| | | | add a test case
* MDEV-14429 sql_safe_updates in my.cnf not workVladislav Vaintroub2018-11-061-0/+5
|
* Merge 10.2 into 10.3Marko Mäkelä2018-11-0643-5463/+6110
| | | | | | | | | 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.
* MDEV-17518: Range optimization doesn't use ON expressions from nested outer ↵Sergei Petrunia2018-11-053-0/+47
| | | | | | | joins Part#2: take into account that join nest that we are marking as constant might already have constant tables in it. Don't count these tables twice.
* MDEV-17518: Range optimization doesn't use ON expressions from nested outer ↵Sergei Petrunia2018-11-051-0/+32
| | | | | | joins Update .result files after the previous patch
* MDEV-17518: Range optimization doesn't use ON expressions from nested outer ↵Sergei Petrunia2018-11-052-0/+55
| | | | | | | joins Continuation of the fix: Make condition selectivity estimate use the right estimate, too.
* MDEV-17493: Partition pruning doesn't work for nested outer joinsSergei Petrunia2018-11-052-0/+64
| | | | Reuse the fix for MDEV-17518 here, too.
* MDEV-17518: Range optimization doesn't use ON expressions from nested outer ↵Sergei Petrunia2018-11-054-1/+63
| | | | joins
* MDEV-17359 Concatenation operator || in like expressionhalfspawn2018-10-182-0/+167
|
* Merge 10.2 into 10.3Marko Mäkelä2018-10-176-0/+241
|
* MDEV-17419 Subquery with group by returns wrong resultsIgor Babaev2018-10-172-0/+81
| | | | Added only test case because the bug was fixed by the patch for mdev-17382.
* MDEV-17137: Syntax errors with VIEW using MEDIANVarun Gupta2018-10-162-0/+30
| | | | | | | The syntax error happened because we had not implemented a different print for percentile functions. The syntax is a bit different when we use percentile functions as window functions in comparision to normal window functions. Implemented a seperate print function for percentile functions
* MDEV-17222 Reproducible server crash in String_list::append_str orIgor Babaev2018-10-142-19/+88
| | | | | | | | | | | | | | | in Field_iterator_table::create_item When IN predicate is converted to IN subquery we have to ensure that any item from the select list of the subquery has some name and this name is unique across the select list. This was not guaranteed by the code before the patch for MDEV-17222. If the name of an item of the select list was not set, and this happened for binary constants, then the server crashed. If the first row in the IN list contained the same constant in two different positions then the server returned an error message. This was fixed by providing all constants in the first row of the IN list with generated names.
* Adjusting old tests and adding new tests for "MDEV-8765: mysqldump -use ↵Alexander Barkov2018-10-128-46/+188
| | | | utf8mb4 by default"
* MDEV-17411 Wrong WHERE optimization with simple CASE and searched CASEAlexander Barkov2018-10-112-0/+49
|
* MDEV-17381 Wrong query result with LATERAL DERIVED optimizationIgor Babaev2018-10-082-0/+82
| | | | | | and join_cache_level=6 This bug was fixed by the patch for mdev-17382 applied to 5.5.
* MDEV-17382 Hash join algorithm should not be used to join materializedIgor Babaev2018-10-083-2/+81
| | | | | | | | | | | | | | | | | | | derived table / view by equality Now rows of a materialized derived table are always put into a temporary table before join operation. If BNLH is used to join this table with the result of a partial join then both operands of the join are actually put into main memory. In most cases this is not efficient. We could avoid this by sending the rows of the derived table directly to the join operation. However this kind of data flow is not supported yet. Fixed by not allowing usage of hash join algorithm to join a materialized derived table if it's joined by an equality predicate of the form f=e where f is a field of the derived table. Change for the test case in 10.3: splitting must be turned off to preserve the explain.
* MDEV-17167 - InnoDB: Failing assertion: table->get_ref_count() == 0 uponmariadb-10.3.10Sergey Vojtovich2018-10-022-0/+50
| | | | | | | | | | truncating a temporary table TRUNCATE expects only one TABLE instance (which is used by TRUNCATE itself) to be open. However this requirement wasn't enforced after "MDEV-5535: Cannot reopen temporary table". Fixed by closing unused table instances before performing TRUNCATE.
* Merge branch '10.2' into 10.3Sergei Golubchik2018-09-2838-155/+1343
|
* MDEV-16429: Assertion `!table || (!table->read_set || ↵Nikita Malyavin2018-09-212-0/+27
| | | | | | | | | | | | | | | bitmap_is_set(table->read_set, field_index))' fails upon attempt to update virtual column on partitioned versioned table When using buffered sort in `UPDATE`, keyread is used. In this case, `TABLE::update_virtual_field` should be aborted, but it actually isn't, because it is called not with a top-level handler, but with the one that is actually going to access the disk. Here the problemm is issued with partitioning, so the solution is to recursively mark for keyread all the underlying partition handlers. * ha_partition: update keyread state for child partitions Closes #800
* MDEV-17211 Server crash on queryIgor Babaev2018-09-172-0/+63
| | | | | | | The function JOIN_TAB::choose_best_splitting() did not take into account that for some tables whose fields were used in the GROUP BY list of the specification of a splittable materialized derived there might exist no elements in the array ext_keyuses_for_splitting.
* MDEV-16917 Index affects query resultsIgor Babaev2018-09-152-0/+52
| | | | | | | | | | | | The optimizer erroneously allowed to use join cache when joining a splittable materialized table together with splitting optimization. As a consequence in some rare cases the server returned wrong result sets for queries with materialized derived. This patch allows to use either join cache without usage of splitting technique for materialization of a splittable derived table or splitting without usage of join cache when joining such table. The costs the these alternatives are compared and the best variant is chosen.
* Fixed func_time.test that was depending on current timeMonty2018-09-022-0/+2
|
* EV-16992 Assertion `table_ref->table || table_ref->view' failed inIgor Babaev2018-08-302-0/+89
| | | | | | | | | | | | | Field_iterator_table_ref::set_field_iterator Several functions that processed different prepare statements missed the DT_INIT flag in last parameter of the open_normal_and_derived_tables() calls. It made context analysis of derived tables dependent on the order in which the derived tables were processed by mysql_handle_derived(). This order was induced by the order of SELECTs in all_select_list. In 10.4 the order of SELECTs in all_select_list became different and lack of the DT_INIT flags in some open_normal_and_derived_tables() call became critical as some derived tables were not identified as such.
* Merge 10.2 into 10.3Marko Mäkelä2018-08-2824-17/+798
|
* Adjust a result for MDEV-14474Marko Mäkelä2018-08-281-0/+2
|
* MDEV-17017 Explain for query using derived table specified withIgor Babaev2018-08-271-2/+0
| | | | | | | | | | | | | a table value constructor shows wrong number of rows This is another attempt to fix this bug. The previous patch did not take into account that a transformation for ALL/ANY subqueries could be applied to the materialized table that wrapped the table value constructor used as a specification of the subselect used an ALL/ANY subquery. In this case the result of the derived table used a sink of the class select_subselect rather than of the class select_unit. Thus the previous fix could cause memory overwrites when running EXPLAIN for queries with table value constructors in ALL/ANY subselects.
* MDEV-14474 information_schema.check_constraintsAnel Husakovic2018-08-252-1/+9
| | | | | | Implement according to standard SQL specification 2008. The check_constraints table is used for fetching metadata about the constraints defined for tables in all databases.
* Corrected test results after the last change in range.testIgor Babaev2018-08-231-24/+0
|
* Move the testcase for BUG#21282 to a file that includes have_debug.incSergei Petrunia2018-08-234-52/+54
| | | | | The testcase needs to set in_predicate_conversion_threshold which is only available in debug builds (this is subject to further discussion).
* MDEV-16930 Crash when VALUES in derived table contains expressionsIgor Babaev2018-08-212-0/+56
| | | | | | | | | | | | This patch always provides columns of the temporary table used for materialization of a table value constructor with some names. Before this patch these names were always borrowed from the items of the first row of the table value constructor. When this row contained expressions and expressions were not named then it could cause different kinds of problems. In particular if the TVC is used as the specification of a derived table this could cause a crash. The names given to the expressions used in a TVC are the same as those given to the columns of the result set from the corresponding SELECT.
* MDEV-17017 Explain for query using derived table specified with a tableIgor Babaev2018-08-217-23/+111
| | | | | | | | | | value constructor shows wrong number of rows If the specification of a derived table contained a table value constructor then the optimizer incorrectly estimated the number of rows in the derived table. This happened because the optimizer did not take into account the number of rows in the constructor. The wrong estimate could lead to choosing inefficient execution plans.
* Merge branch '10.2' into 10.3Sergei Golubchik2018-08-122-0/+42
|
* Update C/C to v3.0.6Sergei Golubchik2018-08-121-0/+6
|
* MDEV-15127 AddressSanitizer: stack-buffer-overflow in base_list::push_back ..Sachin2018-08-072-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem:- If we try to run this query with -WITH_ASAN=ON compiled server CREATE TABLE t1 (i INT); SET debug_dbug="+d,test_completely_invisible,test_invisible_index"; CREATE TABLE t2 LIKE t1; This will generate a stack buffer overflow error. ==8922==ERROR: AddressSanitizer: stack-buffer-overflow on address #ADDR Analyze:- Error is generated on this line if (((*last)=new list_node(info, &end_of_list))) So info is our Key*, &end_of_list is global variable and last == #ADDR So last is suspicious variable. And last is the variable present in alter_info ->key_list. Now the question is how this key_list->last gets wrong/ different stack variable. In the backtrace, we can see that key_list is generated in mysql_create_table_like_table by calling mysql_preapre_alter_table_function and dummy key_list is created by mysql_create_like_table. In the end on mysql_prepare_alter_table we call alter_info->key_list.swap(new_key_list); So there is two options either key_list is empty or not empty , IF it is not empty then there is no issues last ptr is replaced by thd->mem_root (allocated ptr) So problem arises when key_list is empty. It swaps the dummy last ptr by mysql_prepare_alter_table declared ptr. which is wrong. Solution:- We wont swap variable if list does not have any element.
* MDEV-16801 seg_fault on a queryIgor Babaev2018-08-032-0/+87
| | | | | | | | | The bug was in the in the code of JOIN::check_for_splittable_materialized() where the structures describing the fields of a materialized derived table that potentially could be used in split optimization were build. As a result of this bug some fields that were not usable for splitting were detected as usable. This could trigger crashes further in st_join_table::choose_best_splitting().
* Merge 10.2 into 10.3Marko Mäkelä2018-08-0354-6/+1667
|
* MDEV-15363 Wrong result for CAST(LAST_DAY(TIME'00:00:00') AS TIME)Alexander Barkov2018-08-032-0/+19
| | | | | This problem was earlier fixed by the patch for MDEV-15340. Adding tests only.