~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/cmpfunc.cc

Phase 1 - temporal changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
941
941
    get_value_func= &get_datetime_value;
942
942
    return 0;
943
943
  }
944
 
  else if (type == STRING_RESULT && (*a)->field_type() == DRIZZLE_TYPE_TIME &&
945
 
           (*b)->field_type() == DRIZZLE_TYPE_TIME)
946
 
  {
947
 
    /* Compare TIME values as integers. */
948
 
    session= current_session;
949
 
    owner= owner_arg;
950
 
    a_cache= 0;
951
 
    b_cache= 0;
952
 
    is_nulls_eq= test(owner && owner->functype() == Item_func::EQUAL_FUNC);
953
 
    func= &Arg_comparator::compare_datetime;
954
 
    get_value_func= &get_time_value;
955
 
    return 0;
956
 
  }
957
944
 
958
945
  return set_compare_func(owner_arg, type);
959
946
}
2053
2040
  max_length= 1;
2054
2041
  int i;
2055
2042
  bool datetime_found= false;
2056
 
  int time_items_found= 0;
2057
2043
  compare_as_dates= true;
2058
2044
  Session *session= current_session;
2059
2045
 
2083
2069
        datetime_found= true;
2084
2070
        continue;
2085
2071
      }
2086
 
      if (args[i]->field_type() == DRIZZLE_TYPE_TIME &&
2087
 
          args[i]->result_as_int64_t())
2088
 
        time_items_found++;
2089
2072
    }
2090
2073
  }
2091
2074
  if (!datetime_found)
2096
2079
    ge_cmp.set_datetime_cmp_func(args, args + 1);
2097
2080
    le_cmp.set_datetime_cmp_func(args, args + 2);
2098
2081
  }
2099
 
  else if (time_items_found == 3)
2100
 
  {
2101
 
    /* Compare TIME items as integers. */
2102
 
    cmp_type= INT_RESULT;
2103
 
  }
2104
2082
  else if (args[0]->real_item()->type() == FIELD_ITEM &&
2105
2083
           session->lex->sql_command != SQLCOM_SHOW_CREATE)
2106
2084
  {