summaryrefslogtreecommitdiff
path: root/mysql-test/r/view.result
Commit message (Collapse)AuthorAgeFilesLines
* 10.0-base merge.Sergei Golubchik2013-09-211-1/+1
|\ | | | | | | | | Partitioning/InnoDB changes are *not* merged (they'll come from 5.6) TokuDB does not compile (not updated to 10.0 SE API)
| * Merge 5.3->5.5.Igor Babaev2013-08-181-1/+1
| |\ | | | | | | | | | | | | | | | | | | In particular: Merged the patch for bug mdev-4418 from 5.3 into 5.5. Fixed a bug in the patch that should be backported to 5.3.
| | * Fixed bug mdev-4418.Igor Babaev2013-08-161-1/+1
| | | | | | | | | | | | | | | | | | After single row substitutions there might appear new equalities. They should be properly propagated to all AND/OR levels the WHERE condition. It's done now with an additional call of remove_eq_conds().
* | | 10.0-monty mergeSergei Golubchik2013-07-211-3/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | includes: * remove some remnants of "Bug#14521864: MYSQL 5.1 TO 5.5 BUGS PARTITIONING" * introduce LOCK_share, now LOCK_ha_data is strictly for engines * rea_create_table() always creates .par file (even in "frm-only" mode) * fix a 5.6 bug, temp file leak on dummy ALTER TABLE
| * | | fixed result (error message and error message intercepting).unknown2013-07-051-3/+1
| | | |
* | | | 10.0-base mergeSergei Golubchik2013-07-181-0/+12
|\ \ \ \ | | |/ / | |/| |
| * | | 5.3 -> 5.5 Mergeunknown2013-06-171-0/+12
| |\ \ \ | | | |/ | | |/|
| | * | MDEV-4593: p_s: crash in simplify_joins with delete using subselect from viewunknown2013-06-061-0/+12
| | | | | | | | | | | | | | | | mysql_derived_merge_for_insert() should not be called for views or derived tables which are not put (directly or via other views) in main SELECT_LEX "join list".
* | | | 10.0-base mergeSergei Golubchik2013-04-151-2/+2
|\ \ \ \ | |/ / / | | | / | |_|/ |/| |
| * | 5.3->5.5 mergeSergei Golubchik2013-02-281-2/+2
| |\ \ | | |/
| | * Fixed bug mdev-4172.Igor Babaev2013-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * Fixed bug mdev-3913.Igor Babaev2013-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | 10.0-base mergeSergei Golubchik2013-01-311-0/+41
|\ \ \ | |/ /
| * | 5.3 mergeSergei Golubchik2013-01-151-0/+41
| |\ \ | | |/
| | * MDEV-3873 & MDEV-3876 & MDEV-3912 : Wrong result (extra rows) with ALL subqueryunknown2012-12-281-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from a MERGE view. The problem was in the lost ability to be null for the table of a left join if it is a view/derived table. It hapenned because setup_table_map(), was called earlier then we merged the view or derived. Fixed by propagating new maybe_null flag during Item::update_used_tables(). Change in join_outer.test and join_outer_jcl6.test appeared because IS NULL reported no used tables (i.e. constant) for argument which could not be NULL and new maybe_null flag was propagated for IS NULL argument (Item_field) because table the Item_field belonged to changed its maybe_null status.
| | * MDEV-3914 fix.unknown2012-12-051-0/+24
| | | | | | | | | | | | Fixed algorithm of detecting of first real table in view/subquery-in-the-FROM-clase.
* | | Merge MariaDB 10.0-base to MariaDB 10.0unknown2012-12-181-0/+32
|\ \ \ | |/ /
| * | Fix of MDEV-3874: Server crashes in Item_field::print on a SELECT from a ↵unknown2012-11-261-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | MERGE view with materialization+semijoin, subquery, ORDER BY. The problem was that in debugging binaries it try to print item to assign human readable name to the item. But subquery item was already freed (join_free/cleanup with full cleanup) so Item_field refers to temporary table which memory had been already freed.
* | | MDEV-3862 Lift limitation for merging VIEWS with Subqueries in SELECT list.unknown2012-11-201-0/+106
|/ /
* | 5.3 mergeSergei Golubchik2012-10-181-0/+92
|\ \ | |/
| * Fix of MDEV-3799.unknown2012-10-101-0/+22
| | | | | | | | | | Find left table in right join (which turned to left join by reordering tables in join list but phisical order of tables of SELECT left as it was).
| * Fix of MDEV-589.unknown2012-10-051-0/+21
| | | | | | | | The problem was in incorrect detection of merged views in tem_direct_view_ref::used_tables() .
| * Added the reported test case for LP bug #823237 (a duplicate of bug #823189).Igor Babaev2012-10-011-0/+49
| |
* | Added new status variables:Michael Widenius2012-09-091-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature_dynamic_columns,feature_fulltext,feature_gis,feature_locale,feature_subquery,feature_timezone,feature_trigger,feature_xml Opened_views, Executed_triggers, Executed_events Added new process status 'updating status' as part of 'freeing items' mysql-test/r/features.result: Test of feature_xxx status variables mysql-test/r/mysqld--help.result: Removed duplicated 'language' variable. mysql-test/r/view.result: Test of opened_views mysql-test/suite/rpl/t/rpl_start_stop_slave.test: Write more information on failure mysql-test/t/features.test: Test of feature_xxx status variables mysql-test/t/view.test: Test of opened_views sql/event_scheduler.cc: Increment executed_events status variable sql/field.cc: Increment status variable sql/item_func.cc: Increment status variable sql/item_strfunc.cc: Increment status variable sql/item_subselect.cc: Increment status variable sql/item_xmlfunc.cc: Increment status variable sql/mysqld.cc: Add new status variables to 'show status' sql/mysqld.h: Added executed_events sql/sql_base.cc: Increment status variable sql/sql_class.h: Add new status variables sql/sql_parse.cc: Added new process status 'updating status' as part of 'freeing items' sql/sql_trigger.cc: Increment status variable sql/sys_vars.cc: Increment status variable sql/tztime.cc: Increment status variable
* | merge 5.3->5.5unknown2012-09-061-0/+33
|\ \ | |/
| * MDEV-486 LP BUG#1010116 fix.unknown2012-09-051-0/+33
| | | | | | | | | | | | Link view/derived table fields to a real table to check turning the table record to null row. Item_direct_view_ref wrapper now checks if table is turned to null row.
* | Merge bug#1007622 from 5.3 to 5.5Sergey Petrunya2012-07-181-0/+13
|\ \ | |/
| * Fix for LP bug#1007622unknown2012-06-261-0/+13
| | | | | | | | | | TABLE_LIST::check_single_table made aware about fact that now if table attached to a merged view it can be (unopened) temporary table (in 5.2 it was always leaf table or non (in case of several tables)).
* | Merge 5.3 -> 5.5Sergey Petrunya2012-06-201-2/+2
|\ \ | |/
| * Post-merge fixes:Sergey Petrunya2012-06-201-2/+2
| | | | | | | | | | - put back the result encoding in func_in.result (messed up by kdiff3) - update .result for other tests (checked)
* | mysql 5.5.23 mergeSergei Golubchik2012-04-101-0/+7
|\ \
| * | Bug#12626844 : WE ARE NOT CHECKING VIEW TABLE NAMESChaithra Gopalareddy2012-03-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ENOUGH - CONCAT() HACKS. ALSO WRONG ERROR MESSAGE WHILE TRYING TO CREATE A VIEW ON A NON EXISTING DATABASE PROBLEM: The first part of the problem is concluded as not a bug, as 'concat' is not a reserved word and it is completely valid to create a view with the name 'concat'. The second issue is, while trying to create a view on a non existing database, we are not giving a proper error message. FIX: We have added a check for the database existence while trying to create a view. This check would give an error as 'unknown database' when the database does not exist. This patch is a backport of the patch for Bug#13601606 mysql-test/r/view.result: Added test case result of Bug#12626844 mysql-test/t/view.test: Added test case for Bug#12626844 sql/sql_view.cc: Added a check for database existence in mysql_create_view
* | | mergeSergei Golubchik2012-04-071-0/+39
|\ \ \ | | |/ | |/|
| * | Fixed LP bug #972973.Igor Babaev2012-04-071-0/+19
| | | | | | | | | | | | | | | | | | When the function free_tmp_table deletes the handler object for a temporary table the field TABLE::file for this table should be set to NULL. Otherwise an assertion failure may occur.
| * | Fixed bug #915222.Igor Babaev2012-04-061-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | This bug happened because the function find_field_in_view formed autogenerated names of view columns without a possibility to roll them back. In some situation it could cause memory misuses reported by valgrind or even crashes.
* | | 5.3.4 mergeSergei Golubchik2012-02-151-1/+63
|\ \ \ | |/ /
| * | Moving LP BUG#794005 to 5.3 + fixing INSERT of multi-table view.unknown2012-02-031-0/+60
| | |
| * | MergeIgor Babaev2012-01-181-1/+1
| |\ \
| | * | Fixed LP bug #917990.Igor Babaev2012-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the expression for a derived table of a query contained a LIMIT clause the estimate of the number of rows in this derived table returned by the EXPLAIN command could be badly off since the optimizer ignored the limit number from the LIMIT clause when getting the estimate. The call of the method SELECT_LEX_UNIT->set_limit added in the code of mysql_derived_optimize() will be needed also in maria-5.5 where parameters in the LIMIT clause are supported.
| * | | Adjust test results after Monty's push of the newunknown2012-01-181-0/+2
| |/ / | | | | | | | | | handler counter Handler_read_rnd_deleted.
* | | 5.3 mergeSergei Golubchik2012-01-131-0/+3
|\ \ \ | |/ /
| * | Made the optimizer switch flags 'outer_join_with_cache', 'semijoin_with_cache'Igor Babaev2011-12-151-0/+3
| | | | | | | | | | | | set to 'on' by default.
* | | 5.3->5.5 mergeSergei Golubchik2011-11-221-2/+22
|\ \ \ | |/ /
| * | Making subquery cache on by default.unknown2011-10-051-2/+2
| | |
| * | BUG#833600: Wrong result with view + outer join + uncorrelated subquery ↵Sergey Petrunya2011-09-081-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | (non-semijoin) - The bug was caused by outer join being incorrectly converted into inner because of invalid return values of Item_direct_view_ref::not_null_tables(). - Provided a correct Item_direct_view_ref::not_null_tables() function.
* | | merge with 5.3Sergei Golubchik2011-10-191-12/+457
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sql/sql_insert.cc: CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. ****** CREATE ... IF NOT EXISTS may do nothing, but it is still not a failure. don't forget to my_ok it. sql/sql_table.cc: small cleanup ****** small cleanup
| * | Fixed LP bug #823189.Igor Babaev2011-08-111-4/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | The method Item_ref::not_null_tables() returned incorrect bitmap for outer references to view columns. This could cause an invalid conversion of an outer join into an inner join that could lead to a wrong result set for a query with a correlated subquery over an outer join whose where condition had an outer reference to a view.
| * | Merge.Igor Babaev2011-07-211-31/+0
| |\ \
| | * | Made the optimizer switches 'derived_merge' and 'derived_with_keys'Igor Babaev2011-07-211-31/+0
| | | | | | | | | | | | | | | | | | | | off by default.
| * | | Fix for LP BUG#806071unknown2011-07-211-3/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of two views with subqueries it is dificult to decide about order of injected ORDER BY clauses. A simple solution is just prohibit ORDER BY injection if there is other order by. mysql-test/r/view.result: New test added, old test changed. mysql-test/t/view.test: New test aded. sql/share/errmsg.txt: new warning added. sql/sql_view.cc: Inject ORDER BY only if there is no other one. Warning about ignoring ORDER BY in this case for EXPLAIN EXTENDED.