diff options
author | unknown <serg@serg.mylan> | 2004-11-01 11:28:36 +0100 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2004-11-01 11:28:36 +0100 |
commit | b715986b732436569c42d7e08316a718247eedd6 (patch) | |
tree | 9f499cd9b08ffe33ff1cc52617b0a1e2d703ea85 /strings | |
parent | a2e7a90bbb64cba7b92ea71c7d3691e52c222d36 (diff) | |
download | mariadb-git-b715986b732436569c42d7e08316a718247eedd6.tar.gz |
stript end zeros before comparison
Diffstat (limited to 'strings')
-rw-r--r-- | strings/decimal.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/strings/decimal.c b/strings/decimal.c index 5fa24a4c8a6..a6c53f3a130 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -1060,6 +1060,10 @@ static int do_sub(decimal *from1, decimal *from2, decimal *to) carry=1; else if (intg2 == intg1) { + while (unlikely(stop1[frac1-1] == 0)) + frac1--; + while (unlikely(stop2[frac2-1] == 0)) + frac2--; while (buf1 < stop1+frac1 && buf2 < stop2+frac2 && *buf1 == *buf2) buf1++, buf2++; if (buf1 < stop1+frac1) |