summaryrefslogtreecommitdiff
path: root/mysql-test/main
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-13628: ORed condition in pushed index condition is not removed from the ↵Varun Gupta2019-05-1117-37/+89
| | | | | | | | | | | | | | | | | WHERE So to push index condition for each join tab we have calculate the index condition that can be pushed and then remove this index condition from the original condition. This is done through the function make_cond_remainder. The problem is the function make_cond_remainder does not remove index condition when there is an OR operator. Fixed this by making the function make_cond_remainder to keep in mind of the OR operator. Also updated results for multiple test files which were incorrectly updated by the commit e0c1b3f24246d22e6785315f9a8448bd9a590422 code which was supposed to remove the condition present in the index condition was not getting executed when the condition had OR operator, with AND the pushed index condition was getting removed from where. This problem affects all versions starting from 5.5 but this is a performance improvement, so fixing it in 10.4
* MDEV-8553: Impossible where for a!=a, a<a, a>aDaniel Black2019-05-102-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | | For a table column `a`, the above expressions logically equate to false in all cases. With this patch the optimizer knows about this and queries like: SELECT * FROM t1 WHERE a!=a no longer need to evaluate a!=a for every row. The same applies if the expression was `a<a`, or `a>a` An `EXPLAIN SELECT COOUNT(*) FROM t1 WHERE a<a` will show: id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE Similarly `NOT (a!=a)` is always true. EXPLAIN SELECT COUNT(*) FROM t1 WHERE not (a!=a); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
* MDEV-19235 MariaDB Server compiled for 128 Indexes crashes at startupbb-10.4-wlad-MDEV-19235Vladislav Vaintroub2019-05-092-128/+132
| | | | | | | | | | | | | | | | With MAX_INDEXIES=64(default), key_map=Bitmap<64> is just a wrapper around ulonglong and thus "trivial" (can be bzero-ed, or memcpy-ed, and stays valid still) With MAX_INDEXES=128, key_map = Bitmap<128> is not a "trivial" type anymore. The implementation uses MY_BITMAP, and MY_BITMAP contains pointers which make Bitmap invalid, when it is memcpy-ed/bzero-ed. The problem in 10.4 is that there are many new key_map members, inside TABLE or KEY, and those are often memcopied and bzeroed The fix makes Bitmap "trivial", by inlining most of MY_BITMAP functionality. pointers/heap allocations are not used anymore.
* MDEV-18689 Simple query with extra brackets stopped workingIgor Babaev2019-05-0619-103/+235
| | | | | | | | Parenthesis around table names and derived tables should be allowed in FROM clauses and some other context as it was in earlier versions. Returned test queries that used such parenthesis in 10.3 to their original form. Adjusted test results accordingly.
* MDEV-19384 Deadlock in FTWRLMonty2019-05-062-0/+77
| | | | | | | | | | | The deadlock happened between FTWRL under open HANDLER, LOCK TABLE and DROP DATABASE Fixed by reverting the previous fix for handler open in lock_global_read_lock() Fixed the original (wrong) test case in flush_read_lock.test to be repeatable.
* Merge 10.3 into 10.4Marko Mäkelä2019-05-0518-35/+230
|\
| * MDEV-18943: Group Concat with limit not working with viewsVarun Gupta2019-05-032-0/+26
| | | | | | | | | | Adjusted the Item_func_group_concat::print function to take into account limit if present with GROUP_CONCAT
| * Merge 10.2 into 10.3Marko Mäkelä2019-05-024-18/+91
| |
| * MDEV-17655 Inconsistent grant-name usage between grant-statement and ↵Aleksey Midenkov2019-05-023-7/+7
| | | | | | | | | | | | privilege tables Closes #1044
| * Adjust the result for join_cache.testVarun Gupta2019-05-021-3/+3
| |
| * MDEV-9959: A serious MariaDB server performance bugVarun Gupta2019-04-306-7/+91
| | | | | | | | | | If a derived table has SELECT DISTINCT, provide index statistics for it so that the join optimizer in the upper select knows that ref access to the table will produce one row.
| * MDEV-10307 CAST(11068046444225730969 AS SIGNED) does not return a warningAlexander Barkov2019-04-303-0/+27
| |
* | Merge 10.3 into 10.4Marko Mäkelä2019-05-052-0/+89
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2019-04-272-0/+89
| |
* | MDEV-18117: Crash with Explain extended when using limit rows examinedVarun Gupta2019-05-032-0/+27
| | | | | | | | | | No need to set SELECT_LEX:explicit_limit when we have a limit clause that sets only the EXAMINED ROWS
* | Enable mysqlcheck and flush_read_lock testsMonty2019-05-026-20/+19
| | | | | | | | | | | | | | | | - Updated results - Run mysqlcheck without --user-stat-tables=PREFERABLY to keep results consistent - Don't allow one to run analyze table under FTWRL as analyze table nowadays has to update status tables.
* | MDEV-19363 Assertion `select_lex' failed in LEX::pop_selectIgor Babaev2019-05-012-0/+74
| | | | | | | | | | | | | | | | This patch corrects the patch for MDEV-19324. The latter did not work properly in the cases when the transformation (SELECT ... ORDER BY ...) LIMIT ... => SELECT ... ORDER BY ... LIMIT ... was applied to the operands of a set operation.
* | Test for MDEV-11874 "Data too long for column" instead of "Invalid default ↵Alexander Barkov2019-04-292-0/+68
| | | | | | | | | | | | | | | | | | value for" upon ALTER in strict mode This problem was earlier fixed by the patch for: MDEV-16421 Make system tables crash safe Adding tests only.
* | MDEV-19324 Wrong results from query, using brackets with ORDER BY ..LIMITIgor Babaev2019-04-262-0/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a select query was of the form (SELECT ... ORDER BY ...) LIMIT ... then in most cases it returned incorrect result. It happened because SELECT ... ORDER BY ... was wrapped into a select with materialized derived table: SELECT ... ORDER BY ... => SELECT * FROM (SELECT ... ORDER BY ...) dt. Yet for any materialized derived table ORDER BY without LIMIT is ignored. This patch resolves the problem by the conversion (SELECT ... ORDER BY ...) LIMIT ... => SELECT ... ORDER BY ... LIMIT ... at the parser stage. Similarly ((SELECT ... UNION ...) ORDER BY ...) LIMIT ... is converted to (SELECT ... UNION ...) ORDER BY ... LIMIT ... This conversion optimizes execution of the query because the result of (SELECT ... UNION ...) ORDER BY ... is not materialized into a temporary table anymore.
* | Merge 10.3 into 10.4Marko Mäkelä2019-04-2526-28/+881
|\ \ | |/ | | | | | | In is_eits_usable(), we disable an assertion that fails due to MDEV-19334.
| * Merge 10.2 into 10.3Marko Mäkelä2019-04-2515-0/+431
| |
| * MDEV-19239 ERROR 1300 (HY000): Invalid utf8 character string in 10.3.13-MariaDBAlexander Barkov2019-04-212-0/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A sequence of <digits>e<mbhead><mbtail>, e.g.: SELECT 123eXYzzz FROM t1; was not scanned correctly (where XY is a multi-byte character). The multi-byte head byte X was appended to 123e separately from the multi-byte tail byte Y, so a pointer to "Yzzz" was passed into scan_ident_start(), which failed on a bad multi-byte sequence. After this change, scan_ident_start() gets a pointer to "XYzzz", so it correctly sees the whole multi-byte character.
| * Backporting from 10.4 to 10.3: MDEV-17325 NULL-ability problems with LEAST() ↵Alexander Barkov2019-04-204-1/+216
| | | | | | | | | | | | | | | | | | | | in combination with NO_ZERO_DATE and NO_ZERO_IN_DATE This also fixes: MDEV-17299 Assertion `maybe_null' failed in make_sortkey Note, during merge of the 10.1 version of MDEV-17299, please use the 10.3 version of the code (i.e. null merge the 10.1 version).
* | MDEV-19317 TEXT column accepts too long literals as a default valueAlexander Barkov2019-04-252-0/+67
| | | | | | | | | | | | | | | | | | Adding new virtual methods in Field: - make_empty_rec_store_default_value() - make_empty_rec_reset() This simplifies the logic for every Field type, and makes the code more friendly to pluggable data types.
* | MDEV-19245: Impossible WHERE should be noticed earlier after HAVING pushdownbb-10.4-galinaGalina Shalygina2019-04-222-0/+74
| | | | | | | | | | | | | | | | The bug appears because not all conditions are found to be knowingly true or false in WHERE after HAVING pushdown optimization. Impossible WHERE can be found much earlier compared with how it is done now. To fix it and_new_conditions_to_optimized_cond() is changed.
* | MDEV-19255 Server crash in st_join_table::save_explain_data or assertionIgor Babaev2019-04-193-0/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `sel->quick' failure in JOIN::make_range_rowid_filters upon query with rowid_filter=ON Index ranges can be defined using conditions with inexpensive subqueries. Such a subquery is evaluated when some representation of a possible range sequence is built. After the evaluation the JOIN structure of the subsquery is distroyed. Any attempt to build the above representation may fail because the function that checks whether a subquery is inexpensive in some cases uses the join structure of the subquery. When a range rowid filter is built by a range sequence constructed out of a range condition that uses an inexpensive subquery the representation of the the sequence is built twice. Building the second representation fails due to the described problem with the execution of Item_subselect::is_expensive(). The function was corrected to return the result of the last its invocation if the Item_subselect object has been already evaluated.
* | MDEV-19224 Assertion `marked_for_read()' failedMonty2019-04-192-0/+15
| | | | | | | | | | Problem was that wrong key_info variable was used, which caused UNIQUE key to be used as a covering key
* | MDEV-19252 Problem with DBUG_ASSERT_AS_PRINTF and marked_for_write()Monty2019-04-192-0/+16
| | | | | | | | | | Problem was that DBUG_FIX_WRITE_SET was not enabled when using DBUG_ASSERT_AS_PRINTF
* | MDEV-19164 Assertion `fixed' failed in Item_func_inet_aton::val_intIgor Babaev2019-04-172-0/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When pushing a condition from HAVING into WHERE the function st_select_lex::pushdown_from_having_into_where() transforms column references in the pushed condition then performs cleanup of items of the condition and finally calls fix_fields() for the condition items. The cleanup is performed by a call of the method walk() with cleanup_processor as the first parameter. Unfortunately this sequence of calls does not work if the condition contains cached items, because fix_fields() cannot go through Item_cache items and this leaves underlying items unfixed. The solution of this problem used in this patch is just does not allow to process Item_cache objects when performing cleanup of the pushed condition. In order to let the traversal procedure walk() not to process Item_cache objects the third parameter of the used call of walk() is set to a fictitious pointer (void *) 1. And Item_cache::walk() is changed to prevent any action when it gets such value as the third parameter.
* | MDEV-19263: Server crashes in mysql_handle_single_derived upon 2nd execution ↵Oleksandr Byelkin2019-04-162-0/+42
| | | | | | | | | | | | of PS Fix case of prelocking placeholder
* | MDEV-19195 Active Record unit test fails with MariaDB 10.4.3Igor Babaev2019-04-162-32/+73
| | | | | | | | | | | | | | Currently usage of range rowid filters can be combined only with ref access and single index range access. So if the optimizer has chosen some other quick select method to access a joined table then no range rowid filter can be used for this table.
* | MDEV-17362: SIGSEGV in JOIN::optimize_inner or Assertion `fixed == 0' failed ↵Oleksandr Byelkin2019-04-162-0/+65
| | | | | | | | | | | | in Item_equal::fix_fields, server crashes after 2nd execution of PS Move reinitialisation of pushdown variables for every query, because it used now not only for derived tables.
* | MDEV-16543 Replicating to spider is fragile without retries (#1272)Kentoku SHIBA2019-04-131-3/+5
| | | | | | add changes of test results
* | Merge 10.3 into 10.4bb-10.4-supermergejanMarko Mäkelä2019-04-122-2/+2
|\ \ | |/
| * MDEV-19236 Improve error message for ↵Eugene Kosov2019-04-122-2/+2
| | | | | | | | | | | | ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE remove a sometimes misleading word INPLACE from error message
* | Merge 10.3 into 10.4Marko Mäkelä2019-04-082-0/+26
|\ \ | |/
| * Merge 10.2 into 10.3Marko Mäkelä2019-04-072-0/+26
| |
| * Merge 10.2 into 10.3Marko Mäkelä2019-04-043-0/+10
| |
* | MDEV-18956 Assertion `sel->quick' failed in JOIN::make_range_rowid_filtersIgor Babaev2019-04-053-0/+75
| | | | | | | | | | | | | | | | If SUBS_IN_TO_EXISTS strategy has been chosen for a subquery then additional conditions are injected into WHERE/ON/HAVING of this subquery and it may happen that test_quick_select() invoked from JOIN::make_range_rowid_filters() discovers impossible range. This must be checked.
* | MDEV-19186: Assertion `field->table == table' failed in create_tmp_tableGalina Shalygina2019-04-062-0/+38
| | | | | | | | | | | | | | Temporary table is defined with the view field in HAVING. Item_direct_view_ref for this field is dropped and that causes error. To fix it Item_direct_view_ref::remove_item_direct_ref() is added.
* | MDEV-19185: Pushdown constant function defined with subqueryGalina Shalygina2019-04-052-0/+33
| | | | | | | | | | | | | | | | | | The bug occurs because of the wrong pushdown of constant function defined with subquery from HAVING into WHERE. Subqueries can't be pushed into WHERE. To fix it with_subquery() call is added to check if the function contains subquery.
* | MDEV-19184 Crash in IS_IPV6(_ucs2 0x0031)Alexander Barkov2019-04-052-0/+39
| |
* | MDEV-18982 Partition pruning with column list causes syntax error in 10.4Igor Babaev2019-04-042-0/+18
| | | | | | | | | | | | | | A syntax error was reported for any INSERT statement with explicit partition selection it if i used a column list. Fixed by saving the parsing place before parsing the clause for explicit partition selection and restoring it when the clause has been parsed.
* | MDEV-18769 Assertion `fixed == 1' failed in Item_cond_or::val_intGalina Shalygina2019-04-045-29/+3530
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug is caused by pushdown from HAVING into WHERE. It appears because condition that is pushed wasn't fixed. It is also discovered that condition pushdown from HAVING into WHERE is done wrong. There is no need to build clones for some conditions that can be pushed. They can be simply moved from HAVING into WHERE without cloning. build_pushable_cond_for_having_pushdown(), remove_pushed_top_conjuncts_for_having() methods are changed. It is found that there is no transformation made for fields of pushed condition. field_transformer_for_having_pushdown transformer is added. New tests are added. Some comments are changed.
* | Removed redundant partitioning checkSergey Vojtovich2019-04-032-0/+46
| | | | | | | | | | | | | | | | | | This check was introduced in 602a222 and then became redundant in ad1553e, where we attempt to open a table even for non-copy algorithms. Added missing test case from 602a222. Part of MDEV-17805 - Remove InnoDB cache for temporary tables.
* | Removed redundant SE lock for tmp tablesSergey Vojtovich2019-04-032-0/+31
| | | | | | | | | | | | | | | | | | | | CREATE TEMPORARY TABLE locks SE plugin 6 times. 5 of these locks are released by the end of the statement. And only 1 acquired by init_from_binary_frm_image() / plugin_lock() remains. The lock removed in this patch was clearly redundant. Part of MDEV-17805 - Remove InnoDB cache for temporary tables.
* | MDEV-18820 Assertion `lock_table_has(trx, index->table, LOCK_IX)' failed in ↵Sachin2019-04-032-1/+70
| | | | | | | | | | | | | | lock_rec_insert_check_and_lock upon INSERT into table with blob key Don't Ignore Any error during index lookup, And throw duplicate key error only if error is HA_ERR_FOUND_DUPP_KEY
* | MDEV-18942: Json_writer::add_bool: Conditional jump or move depends on ↵Varun Gupta2019-04-032-0/+27
| | | | | | | | | | | | | | uninitialised value upon fulltext search under optimizer trace For keyuse of fulltext set the value for null_rejecting to FALSE as we don't add NOT NULL keys for fulltext keyuses
* | MDEV-18962: ASAN heap-buffer-overflow in ↵Varun Gupta2019-04-032-3/+21
| | | | | | | | | | | | Single_line_formatting_helper::on_add_str with optimizer trace Fixed a typo
* | MDEV-17320 add Feature_application_time_periods status variableNikita Malyavin2019-04-021-0/+1
| | | | | | | | Closes #1225