summaryrefslogtreecommitdiff
path: root/mysql-test/r
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | MDEV-4252 geometry query crashes server.Alexey Botchkov2013-03-181-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Additional fixes for possible overflows in length-related calculations in 'spatial' implementations. Checks added to the ::get_data_size() methods. max_n_points decreased to occupy less 2G size. An object of that size is practically inoperable anyway.
| | * | MDEV-4289 Assertion `0' fails in make_sortkey with GROUP_CONCAT, MAKE_SET, ↵Sergei Golubchik2013-03-181-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GROUP BY Item_func_make_set wasn't taking into account the first argument when calculating maybe_null. sql/item_strfunc.cc: rewrite Item_func_make_set, removing separate storage of the first argument sql/item_strfunc.h: rewrite Item_func_make_set, removing separate storage of the first argument
| | * | MDEV-4252 geometry query crashes server.Alexey Botchkov2013-03-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug was found by Alyssa Milburn. If the number of points of a geometry feature read from binary representation is greater than 0x10000000, then the (uint32) (num_points * 16) will cut the higher byte, which leads to various errors. Fixed by additional check if (num_points > max_n_points).
* | | | MDEV-4292 fix.unknown2013-03-261-10/+81
| | | | | | | | | | | | | | | | Fixed printing column_get finction.
* | | | MDEV-4310 geometry function equals hangs forever.Alexey Botchkov2013-03-221-12/+29
| | | | | | | | | | | | | | | | | | | | | | | | The Geometry::get_mbr() function can return an error on a bad data. We have to check for that and act respectively.
* | | | MergeSergey Petrunya2013-03-211-0/+130
|\ \ \ \ | |_|_|/ |/| | |
| * | | MDEV-4277: Crash inside mi_killed_in_mariadb() with myisammrgSergey Petrunya2013-03-211-0/+130
| | | | | | | | | | | | | | | | | | | | - Set MI_INFO::external_ref for MyISAM tables that are parts of myisamMRG table.
* | | | MDEV-4293 Valgrind warnings (Conditional jump or move depends on ↵Sergei Golubchik2013-03-201-0/+12
|/ / / | | | | | | | | | | | | | | | uninitialised value) in remove_eq_conds on time functions with NULL argument val_int() is expected to return 0 for NULL's
* | | MDEV-4283 Assertion `scale <= precision' fails in strings/decimal.cSergei Golubchik2013-03-181-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | with decimals=NOT_FIXED_DEC it is possible to have 'decimals' larger than 'max_length', it's not an error for temporal functions. But when Item_func_numhybrid converts the value to DECIMAL_RESULT, it must limit 'decimals' to be a valid scale of a decimal number.
* | | MDEV-4286 Server crashes in Protocol_text::store, stack smashing detectedSergei Golubchik2013-03-171-0/+7
| | | | | | | | | | | | | | | | | | AVG() returns a double, its max_length is reasonably limited by a double number length, even if the argument is many Kbytes long.
* | | MDEV-4281 Assertion `maybe_null && item->null_value' fails in make_sortkey ↵Sergei Golubchik2013-03-177-20/+35
| | | | | | | | | | | | | | | | | | on CASE with different return types, GROUP_CONCAT, GROUP BY Fix Item::get_date() to mark the item NULL when returning an error.
* | | Fixed bug mdev-4250.Igor Babaev2013-03-083-0/+60
| | | | | | | | | | | | | | | | | | This is a bug in the legacy code. It did not manifest itself because it was masked by other bugs that were fixed by the patches for mdev-4172 and mdev-4177.
* | | MDEV-4241 fix.unknown2013-03-061-0/+15
| | | | | | | | | | | | | | | Field_enum incorrectly inherited decimals() from Field_string. Field_enum should be always integer in numeric context.
* | | MergeIgor Babaev2013-02-281-0/+51
|\ \ \
| * | | Fixed bug mdev-4209Igor Babaev2013-02-281-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | Do not include BLOB fields into the key to access the temporary table created for a materialized view/derived table. BLOB components are not allowed in keys.
* | | | 5.2 -> 5.3Sergei Golubchik2013-02-283-0/+267
|\ \ \ \ | |/ / / |/| / / | |/ /
| * | 5.1 -> 5.2 mergeSergei Golubchik2013-02-283-0/+267
| |\ \ | | |/
| | * a simpler fix forSergei Golubchik2013-02-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MySQL Bug #12408412: GROUP_CONCAT + ORDER BY + INPUT/OUTPUT SAME USER VARIABLE = CRASH and MySQL Bug#14664077 SEVERE PERFORMANCE DEGRADATION IN SOME CASES WHEN USER VARIABLES ARE USED sql/item_func.cc: don't use anything from Item_func_set_user_var::fix_fields() in Item_func_set_user_var::save_item_result() sql/sql_class.cc: Call suv->save_item_result(item) *before* doing suv->fix_fields(), because the former evaluates the item (and caches its value), while the latter marks the user variable as non-const. The problem is that the item was fix_field'ed when the user variable was const, and it doesn't expect it to change to non-const in the middle of the execution.
| | * Fixed BUG#51763 Can't delete rows from MEMORY table with HASH keyMichael Widenius2013-02-281-0/+20
| | |
| | * Fix bug MDEV-641unknown2013-02-011-0/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis: Range analysis discoveres that the query can be executed via loose index scan for GROUP BY. Later, GROUP BY analysis fails to confirm that the GROUP operation can be computed via an index because there is no logic to handle duplicate field references in the GROUP clause. As a result the optimizer produces an inconsistent plan. It constructs a temporary table, but on the other hand the group fields are not set to point there. Solution: Make loose scan analysis work in sync with order by analysis. In the case of duplicate columns loose scan will not be applicable. This limitation will be lifted in 10.0 by removing duplicate columns.
* | | Fixed bug mdev-4177Igor Babaev2013-02-243-2/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function remove_eq_cond removes the parts of a disjunction for which it has been proved that they are always true. In the result of this removal the disjunction may be converted into a formula without OR that must be merged into the the AND formula that contains the disjunction. The merging of two AND conditions must take into account the multiple equalities that may be part of each of them. These multiple equality must be merged and become part of the and object built as the result of the merge of the AND conditions. Erroneously the function remove_eq_cond lacked the code that would merge multiple equalities of the merged AND conditions. This could lead to confusing situations when at the same AND level there were two multiple equalities with common members and the list of equal items contained only some of these multiple equalities. This, in its turn, could lead to an incorrect work of the function substitute_for_best_equal_field when it tried to optimize ref accesses. This resulted in forming invalid TABLE_REF objects that were used to build look-up keys when materialized subqueries were exploited.
* | | Fixed bug mdev-4172.Igor Babaev2013-02-212-1/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug in the legacy code could manifest itself in queries with semi-join materialized subqueries. When a subquery is materialized all conditions that are imposed only on the columns belonging to the tables from the subquery are taken into account.The code responsible for subquery optimizations that employes subquery materialization makes sure to remove these conditions from the WHERE conditions of the query obtained after it has transformed the original query into a query with a semi-join. If the condition to be removed is an equality condition it could be added to ON expressions and/or conditions from disjunctive branches (parts of OR conditions) in an attempt to generate better access keys to the tables of the query. Such equalities are supposed to be removed later from all the formulas where they have been added to. However, erroneously, this was not done in some cases when an ON expression and/or a disjunctive part of the OR condition could be converted into one multiple equality. As a result some equality predicates over columns belonging to the tables of the materialized subquery remained in the ON condition and/or the a disjunctive part of the OR condition, and the excuter later, when trying to evaluate them, returned wrong answers as the values of the fields from these equalities were not valid. This happened because any standalone multiple equality (a multiple equality that are not ANDed with any other predicates) lacked the information about equality predicates inherited from upper levels (in particular, inherited from the WHERE condition). The fix adds a reference to such information to any standalone multiple equality.
* | | Merge.Igor Babaev2013-02-2020-100/+152
|\ \ \
| * | | Fixed bug mdev-3913.Igor Babaev2013-02-2020-100/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The wrong result set returned by the left join query from the bug test case happened due to several inconsistencies and bugs of the legacy mysql code. The bug test case uses an execution plan that employs a scan of a materialized IN subquery from the WHERE condition. When materializing such an IN- subquery the optimizer injects additional equalities into the WHERE clause. These equalities express the constraints imposed by the subquery predicate. The injected equality of the query in the test case happens to belong to the same equality class, and a new equality imposing a condition on the rows of the materialized subquery is inferred from this class. Simultaneously the multiple equality is added to the ON expression of the LEFT JOIN used in the main query. The inferred equality of the form f1=f2 is taken into account when optimizing the scan of the rows the temporary table that is the result of the subquery materialization: only the values of the field f1 are read from the table into the record buffer. Meanwhile the inferred equality is removed from the WHERE conditions altogether as a constraint on the fields of the temporary table that has been used when filling this table. This equality is supposed to be removed from the ON expression when the multiple equalities of the ON expression are converted into an optimal set of equality predicates. It supposed to be removed from the ON expression as an equality inferred from only equalities of the WHERE condition. Yet, it did not happened due to the following bug in the code. Erroneously the code tried to build multiple equality for ON expression twice: the first time, when it called optimize_cond() for the WHERE condition, the second time, when it called this function for the HAVING condition. When executing optimize_con() for the WHERE condition a reference to the multiple equality of the WHERE condition is set in the multiple equality of the ON expression. This reference would allow later to convert multiple equalities of the ON expression into equality predicates. However the the second call of build_equal_items() for the ON expression that happened when optimize_cond() was called for the HAVING condition reset this reference to NULL. This bug fix blocks calling build_equal_items() for ON expressions for the second time. In general, it will be beneficial for many queries as it removes from ON expressions any equalities that are to be checked for the WHERE condition. The patch also fixes two bugs in the list manipulation operations and a bug in the function substitute_for_best_equal_field() that resulted in passing wrong reference to the multiple equalities of where conditions when processing multiple equalities of ON expressions. The code of substitute_for_best_equal_field() and the code the helper function eliminate_item_equal() were also streamlined and cleaned up. Now the conversion of the multiple equalities into an optimal set of equality predicates first produces the sequence of the all equalities processing multiple equalities one by one, and, only after this, it inserts the equalities at the beginning of the other conditions. The multiple changes in the output of EXPLAIN EXTENDED are mainly the result of this streamlining, but in some cases is the result of the removal of unneeded equalities from ON expressions. In some test cases this removal were reflected in the output of EXPLAIN resulted in disappearance of “Using where” in some rows of the execution plans.
* | | | Fix for MDEV-4140unknown2013-02-131-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis: Range analysis detects that the subquery is expensive and doesn't build a range access method. Later, the applicability test for loose scan doesn't take that into account, and builds a loose scan method without a range scan on the min/max column. As a result loose scan fetches the first key in each group, rather than the first key that satisfies the condition on the min/max column. Solution: Since there is no SEL_ARG tree to be used for the min/max column, it is not possible to use loose scan if the min/max column is compared with an expensive scalar subquery. Make the test for loose scan applicability to be in sync with the range analysis code by testing if the min/max argument is compared with an expensive predicate.
* | | | Merge.Igor Babaev2013-02-121-0/+102
|\ \ \ \
| * | | | Fixed bug mdev-3995.Igor Babaev2013-02-071-0/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug happened because the executor tried to use a wrong TABLE REF object when building access keys. It constructed keys from fields of a materialized table from a ref object created to construct keys from the fields of the underlying base table. This could happen only when materialized table was created for a non-correlated IN subquery and only when the materialized table used for lookups. In this case we are guaranteed to be able to construct the keys from the fields of tables that would be outer tables for the tables of the IN subquery. The patch makes sure that no ref objects constructed from fields of materialized lookup tables are to be used.
* | | | | MDEV-4123 fix.unknown2013-02-111-0/+51
| | | | | | | | | | | | | | | | | | | | Missed update_used_tables() call for multi-update values.
* | | | | Fix for bug MDEV-765 (LP:825075)unknown2013-02-041-0/+58
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analys: The cause for the wrong result was that the optimizer incorrectly chose min/max loose scan when it is not applicable. The applicability test missed the case when a condition on the MIN/MAX argument was OR-ed with a condition on some other field. In this case, the MIN/MAX condition cannot be used for loose scan. Solution: Extend the test check_group_min_max_predicates() to check that the WHERE clause is of the form: "cond1 AND cond2" where cond1 - does not use min_max_column at all. cond2 - is an AND/OR tree with leaves in form "min_max_column $CMP$ const" or $CMP$ is one of the functions between, is [not] null
* | | | 5.2 mergeSergei Golubchik2013-01-282-0/+25
|\ \ \ \ | | |/ / | |/| |
| * | | 5.1 mergeSergei Golubchik2013-01-252-0/+25
| |\ \ \ | | | |/ | | |/|
| | * | MDEV-729 lp:998028 - Server crashes on normal shutdown in closefrm after ↵Sergei Golubchik2013-01-251-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | executing a query from MyISAM table don't write a key value into the record buffer - a key length can be larger then the record length.
| | * | MDEV-759 lp:998340 - Valgrind complains on simple selects containing ↵Sergei Golubchik2013-01-251-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | expression DAY(FROM_UNIXTIME(-1)) check item->null_value before using the result of item->val_int()
* | | | MDEV-3875 Wrong result (missing row) on a DISTINCT query with the same ↵Sergei Golubchik2013-01-261-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | subquery in the SELECT list and GROUP BY fix remove_dup_with_hash_index() and remove_dup_with_compare() to take NULLs into account
* | | | The problem was that expression with field after transformation (on the ↵unknown2013-01-252-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | first execution) reached by fix_fields() (via reference) before row which it belongs to (on the second execution) and fix_field for row did not follow usual protocol for Items with argument (first check that the item fixed then call fix_fields). Item_row::fix_field fixed.
* | | | 5.2 mergeSergei Golubchik2013-01-253-3/+29
|\ \ \ \ | |/ / / | | | / | |_|/ |/| |
| * | MDEV-3909 remote user enumerationSergei Golubchik2013-01-251-0/+21
| | | | | | | | | | | | | | | | | | instead of returning Access denied on the incorrect user name, emulate the complete failed logic procedure, possibly with the change plugin packet.
| * | report "using password: YES/NO" correctly for the COM_CHANGE_USER failuresSergei Golubchik2013-01-251-2/+2
| | |
| * | MDEV-3915 COM_CHANGE_USER allows fast password brute-forcingSergei Golubchik2013-01-252-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | allow only three failed change_user per connection. successful change_user do NOT reset the counter tests/mysql_client_test.c: make --error to work for --change_user errors
* | | Merge 5.2->5.3Igor Babaev2013-01-212-0/+23
|\ \ \ | |/ /
| * | Merge 5.1->5.2Igor Babaev2013-01-212-0/+23
| |\ \ | | |/
| | * Merge.Igor Babaev2013-01-211-0/+15
| | |\
| | | * Fixed bug mdev-4063 (bug #56927).Igor Babaev2013-01-211-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug could result in returning 0 for the expressions of the form <aggregate_function>(distinct field) when the system variable max_heap_table_size was set to a small enough number. It happened because the method Unique::walk() did not support the case when more than one pass was needed to merge the trees of distinct values saved in an external file. Backported a fix in grant_lowercase.test from mariadb 5.5.
| | * | MDEV-4029 SELECT on information_schema using a subquery locks up the ↵Sergei Golubchik2013-01-211-0/+8
| | |/ | | | | | | | | | | | | | | | | | | | | | information_schema table due to incorrect mutexes handling Early evaluation of subqueries in the WHERE conditions on I_S.*_STATUS tables, otherwise the subquery on this same table will try to acquire LOCK_status twice.
* | | MDEV-4056 fix.unknown2013-01-161-0/+21
| | | | | | | | | | | | | | | | | | The problem was that maybe_null of Item_row and its componetes was unsynced after update_used_tables() (and so pushed_cond_guards was not initialized but then requested). Fix updates Item_row::maybe_null on update_used_tables().
* | | MDEV-3900 Optimizer difference between MySQL and MariaDB with stored ↵unknown2013-01-171-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functions in WHERE clause of UPDATE or DELETE statements Analysis The reason for the less efficient plan was result of a prior design decision - to limit the eveluation of constant expressions during optimization to only non-expensive ones. With this approach all stored procedures were considered expensive, and were not evaluated during optimization. As a result, SPs didn't participate in range optimization, which resulted in a plan with table scan rather than index range scan. Solution Instead of considering all SPs expensive, consider expensive only those SPs that are non-deterministic. If an SP is deterministic, the optimizer will checj if it is constant, and may eventually evaluate it during optimization.
* | | backport of:unknown2013-01-172-8/+8
| | | | | | | | | | | | | | | Don't reset maybe_null in update_used_tables(); This breaks ROLLUP This fixed failing test in group_by.test
* | | MDEV-3988 fix.unknown2013-01-161-0/+18
| | | | | | | | | | | | Subquery turned into constant too late to be excluded from grouping list so test for constant added to the create_temp_table().
* | | Fixed bug mdev-4025.Igor Babaev2013-01-111-2/+2
| | | | | | | | | | | | | | | | | | The bug could lead to a wrong estimate of the number of expected rows in the output of the EXPLAIN commands for queries with GROUP BY. This could be observed in the test case for LP bug 934348.
* | | 5.2->5.3 mergeSergei Golubchik2013-01-1012-15627/+51
|\ \ \ | |/ /