~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/time/date_format.cc

Merge Nathan

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <drizzled/function/time/date_format.h>
23
23
#include <drizzled/session.h>
24
24
 
 
25
#include <algorithm>
 
26
 
 
27
using namespace std;
 
28
 
 
29
 
25
30
/**
26
31
  Create a formated date/time value in a string.
27
32
*/
264
269
  collation.set(cs, arg1->collation.derivation);
265
270
  if (arg1->type() == STRING_ITEM)
266
271
  {                                             // Optimize the normal case
267
 
    fixed_length=1;
 
272
    fixed_length= 1;
268
273
    max_length= format_length(&arg1->str_value) *
269
274
                collation.collation->mbmaxlen;
270
275
  }
271
276
  else
272
277
  {
273
 
    fixed_length=0;
274
 
    max_length=cmin(arg1->max_length,(uint32_t) MAX_BLOB_WIDTH) * 10 *
 
278
    fixed_length= 0;
 
279
    max_length= min(arg1->max_length,(uint32_t) MAX_BLOB_WIDTH) * 10 *
275
280
                   collation.collation->mbmaxlen;
276
281
    set_if_smaller(max_length,MAX_BLOB_WIDTH);
277
282
  }
278
 
  maybe_null=1;                                 // If wrong date
 
283
  maybe_null= 1;                                 // If wrong date
279
284
}
280
285
 
281
286
bool Item_func_date_format::eq(const Item *item, bool binary_cmp) const