~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item_cmpfunc.cc

  • Committer: Brian Aker
  • Date: 2008-10-06 05:57:49 UTC
  • Revision ID: brian@tangent.org-20081006055749-svg700gciuqi0zu1
Remove all of uchar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
561
561
        which would be transformed to:
562
562
        WHERE col= 'j'
563
563
      */
564
 
      (*a)->walk(&Item::set_no_const_sub, false, (uchar*) 0);
565
 
      (*b)->walk(&Item::set_no_const_sub, false, (uchar*) 0);
 
564
      (*a)->walk(&Item::set_no_const_sub, false, (unsigned char*) 0);
 
565
      (*b)->walk(&Item::set_no_const_sub, false, (unsigned char*) 0);
566
566
    }
567
567
    break;
568
568
  }
1621
1621
    @retval NULL if an error occurred
1622
1622
*/
1623
1623
 
1624
 
Item *Item_in_optimizer::transform(Item_transformer transformer, uchar *argument)
 
1624
Item *Item_in_optimizer::transform(Item_transformer transformer, unsigned char *argument)
1625
1625
{
1626
1626
  Item *new_item;
1627
1627
 
2671
2671
    buff should match stack usage from
2672
2672
    Item_func_case::val_int() -> Item_func_case::find_item()
2673
2673
  */
2674
 
  uchar buff[MAX_FIELD_WIDTH*2+sizeof(String)*2+sizeof(String*)*2+sizeof(double)*2+sizeof(int64_t)*2];
 
2674
  unsigned char buff[MAX_FIELD_WIDTH*2+sizeof(String)*2+sizeof(String*)*2+sizeof(double)*2+sizeof(int64_t)*2];
2675
2675
  bool res= Item_func::fix_fields(thd, ref);
2676
2676
  /*
2677
2677
    Call check_stack_overrun after fix_fields to be sure that stack variable
3052
3052
 
3053
3053
int in_vector::find(Item *item)
3054
3054
{
3055
 
  uchar *result=get_value(item);
 
3055
  unsigned char *result=get_value(item);
3056
3056
  if (!result || !used_count)
3057
3057
    return 0;                           // Null value
3058
3058
 
3110
3110
}
3111
3111
 
3112
3112
 
3113
 
uchar *in_string::get_value(Item *item)
 
3113
unsigned char *in_string::get_value(Item *item)
3114
3114
{
3115
 
  return (uchar*) item->val_str(&tmp);
 
3115
  return (unsigned char*) item->val_str(&tmp);
3116
3116
}
3117
3117
 
3118
3118
in_row::in_row(uint elements, Item * item __attribute__((unused)))
3134
3134
    delete [] (cmp_item_row*) base;
3135
3135
}
3136
3136
 
3137
 
uchar *in_row::get_value(Item *item)
 
3137
unsigned char *in_row::get_value(Item *item)
3138
3138
{
3139
3139
  tmp.store_value(item);
3140
3140
  if (item->is_null())
3141
3141
    return 0;
3142
 
  return (uchar *)&tmp;
 
3142
  return (unsigned char *)&tmp;
3143
3143
}
3144
3144
 
3145
3145
void in_row::set(uint pos, Item *item)
3160
3160
  buff->unsigned_flag= item->unsigned_flag;
3161
3161
}
3162
3162
 
3163
 
uchar *in_int64_t::get_value(Item *item)
 
3163
unsigned char *in_int64_t::get_value(Item *item)
3164
3164
{
3165
3165
  tmp.val= item->val_int();
3166
3166
  if (item->null_value)
3167
3167
    return 0;
3168
3168
  tmp.unsigned_flag= item->unsigned_flag;
3169
 
  return (uchar*) &tmp;
 
3169
  return (unsigned char*) &tmp;
3170
3170
}
3171
3171
 
3172
3172
void in_datetime::set(uint pos,Item *item)
3179
3179
  buff->unsigned_flag= 1L;
3180
3180
}
3181
3181
 
3182
 
uchar *in_datetime::get_value(Item *item)
 
3182
unsigned char *in_datetime::get_value(Item *item)
3183
3183
{
3184
3184
  bool is_null;
3185
3185
  Item **tmp_item= lval_cache ? &lval_cache : &item;
3187
3187
  if (item->null_value)
3188
3188
    return 0;
3189
3189
  tmp.unsigned_flag= 1L;
3190
 
  return (uchar*) &tmp;
 
3190
  return (unsigned char*) &tmp;
3191
3191
}
3192
3192
 
3193
3193
in_double::in_double(uint elements)
3199
3199
  ((double*) base)[pos]= item->val_real();
3200
3200
}
3201
3201
 
3202
 
uchar *in_double::get_value(Item *item)
 
3202
unsigned char *in_double::get_value(Item *item)
3203
3203
{
3204
3204
  tmp= item->val_real();
3205
3205
  if (item->null_value)
3206
3206
    return 0;                                   /* purecov: inspected */
3207
 
  return (uchar*) &tmp;
 
3207
  return (unsigned char*) &tmp;
3208
3208
}
3209
3209
 
3210
3210
 
3226
3226
}
3227
3227
 
3228
3228
 
3229
 
uchar *in_decimal::get_value(Item *item)
 
3229
unsigned char *in_decimal::get_value(Item *item)
3230
3230
{
3231
3231
  my_decimal *result= item->val_decimal(&val);
3232
3232
  if (item->null_value)
3233
3233
    return 0;
3234
 
  return (uchar *)result;
 
3234
  return (unsigned char *)result;
3235
3235
}
3236
3236
 
3237
3237
 
