summaryrefslogtreecommitdiff
path: root/strings/decimal.c
diff options
context:
space:
mode:
authorunknown <gshchepa/uchum@gleb.loc>2007-10-15 13:34:58 +0500
committerunknown <gshchepa/uchum@gleb.loc>2007-10-15 13:34:58 +0500
commitfae5f5321e42fc0dbdab091aa59c636460c15be6 (patch)
tree4e31a2dabe83e528ffb8dc9a640d6e054a02f83d /strings/decimal.c
parente2fa4b6ed44ed1870a2bcbbb94771f21bf0cf692 (diff)
parent91dc1bb9059d47bd770b5392265d3b1c0c2bc3f6 (diff)
downloadmariadb-git-fae5f5321e42fc0dbdab091aa59c636460c15be6.tar.gz
Merge gleb.loc:/home/uchum/work/bk/PA/5.0-opt-31019
into gleb.loc:/home/uchum/work/bk/5.0-opt
Diffstat (limited to 'strings/decimal.c')
-rw-r--r--strings/decimal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index f1f02f3a071..cbea0e340c6 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -2323,11 +2323,12 @@ static int do_div_mod(decimal_t *from1, decimal_t *from2,
}
if (unlikely(intg0+frac0 > to->len))
{
- stop1-=to->len-frac0-intg0;
+ stop1-=frac0+intg0-to->len;
frac0=to->len-intg0;
to->frac=frac0*DIG_PER_DEC1;
error=E_DEC_TRUNCATED;
}
+ DBUG_ASSERT(buf0 + (stop1 - start1) <= to->buf + to->len);
while (start1 < stop1)
*buf0++=*start1++;
}