summaryrefslogtreecommitdiff
path: root/strings/decimal.c
diff options
context:
space:
mode:
authorunknown <sanja@askmonty.org>2013-03-06 21:10:58 +0200
committerunknown <sanja@askmonty.org>2013-03-06 21:10:58 +0200
commit108a0a1823db2036000b309e7d6bd3216742c4de (patch)
tree2fee2f63610f270bf064e29152724cb8c697446f /strings/decimal.c
parent4ad2fd7cdf1b95b73081f9fe61eae590504e455e (diff)
downloadmariadb-git-108a0a1823db2036000b309e7d6bd3216742c4de.tar.gz
MDEV-4241 fix.
Field_enum incorrectly inherited decimals() from Field_string. Field_enum should be always integer in numeric context.
Diffstat (limited to 'strings/decimal.c')
-rw-r--r--strings/decimal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index e4925ff5f7c..3aced9b2572 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1465,7 +1465,9 @@ int decimal_bin_size(int precision, int scale)
intg0=intg/DIG_PER_DEC1, frac0=scale/DIG_PER_DEC1,
intg0x=intg-intg0*DIG_PER_DEC1, frac0x=scale-frac0*DIG_PER_DEC1;
- DBUG_ASSERT(scale >= 0 && precision > 0 && scale <= precision);
+ DBUG_ASSERT(scale >= 0);
+ DBUG_ASSERT(precision > 0);
+ DBUG_ASSERT(scale <= precision);
return intg0*sizeof(dec1)+dig2bytes[intg0x]+
frac0*sizeof(dec1)+dig2bytes[frac0x];
}