diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2010-02-18 15:03:52 +0300 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2010-02-18 15:03:52 +0300 |
commit | 69028d5127fcf964c5ab09f0b84ff9780a3326ad (patch) | |
tree | 537ade321ada897fb93f651ffe07192bdc0d6c3d /sql/opt_table_elimination.cc | |
parent | 6e7241caa52151a9cd1a8e5648bd3e8bf6ce973c (diff) | |
download | mariadb-git-69028d5127fcf964c5ab09f0b84ff9780a3326ad.tar.gz |
LPBUG#523593: Running RQG optimizer_no_subquery crashes MariaDB
- When analying multiple equalities, take into account that they
may not have a single table field that belongs to one of the tables
that we're trying to eliminate (and they are not useful for table
elimination in that case)
mysql-test/r/table_elim.result:
LPBUG#523593: Running RQG optimizer_no_subquery crashes MariaDB
- Testcase
mysql-test/t/table_elim.test:
LPBUG#523593: Running RQG optimizer_no_subquery crashes MariaDB
- Testcase
Diffstat (limited to 'sql/opt_table_elimination.cc')
-rw-r--r-- | sql/opt_table_elimination.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/opt_table_elimination.cc b/sql/opt_table_elimination.cc index ef2a92f1797..5d952021365 100644 --- a/sql/opt_table_elimination.cc +++ b/sql/opt_table_elimination.cc @@ -1220,8 +1220,16 @@ void build_eq_mods_for_cond(Dep_analysis_context *ctx, bound_item= item; } } - exchange_sort<Dep_value_field>(fvl, compare_field_values, NULL); - add_module_expr(ctx, eq_mod, *and_level, NULL, bound_item, fvl); + /* + Multiple equality is only useful if it includes at least one field from + the table that we could potentially eliminate: + */ + if (fvl->elements) + { + + exchange_sort<Dep_value_field>(fvl, compare_field_values, NULL); + add_module_expr(ctx, eq_mod, *and_level, NULL, bound_item, fvl); + } break; } default: |