summaryrefslogtreecommitdiff
path: root/sql/opt_subselect.h
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2013-09-20 14:47:38 +0400
committerSergey Petrunya <psergey@askmonty.org>2013-09-20 14:47:38 +0400
commit422c55a2404a7ec31d43962cdda0d782ef32dc45 (patch)
tree4310e7a0342103f322325b1c936374a0600cc178 /sql/opt_subselect.h
parent33f807fd91826013499c996f9515838cf2c6d0c5 (diff)
downloadmariadb-git-422c55a2404a7ec31d43962cdda0d782ef32dc45.tar.gz
MDEV-5037: Server crash on a JOIN on a derived table with join_cache_level > 2
- The crash was caused because the optimizer called handler->multi_range_read_info() on a derived temporary table. That table has been created, but not opened yet. Because of that, handler::table was NULL, which caused crash. Fixed by changing DS-MRR methods to use handler::table_share instead. handler::table_share is set in handler ctor, so this should be safe.
Diffstat (limited to 'sql/opt_subselect.h')
-rw-r--r--sql/opt_subselect.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/opt_subselect.h b/sql/opt_subselect.h
index 1e8b4cc50a1..6d3457e2843 100644
--- a/sql/opt_subselect.h
+++ b/sql/opt_subselect.h
@@ -192,7 +192,7 @@ public:
(PREV_BITS(key_part_map, max_loose_keypart+1) & // (3)
(found_part | loose_scan_keyparts)) == // (3)
PREV_BITS(key_part_map, max_loose_keypart+1) && // (3)
- !key_uses_partial_cols(s->table, key))
+ !key_uses_partial_cols(s->table->s, key))
{
/* Ok, can use the strategy */
part1_conds_met= TRUE;