~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/item_cmpfunc.cc

  • Committer: Brian Aker
  • Date: 2008-07-18 18:55:10 UTC
  • mfrom: (177.1.5 drizzle)
  • Revision ID: brian@tangent.org-20080718185510-o5nnn7g5ub81llqr
Head merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
483
483
  }
484
484
 
485
485
  thd= current_thd;
486
 
  if (!thd->is_context_analysis_only())
 
486
 
 
487
  if (args[0]->real_item()->type() == FIELD_ITEM)
487
488
  {
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))
489
492
    {
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]))
494
494
      {
495
 
        if (convert_constant_item(thd, field_item, &args[1]))
496
 
        {
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;
500
 
          return;
501
 
        }
 
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;
 
498
        return;
502
499
      }
503
500
    }
 
501
 
504
502
    if (args[1]->real_item()->type() == FIELD_ITEM)
505
503
    {
506
504
      Item_field *field_item= (Item_field*) (args[1]->real_item());