diff options
author | Igor Babaev <igor@askmonty.org> | 2020-03-23 19:20:48 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2020-03-23 19:21:57 -0700 |
commit | caf110fa5226870dc2e4b00139b566ac872c943f (patch) | |
tree | 16f54b7b6fe8538363687093d461004a49dbd5d9 /sql/opt_split.cc | |
parent | fd5c36bed5de65e85900c9fc9f0ed2092c4b38c5 (diff) | |
download | mariadb-git-caf110fa5226870dc2e4b00139b566ac872c943f.tar.gz |
MDEV-21883 Server crashes when joining a subselect with 32 tables and GROUP BY
This bug could cause a crash for any query that used a derived table/view/CTE
whose specification was a SELECT with a GROUP BY clause and a FROM list
containing 32 or more table references.
The problem appeared only in the cases when the splitting optimization
could be applied to such derived table/view/CTE.
Diffstat (limited to 'sql/opt_split.cc')
-rw-r--r-- | sql/opt_split.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/opt_split.cc b/sql/opt_split.cc index 6f8248c315c..c70fac49930 100644 --- a/sql/opt_split.cc +++ b/sql/opt_split.cc @@ -968,7 +968,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, The plan for the chosen key has not been found in the cache. Build a new plan and save info on it in the cache */ - table_map all_table_map= (1 << join->table_count) - 1; + table_map all_table_map= (((table_map) 1) << join->table_count) - 1; reset_validity_vars_for_keyuses(best_key_keyuse_ext_start, best_table, best_key, remaining_tables, true); choose_plan(join, all_table_map & ~join->const_table_map); |