summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Petrunia <sergey@mariadb.com>2022-04-07 15:40:34 +0300
committerSergei Petrunia <sergey@mariadb.com>2022-04-07 15:40:34 +0300
commit5a8766a98059b93798aa34d6824c6e130727d552 (patch)
tree256bb92d719c5e5c2c34005978be5be4ff8219f3
parent53b580a91c12e9272623fc45496631be65313dd8 (diff)
downloadmariadb-git-5a8766a98059b93798aa34d6824c6e130727d552.tar.gz
Better comments in Item_in_subselect::inject_in_to_exists_cond()
-rw-r--r--sql/item_subselect.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 92ba085af5b..e01c92b7a4f 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -2757,6 +2757,8 @@ bool Item_in_subselect::inject_in_to_exists_cond(JOIN *join_arg)
}
where_item= and_items(thd, join_arg->conds, where_item);
+
+ /* This is the fix_fields() call mentioned in the comment above */
if (!where_item->fixed && where_item->fix_fields(thd, 0))
DBUG_RETURN(true);
// TIMOUR TODO: call optimize_cond() for the new where clause
@@ -2767,7 +2769,10 @@ bool Item_in_subselect::inject_in_to_exists_cond(JOIN *join_arg)
/* Attach back the list of multiple equalities to the new top-level AND. */
if (and_args && join_arg->cond_equal)
{
- /* The argument list of the top-level AND may change after fix fields. */
+ /*
+ The fix_fields() call above may have changed the argument list, so
+ fetch it again:
+ */
and_args= ((Item_cond*) join_arg->conds)->argument_list();
((Item_cond_and *) (join_arg->conds))->m_cond_equal=
*join_arg->cond_equal;