@@ -2653,10 +2653,12 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref)
2653
2653
{
2654
2654
uint outer_cols_num;
2655
2655
List<Item> *inner_cols;
2656
+ char const *save_where= thd->where ;
2656
2657
2657
2658
if (test_strategy (SUBS_SEMI_JOIN))
2658
2659
return !( (*ref)= new Item_int (1 ));
2659
2660
2661
+ thd->where = " IN/ALL/ANY subquery" ;
2660
2662
/*
2661
2663
Check if the outer and inner IN operands match in those cases when we
2662
2664
will not perform IN=>EXISTS transformation. Currently this is when we
@@ -2687,7 +2689,7 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref)
2687
2689
if (outer_cols_num != inner_cols->elements )
2688
2690
{
2689
2691
my_error (ER_OPERAND_COLUMNS, MYF (0 ), outer_cols_num);
2690
- return TRUE ;
2692
+ goto err ;
2691
2693
}
2692
2694
if (outer_cols_num > 1 )
2693
2695
{
@@ -2697,20 +2699,24 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref)
2697
2699
{
2698
2700
inner_col= inner_col_it++;
2699
2701
if (inner_col->check_cols (left_expr->element_index (i)->cols ()))
2700
- return TRUE ;
2702
+ goto err ;
2701
2703
}
2702
2704
}
2703
2705
}
2704
2706
2705
- if (thd_arg->lex ->is_view_context_analysis () &&
2706
- left_expr && !left_expr->fixed &&
2707
+ if (left_expr && !left_expr->fixed &&
2707
2708
left_expr->fix_fields (thd_arg, &left_expr))
2708
- return TRUE ;
2709
+ goto err ;
2709
2710
else
2710
- if (Item_subselect::fix_fields (thd_arg, ref))
2711
- return TRUE ;
2711
+ if (Item_subselect::fix_fields (thd_arg, ref))
2712
+ goto err ;
2712
2713
fixed= TRUE ;
2714
+ thd->where = save_where;
2713
2715
return FALSE ;
2716
+
2717
+ err:
2718
+ thd->where = save_where;
2719
+ return TRUE ;
2714
2720
}
2715
2721
2716
2722
0 commit comments