~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

Viewing changes to strings/decimal.c

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-02-14 23:59:22 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120214235922-cux5uek1e5l0hje9
Tags: 5.5.20-0ubuntu1
* New upstream release.
* d/mysql-server-5.5.mysql.upstart: Fix stop on to make sure mysql is
  fully stopped before shutdown commences. (LP: #688541) Also simplify
  start on as it is redundant.
* d/control: Depend on upstart version which has apparmor profile load
  script to prevent failure on upgrade from lucid to precise.
  (LP: #907465)
* d/apparmor-profile: need to allow /run since that is the true path
  of /var/run files. (LP: #917542)
* d/control: mysql-server-5.5 has files in it that used to be owned
  by libmysqlclient-dev, so it must break/replace it. (LP: #912487)
* d/rules, d/control: 5.5.20 Fixes segfault on tests with gcc 4.6,
  change compiler back to system default.
* d/rules: Turn off embedded libedit/readline.(Closes: #659566)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1474
1474
{
1475
1475
  int frac0=scale>0 ? ROUND_UP(scale) : scale/DIG_PER_DEC1,
1476
1476
    frac1=ROUND_UP(from->frac), UNINIT_VAR(round_digit),
1477
 
      intg0=ROUND_UP(from->intg), error=E_DEC_OK, len=to->len,
1478
 
      intg1=ROUND_UP(from->intg +
1479
 
                     (((intg0 + frac0)>0) && (from->buf[0] == DIG_MAX)));
 
1477
    intg0=ROUND_UP(from->intg), error=E_DEC_OK, len=to->len;
 
1478
 
1480
1479
  dec1 *buf0=from->buf, *buf1=to->buf, x, y, carry=0;
1481
1480
  int first_dig;
1482
1481
 
1491
1490
  default: DBUG_ASSERT(0);
1492
1491
  }
1493
1492
 
 
1493
  /*
 
1494
    For my_decimal we always use len == DECIMAL_BUFF_LENGTH == 9
 
1495
    For internal testing here (ifdef MAIN) we always use len == 100/4
 
1496
   */
 
1497
  DBUG_ASSERT(from->len == to->len);
 
1498
 
1494
1499
  if (unlikely(frac0+intg0 > len))
1495
1500
  {
1496
1501
    frac0=len-intg0;
1504
1509
    return E_DEC_OK;
1505
1510
  }
1506
1511
 
1507
 
  if (to != from || intg1>intg0)
 
1512
  if (to != from)
1508
1513
  {
1509
1514
    dec1 *p0= buf0+intg0+max(frac1, frac0);
1510
 
    dec1 *p1= buf1+intg1+max(frac1, frac0);
 
1515
    dec1 *p1= buf1+intg0+max(frac1, frac0);
 
1516
 
 
1517
    DBUG_ASSERT(p0 - buf0 <= len);
 
1518
    DBUG_ASSERT(p1 - buf1 <= len);
1511
1519
 
1512
1520
    while (buf0 < p0)
1513
1521
      *(--p1) = *(--p0);
1514
 
    if (unlikely(intg1 > intg0))
1515
 
      to->buf[0]= 0;
1516
1522
 
1517
 
    intg0= intg1;
1518
1523
    buf0=to->buf;
1519
1524
    buf1=to->buf;
1520
1525
    to->sign=from->sign;