~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.cc

  • Committer: Brian Aker
  • Date: 2011-02-11 21:34:53 UTC
  • mto: This revision was merged to the branch mainline in revision 2161.
  • Revision ID: brian@tangent.org-20110211213453-p3z1qv0lszudtl1f
This fixes 716459

Show diffs side-by-side

added added

removed removed

Lines of Context:
1447
1447
  return result;
1448
1448
}
1449
1449
 
 
1450
uint32_t Item::max_char_length() const
 
1451
{
 
1452
  return max_length / collation.collation->mbmaxlen;
 
1453
}
 
1454
 
 
1455
void Item::fix_length_and_charset(uint32_t max_char_length_arg, CHARSET_INFO *cs)
 
1456
 
1457
  max_length= char_to_byte_length_safe(max_char_length_arg, cs->mbmaxlen);
 
1458
  collation.collation= cs;
 
1459
}
 
1460
 
 
1461
void Item::fix_char_length(uint32_t max_char_length_arg)
 
1462
 
1463
  max_length= char_to_byte_length_safe(max_char_length_arg, collation.collation->mbmaxlen);
 
1464
}
 
1465
 
 
1466
void Item::fix_char_length_uint64_t(uint64_t max_char_length_arg)
 
1467
 
1468
  uint64_t max_result_length= max_char_length_arg *
 
1469
    collation.collation->mbmaxlen;
 
1470
 
 
1471
  if (max_result_length >= MAX_BLOB_WIDTH)
 
1472
  { 
 
1473
    max_length= MAX_BLOB_WIDTH;
 
1474
    maybe_null= false;
 
1475
  }
 
1476
  else
 
1477
  {
 
1478
    max_length= max_result_length;
 
1479
  }
 
1480
}
 
1481
 
 
1482
void Item::fix_length_and_charset_datetime(uint32_t max_char_length_arg)
 
1483
 
1484
  collation.set(&my_charset_bin);
 
1485
  fix_char_length(max_char_length_arg);
 
1486
}
 
1487
 
1450
1488
Item_result item_cmp_type(Item_result a,Item_result b)
1451
1489
{
1452
1490
  if (a == STRING_RESULT && b == STRING_RESULT)