~drizzle-pbxt/drizzle/drizzle-pbxt-2

« back to all changes in this revision

Viewing changes to drizzled/cached_item.cc

  • Committer: Paul McCullagh
  • Date: 2009-11-10 14:18:39 UTC
  • mfrom: (1038.1.7 drizzle-pbxt-pre-merge)
  • Revision ID: paul.mccullagh@primebase.org-20091110141839-2j3k43b17ag6f605
Merged Drizzle trunk and PBXT 1.0.09

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include <drizzled/cached_item.h>
29
29
#include <drizzled/sql_string.h>
30
30
#include <drizzled/session.h>
 
31
#include <algorithm>
 
32
 
 
33
using namespace std;
31
34
 
32
35
/**
33
36
  Create right type of Cached_item for an item.
70
73
*/
71
74
 
72
75
Cached_item_str::Cached_item_str(Session *session, Item *arg)
73
 
  :item(arg), value(cmin(arg->max_length,
74
 
                         (uint32_t)session->variables.max_sort_length))
 
76
  :item(arg), value(min(arg->max_length,
 
77
                        (uint32_t)session->variables.max_sort_length))
75
78
{}
76
79
 
77
80
bool Cached_item_str::cmp(void)
80
83
  bool tmp;
81
84
 
82
85
  if ((res=item->val_str(&tmp_value)))
83
 
    res->length(cmin(res->length(), value.alloced_length()));
 
86
    res->length(min(res->length(), value.alloced_length()));
84
87
 
85
88
  if (null_value != item->null_value)
86
89
  {