diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2020-06-30 15:20:11 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2020-07-03 20:17:20 +0200 |
commit | 94da0ff82e1f795644c5e9416518073d7d4ea8c8 (patch) | |
tree | f96bc393a8b8a1b03d7a90a85adfb1fd2f1411d3 /sql/sql_base.cc | |
parent | 263f8aff651edf1e43e385b7390c0e67ae51d358 (diff) | |
download | mariadb-git-bb-10.5-virtual.tar.gz |
MDEV-23071 remove potentially dangerouws casting to Item_in_subselectbb-10.5-virtual
Remove types casting with a help of virtual functions.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 88a28c470c0..fb546966bda 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -6328,10 +6328,11 @@ find_field_in_tables(THD *thd, Item_ident *item, for (SELECT_LEX *sl= current_sel; sl && sl!=last_select; sl=sl->outer_select()) { - Item *subs= sl->master_unit()->item; - if (subs->type() == Item::SUBSELECT_ITEM && - ((Item_subselect*)subs)->substype() == Item_subselect::IN_SUBS && - ((Item_in_subselect*)subs)->test_strategy(SUBS_SEMI_JOIN)) + Item_in_subselect *in_subs= + sl->master_unit()->item->get_IN_subquery(); + if (in_subs && + in_subs->substype() == Item_subselect::IN_SUBS && + in_subs->test_strategy(SUBS_SEMI_JOIN)) { continue; } @@ -8230,7 +8231,7 @@ bool setup_on_expr(THD *thd, TABLE_LIST *table, bool is_update) */ if (embedded->sj_subq_pred) { - Item **left_expr= &embedded->sj_subq_pred->left_expr; + Item **left_expr= embedded->sj_subq_pred->left_exp_ptr(); if ((*left_expr)->fix_fields_if_needed(thd, left_expr)) return TRUE; } |