@@ -2653,10 +2653,12 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref)
26532653{
26542654 uint outer_cols_num;
26552655 List<Item> *inner_cols;
2656+ char const *save_where= thd->where ;
26562657
26572658 if (test_strategy (SUBS_SEMI_JOIN))
26582659 return !( (*ref)= new Item_int (1 ));
26592660
2661+ thd->where = " IN/ALL/ANY subquery" ;
26602662 /*
26612663 Check if the outer and inner IN operands match in those cases when we
26622664 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)
26872689 if (outer_cols_num != inner_cols->elements )
26882690 {
26892691 my_error (ER_OPERAND_COLUMNS, MYF (0 ), outer_cols_num);
2690- return TRUE ;
2692+ goto err ;
26912693 }
26922694 if (outer_cols_num > 1 )
26932695 {
@@ -2697,20 +2699,24 @@ bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref)
26972699 {
26982700 inner_col= inner_col_it++;
26992701 if (inner_col->check_cols (left_expr->element_index (i)->cols ()))
2700- return TRUE ;
2702+ goto err ;
27012703 }
27022704 }
27032705 }
27042706
2705- if (thd_arg->lex ->is_view_context_analysis () &&
2706- left_expr && !left_expr->fixed &&
2707+ if (left_expr && !left_expr->fixed &&
27072708 left_expr->fix_fields (thd_arg, &left_expr))
2708- return TRUE ;
2709+ goto err ;
27092710 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 ;
27122713 fixed= TRUE ;
2714+ thd->where = save_where;
27132715 return FALSE ;
2716+
2717+ err:
2718+ thd->where = save_where;
2719+ return TRUE ;
27142720}
27152721
27162722
0 commit comments