summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSinisa@sinisa.nasamreza.org <>2003-11-18 15:58:27 +0200
committerSinisa@sinisa.nasamreza.org <>2003-11-18 15:58:27 +0200
commitf6ca9afdbdbb4219b29a05bfc9c1e380414f251b (patch)
treec06078136053c7d0780b9b6ff0c82bc1f622a314 /sql
parent2846a16c57bff1cd22811656ad4a434f9342e5e8 (diff)
downloadmariadb-git-f6ca9afdbdbb4219b29a05bfc9c1e380414f251b.tar.gz
Fix for bug when zeros are to be prepended to decimal field
Diffstat (limited to 'sql')
-rw-r--r--sql/field.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 43481ca0963..58781624239 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -632,7 +632,7 @@ void Field_decimal::store(const char *from,uint len)
if (zerofill)
{
left_wall=to-1;
- while (pos != left_wall) // Fill with zeros
+ while (pos > left_wall) // Fill with zeros
*pos--='0';
}
else
@@ -640,7 +640,7 @@ void Field_decimal::store(const char *from,uint len)
left_wall=to+(sign_char != 0)-1;
if (!expo_sign_char) // If exponent was specified, ignore prezeros
{
- for (;pos != left_wall && pre_zeros_from !=pre_zeros_end;
+ for (;pos > left_wall && pre_zeros_from !=pre_zeros_end;
pre_zeros_from++)
*pos--= '0';
}