diff options
author | Igor Babaev <igor@askmonty.org> | 2014-02-10 17:00:51 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2014-02-10 17:00:51 -0800 |
commit | f17079fa7eff75ed831ebe09b22046b7d4b017e3 (patch) | |
tree | d2573cd6ebd7b61e1540c35db78744d07ecf73f2 /sql | |
parent | 41fd4844e8492880f9139cd9f10992a3dac390df (diff) | |
parent | 3845a89b01ee0fa83812f5e3ac6b39b25da03d3d (diff) | |
download | mariadb-git-f17079fa7eff75ed831ebe09b22046b7d4b017e3.tar.gz |
Merge 5.3->5.5
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item.h | 6 | ||||
-rw-r--r-- | sql/opt_subselect.cc | 8 | ||||
-rw-r--r-- | sql/opt_subselect.h | 2 | ||||
-rw-r--r-- | sql/sql_select.cc | 3 |
4 files changed, 14 insertions, 5 deletions
diff --git a/sql/item.h b/sql/item.h index 20b7104bcda..ec69f5316a6 100644 --- a/sql/item.h +++ b/sql/item.h @@ -2073,7 +2073,11 @@ public: tab->merge_keys.merge(field->part_of_key); if (tab->read_set) bitmap_fast_test_and_set(tab->read_set, field->field_index); - if (field->vcol_info) + /* + Do not mark a self-referecing virtual column. + Such virtual columns are reported as invalid. + */ + if (field->vcol_info && tab->vcol_set) tab->mark_virtual_col(field); } } diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index b8780b4c4ca..8135fe9dba1 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -5306,9 +5306,9 @@ bool setup_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list, through Item::cleanup() calls). */ -void cleanup_empty_jtbm_semi_joins(JOIN *join) +void cleanup_empty_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list) { - List_iterator<TABLE_LIST> li(*join->join_list); + List_iterator<TABLE_LIST> li(*join_list); TABLE_LIST *table; while ((table= li++)) { @@ -5320,6 +5320,10 @@ void cleanup_empty_jtbm_semi_joins(JOIN *join) table->table= NULL; } } + else if (table->nested_join && table->sj_subq_pred) + { + cleanup_empty_jtbm_semi_joins(join, &table->nested_join->join_list); + } } } diff --git a/sql/opt_subselect.h b/sql/opt_subselect.h index 6d3457e2843..0a74abec68b 100644 --- a/sql/opt_subselect.h +++ b/sql/opt_subselect.h @@ -28,7 +28,7 @@ int pull_out_semijoin_tables(JOIN *join); bool optimize_semijoin_nests(JOIN *join, table_map all_table_map); bool setup_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list, Item **join_where); -void cleanup_empty_jtbm_semi_joins(JOIN *join); +void cleanup_empty_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list); // used by Loose_scan_opt ulonglong get_bound_sj_equalities(TABLE_LIST *sj_nest, diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5d7594bf3d7..43ffb8bb084 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3610,6 +3610,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, if (conds && const_count) { conds= remove_eq_conds(join->thd, conds, &join->cond_value); + join->select_lex->where= conds; if (join->cond_value == Item::COND_FALSE) { join->impossible_where= true; @@ -10848,7 +10849,7 @@ void JOIN::cleanup(bool full) } if (full) { - cleanup_empty_jtbm_semi_joins(this); + cleanup_empty_jtbm_semi_joins(this, join_list); /* Ensure that the following delete_elements() would not be called twice for the same list. |