485
485
thd= current_thd;
486
if (!thd->is_context_analysis_only())
487
if (args[0]->real_item()->type() == FIELD_ITEM)
488
if (args[0]->real_item()->type() == FIELD_ITEM)
489
Item_field *field_item= (Item_field*) (args[0]->real_item());
490
if (field_item->field->can_be_compared_as_int64_t() &&
491
!(field_item->is_datetime() && args[1]->result_type() == STRING_RESULT))
490
Item_field *field_item= (Item_field*) (args[0]->real_item());
491
if (field_item->field->can_be_compared_as_int64_t() &&
492
!(field_item->is_datetime() &&
493
args[1]->result_type() == STRING_RESULT))
493
if (convert_constant_item(thd, field_item, &args[1]))
495
if (convert_constant_item(thd, field_item, &args[1]))
497
cmp.set_cmp_func(this, tmp_arg, tmp_arg+1,
498
INT_RESULT); // Works for all types.
499
args[0]->cmp_context= args[1]->cmp_context= INT_RESULT;
495
cmp.set_cmp_func(this, tmp_arg, tmp_arg+1,
496
INT_RESULT); // Works for all types.
497
args[0]->cmp_context= args[1]->cmp_context= INT_RESULT;
504
502
if (args[1]->real_item()->type() == FIELD_ITEM)
506
504
Item_field *field_item= (Item_field*) (args[1]->real_item());