3508
3508
static int srtcmp_in(const CHARSET_INFO * const cs, const String *x,const String *y)
3509
3509
{
3510
3510
  return cs->coll->strnncollsp(cs,
3511
 
                               (uchar *) x->ptr(),x->length(),
3512
 
                               (uchar *) y->ptr(),y->length(), 0);
 
3511
                               (unsigned char *) x->ptr(),x->length(),
 
3512
                               (unsigned char *) y->ptr(),y->length(), 0);
3513
3513
}
3514
3514
 
3515
3515
 
3876
3876
  List_iterator<Item> li(list);
3877
3877
  Item *item;
3878
3878
  void *orig_thd_marker= thd->thd_marker;
3879
 
  uchar buff[sizeof(char*)];                    // Max local vars in function
 
3879
  unsigned char buff[sizeof(char*)];                    // Max local vars in function
3880
3880
  not_null_tables_cache= used_tables_cache= 0;
3881
3881
  const_item_cache= 1;
3882
3882
 
3979
3979
}
3980
3980
 
3981
3981
 
3982
 
bool Item_cond::walk(Item_processor processor, bool walk_subquery, uchar *arg)
 
3982
bool Item_cond::walk(Item_processor processor, bool walk_subquery, unsigned char *arg)
3983
3983
{
3984
3984
  List_iterator_fast<Item> li(list);
3985
3985
  Item *item;
4008
4008
    Item returned as the result of transformation of the root node 
4009
4009
*/
4010
4010
 
4011
 
Item *Item_cond::transform(Item_transformer transformer, uchar *arg)
 
4011
Item *Item_cond::transform(Item_transformer transformer, unsigned char *arg)
4012
4012
{
4013
4013
  List_iterator<Item> li(list);
4014
4014
  Item *item;
4055
4055
    Item returned as the result of transformation of the root node 
4056
4056
*/
4057
4057
 
4058
 
Item *Item_cond::compile(Item_analyzer analyzer, uchar **arg_p,
4059
 
                         Item_transformer transformer, uchar *arg_t)
 
4058
Item *Item_cond::compile(Item_analyzer analyzer, unsigned char **arg_p,
 
4059
                         Item_transformer transformer, unsigned char *arg_t)
4060
4060
{
4061
4061
  if (!(this->*analyzer)(arg_p))
4062
4062
    return 0;
4069
4069
      The same parameter value of arg_p must be passed
4070
4070
      to analyze any argument of the condition formula.
4071
4071
    */   
4072
 
    uchar *arg_v= *arg_p;
 
4072
    unsigned char *arg_v= *arg_p;
4073
4073
    Item *new_item= item->compile(analyzer, &arg_v, transformer, arg_t);
4074
4074
    if (new_item && new_item != item)
4075
4075
      li.replace(new_item);
4429
4429
        const CHARSET_INFO * const cs= escape_str->charset();
4430
4430
        my_wc_t wc;
4431
4431
        int rc= cs->cset->mb_wc(cs, &wc,
4432
 
                                (const uchar*) escape_str->ptr(),
4433
 
                                (const uchar*) escape_str->ptr() +
 
4432
                                (const unsigned char*) escape_str->ptr(),
 
4433
                                (const unsigned char*) escape_str->ptr() +
4434
4434
                                               escape_str->length());
4435
4435
        escape= (int) (rc > 0 ? wc : '\\');
4436
4436
      }
4510
4510
}
4511
4511
 
4512
4512
#ifdef LIKE_CMP_TOUPPER
4513
 
#define likeconv(cs,A) (uchar) (cs)->toupper(A)
 
4513
#define likeconv(cs,A) (unsigned char) (cs)->toupper(A)
4514
4514
#else
4515
 
#define likeconv(cs,A) (uchar) (cs)->sort_order[(uchar) (A)]
 
4515
#define likeconv(cs,A) (unsigned char) (cs)->sort_order[(unsigned char) (A)]
4516
4516
#endif
4517
4517
 
4518
4518
 
4634
4634
  if (!cs->sort_order)
4635
4635
  {
4636
4636
    for (j = 0; j < plm1; j++)
4637
 
      bmBc[(uint) (uchar) pattern[j]] = plm1 - j;
 
4637
      bmBc[(uint) (unsigned char) pattern[j]] = plm1 - j;
4638
4638
  }
4639
4639
  else
4640
4640
  {
4680
4680
 
4681
4681
      register const int v = plm1 - i;
4682
4682
      turboShift = u - v;
4683
 
      bcShift    = bmBc[(uint) (uchar) text[i + j]] - plm1 + i;
 
4683
      bcShift    = bmBc[(uint) (unsigned char) text[i + j]] - plm1 + i;
4684
4684
      shift      = (turboShift > bcShift) ? turboShift : bcShift;
4685
4685
      shift      = (shift > bmGs[i]) ? shift : bmGs[i];
4686
4686
      if (shift == bmGs[i])
5156
5156
                                      item->collation.collation);
5157
5157
}
5158
5158
 
5159
 
bool Item_equal::walk(Item_processor processor, bool walk_subquery, uchar *arg)
 
5159
bool Item_equal::walk(Item_processor processor, bool walk_subquery, unsigned char *arg)
5160
5160
{
5161
5161
  List_iterator_fast<Item_field> it(fields);
5162
5162
  Item *item;
5168
5168
  return Item_func::walk(processor, walk_subquery, arg);
5169
5169
}
5170
5170
 
5171
 
Item *Item_equal::transform(Item_transformer transformer, uchar *arg)
 
5171
Item *Item_equal::transform(Item_transformer transformer, unsigned char *arg)
5172
5172
{
5173
5173
  List_iterator<Item_field> it(fields);
5174
5174
  Item *item;