~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item_buff.cc

  • Committer: Brian Aker
  • Date: 2008-09-04 19:31:00 UTC
  • Revision ID: brian@tangent.org-20080904193100-l849hgghfy4urj43
Changing default character set from this point on.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
  Create right type of Cached_item for an item.
28
28
*/
29
29
 
30
 
Cached_item *new_Cached_item(Session *session, Item *item, bool use_result_field)
 
30
Cached_item *new_Cached_item(THD *thd, Item *item, bool use_result_field)
31
31
{
32
32
  if (item->real_item()->type() == Item::FIELD_ITEM &&
33
33
      !(((Item_field *) (item->real_item()))->field->flags & BLOB_FLAG))
39
39
  }
40
40
  switch (item->result_type()) {
41
41
  case STRING_RESULT:
42
 
    return new Cached_item_str(session, (Item_field *) item);
 
42
    return new Cached_item_str(thd, (Item_field *) item);
43
43
  case INT_RESULT:
44
44
    return new Cached_item_int((Item_field *) item);
45
45
  case REAL_RESULT:
62
62
    Return true if values have changed
63
63
*/
64
64
 
65
 
Cached_item_str::Cached_item_str(Session *session, Item *arg)
66
 
  :item(arg), value(cmin(arg->max_length, (uint32_t)session->variables.max_sort_length))
 
65
Cached_item_str::Cached_item_str(THD *thd, Item *arg)
 
66
  :item(arg), value(min(arg->max_length, (uint32_t)thd->variables.max_sort_length))
67
67
{}
68
68
 
69
69
bool Cached_item_str::cmp(void)
72
72
  bool tmp;
73
73
 
74
74
  if ((res=item->val_str(&tmp_value)))
75
 
    res->length(cmin(res->length(), value.alloced_length()));
 
75
    res->length(min(res->length(), value.alloced_length()));
76
76
 
77
77
  if (null_value != item->null_value)
78
78
  {