diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2020-06-16 01:29:51 +0300 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2020-06-16 01:29:51 +0300 |
commit | 57b224a5c2b774411ca8f107b3675dd2f340ccee (patch) | |
tree | 4a1a3800036712b2a70f0ab6892ca42c9903ce6b /sql/table.h | |
parent | 32b34cb95edc1032381225b58780fc92cb449200 (diff) | |
download | mariadb-git-bb-10.3-mdev22866.tar.gz |
MDEV-22866: Server crashes in ... with not_null_range_scan=onbb-10.3-mdev22866
Starting from 10.3, the optimizer is able to detect that entire outer join
nests are constants (because of "Impossible ON") and remove them (see
mark_join_nest_as_const)
However, this was not properly accounted for in NESTED_JOIN structure
and the way check_interleaving_with_nj() uses its n_tables member to
check if the join prefix order is allowed.
(The result was that the optimizer could conclude that no join prefix is
allowed and fail an assertion)
Diffstat (limited to 'sql/table.h')
-rw-r--r-- | sql/table.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/table.h b/sql/table.h index 2bad6cbf32f..d289b6e0ab2 100644 --- a/sql/table.h +++ b/sql/table.h @@ -2932,9 +2932,11 @@ typedef struct st_nested_join Before each use the counters are zeroed by reset_nj_counters. */ uint counter; + /* - Number of elements in join_list that were not (or contain table(s) that - weren't) removed by table elimination. + Number of elements in join_list that participate in the join plan choice: + - Base tables that were not removed by table elimination + - Join nests that were not removed by mark_join_nest_as_const */ uint n_tables; nested_join_map nj_map; /* Bit used to identify this nested join*/ |