~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/cmpfunc.cc

  • Committer: Brian Aker
  • Date: 2009-02-21 00:18:15 UTC
  • Revision ID: brian@tangent.org-20090221001815-x20e8h71e984lvs1
Completion (?) of uint conversion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
228
228
         items[i]->result_type() == ROW_RESULT) &&
229
229
        cmp_row_type(items[0], items[i]))
230
230
      return 0;
231
 
    found_types|= 1<< (uint)item_cmp_type(left_result,
 
231
    found_types|= 1<< (uint32_t)item_cmp_type(left_result,
232
232
                                           items[i]->result_type());
233
233
  }
234
234
  return found_types;
2655
2655
    {
2656
2656
      cmp_type= item_cmp_type(left_result_type, args[i]->result_type());
2657
2657
      assert(cmp_type != ROW_RESULT);
2658
 
      assert(cmp_items[(uint)cmp_type]);
2659
 
      if (!(value_added_map & (1<<(uint)cmp_type)))
 
2658
      assert(cmp_items[(uint32_t)cmp_type]);
 
2659
      if (!(value_added_map & (1<<(uint32_t)cmp_type)))
2660
2660
      {
2661
 
        cmp_items[(uint)cmp_type]->store_value(args[first_expr_num]);
 
2661
        cmp_items[(uint32_t)cmp_type]->store_value(args[first_expr_num]);
2662
2662
        if ((null_value=args[first_expr_num]->null_value))
2663
2663
          return else_expr_num != -1 ? args[else_expr_num] : 0;
2664
 
        value_added_map|= 1<<(uint)cmp_type;
 
2664
        value_added_map|= 1<<(uint32_t)cmp_type;
2665
2665
      }
2666
 
      if (!cmp_items[(uint)cmp_type]->cmp(args[i]) && !args[i]->null_value)
 
2666
      if (!cmp_items[(uint32_t)cmp_type]->cmp(args[i]) && !args[i]->null_value)
2667
2667
        return args[i + 1];
2668
2668
    }
2669
2669
  }
2825
2825
    if (!(found_types= collect_cmp_types(agg, nagg)))
2826
2826
      return;
2827
2827
 
2828
 
    for (i= 0; i <= (uint)DECIMAL_RESULT; i++)
 
2828
    for (i= 0; i <= (uint32_t)DECIMAL_RESULT; i++)
2829
2829
    {
2830
2830
      if (found_types & (1 << i) && !cmp_items[i])
2831
2831
      {
2913
2913
{
2914
2914
  uint32_t i;
2915
2915
  Item_func::cleanup();
2916
 
  for (i= 0; i <= (uint)DECIMAL_RESULT; i++)
 
2916
  for (i= 0; i <= (uint32_t)DECIMAL_RESULT; i++)
2917
2917
  {
2918
2918
    delete cmp_items[i];
2919
2919
    cmp_items[i]= 0;
3619
3619
      break;
3620
3620
    }
3621
3621
  }
3622
 
  for (i= 0; i <= (uint)DECIMAL_RESULT; i++)
 
3622
  for (i= 0; i <= (uint32_t)DECIMAL_RESULT; i++)
3623
3623
  {
3624
3624
    if (found_types & 1 << i)
3625
3625
    {
3801
3801
      cmp_items[STRING_RESULT]= new cmp_item_datetime(date_arg);
3802
3802
    else
3803
3803
    {
3804
 
      for (i= 0; i <= (uint) DECIMAL_RESULT; i++)
 
3804
      for (i= 0; i <= (uint32_t) DECIMAL_RESULT; i++)
3805
3805
      {
3806
3806
        if (found_types & (1 << i) && !cmp_items[i])
3807
3807
        {
3873
3873
  for (uint32_t i= 1 ; i < arg_count ; i++)
3874
3874
  {
3875
3875
    Item_result cmp_type= item_cmp_type(left_result_type, args[i]->result_type());
3876
 
    in_item= cmp_items[(uint)cmp_type];
 
3876
    in_item= cmp_items[(uint32_t)cmp_type];
3877
3877
    assert(in_item);
3878
 
    if (!(value_added_map & (1 << (uint)cmp_type)))
 
3878
    if (!(value_added_map & (1 << (uint32_t)cmp_type)))
3879
3879
    {
3880
3880
      in_item->store_value(args[0]);
3881
3881
      if ((null_value=args[0]->null_value))
3882
3882
        return 0;
3883
3883
      have_null= 0;
3884
 
      value_added_map|= 1 << (uint)cmp_type;
 
3884
      value_added_map|= 1 << (uint32_t)cmp_type;
3885
3885
    }
3886
3886
    if (!in_item->cmp(args[i]) && !args[i]->null_value)
3887
3887
      return (int64_t) (!negated);
4717
4717
  if (!cs->sort_order)
4718
4718
  {
4719
4719
    for (j = 0; j < plm1; j++)
4720
 
      bmBc[(uint) (unsigned char) pattern[j]] = plm1 - j;
 
4720
      bmBc[(uint32_t) (unsigned char) pattern[j]] = plm1 - j;
4721
4721
  }
4722
4722
  else
4723
4723
  {
4724
4724
    for (j = 0; j < plm1; j++)
4725
 
      bmBc[(uint) likeconv(cs,pattern[j])] = plm1 - j;
 
4725
      bmBc[(uint32_t) likeconv(cs,pattern[j])] = plm1 - j;
4726
4726
  }
4727
4727
}
4728
4728
 
4763
4763
 
4764
4764
      register const int v = plm1 - i;
4765
4765
      turboShift = u - v;
4766
 
      bcShift    = bmBc[(uint) (unsigned char) text[i + j]] - plm1 + i;
 
4766
      bcShift    = bmBc[(uint32_t) (unsigned char) text[i + j]] - plm1 + i;
4767
4767
      shift      = (turboShift > bcShift) ? turboShift : bcShift;
4768
4768
      shift      = (shift > bmGs[i]) ? shift : bmGs[i];
4769
4769
      if (shift == bmGs[i])
4794
4794
 
4795
4795
      register const int v = plm1 - i;
4796
4796
      turboShift = u - v;
4797
 
      bcShift    = bmBc[(uint) likeconv(cs, text[i + j])] - plm1 + i;
 
4797
      bcShift    = bmBc[(uint32_t) likeconv(cs, text[i + j])] - plm1 + i;
4798
4798
      shift      = (turboShift > bcShift) ? turboShift : bcShift;
4799
4799
      shift      = cmax(shift, bmGs[i]);
4800
4800
      if (shift == bmGs[i])