summaryrefslogtreecommitdiff
path: root/sql/my_decimal.h
diff options
context:
space:
mode:
authorunknown <holyfoot/hf@hfmain.(none)>2007-05-20 21:56:56 +0500
committerunknown <holyfoot/hf@hfmain.(none)>2007-05-20 21:56:56 +0500
commit2626eabc717e2fd34f95ab3b492df5b292e03c33 (patch)
treefb53b8205096a76b4d081e7181457dd8be5d4afc /sql/my_decimal.h
parent5d2075938a989d76a9662d9276cd83a7397023d5 (diff)
parent59a7e066e3a86bb4371ce5027b4ad6b79ac91ce2 (diff)
downloadmariadb-git-2626eabc717e2fd34f95ab3b492df5b292e03c33.tar.gz
Merge mysql.com:/home/hf/work/28361/my50-28361
into mysql.com:/home/hf/work/28361/my51-28361 mysql-test/t/type_newdecimal.test: Auto merged sql/my_decimal.h: Auto merged mysql-test/r/type_newdecimal.result: merging
Diffstat (limited to 'sql/my_decimal.h')
-rw-r--r--sql/my_decimal.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/my_decimal.h b/sql/my_decimal.h
index 17eb75cfdc5..d2e9006c1eb 100644
--- a/sql/my_decimal.h
+++ b/sql/my_decimal.h
@@ -36,13 +36,17 @@ C_MODE_END
/* maximum length of buffer in our big digits (uint32) */
#define DECIMAL_BUFF_LENGTH 9
+
+/* the number of digits that my_decimal can possibly contain */
+#define DECIMAL_MAX_POSSIBLE_PRECISION (DECIMAL_BUFF_LENGTH * 9)
+
/*
maximum guaranteed precision of number in decimal digits (number of our
digits * number of decimal digits in one our big digit - number of decimal
- digits in one our big digit decreased on 1 (because we always put decimal
+ digits in one our big digit decreased by 1 (because we always put decimal
point on the border of our big digits))
*/
-#define DECIMAL_MAX_PRECISION ((DECIMAL_BUFF_LENGTH * 9) - 8*2)
+#define DECIMAL_MAX_PRECISION (DECIMAL_MAX_POSSIBLE_PRECISION - 8*2)
#define DECIMAL_MAX_SCALE 30
#define DECIMAL_NOT_SPECIFIED 31
@@ -50,7 +54,7 @@ C_MODE_END
maximum length of string representation (number of maximum decimal
digits + 1 position for sign + 1 position for decimal point)
*/
-#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_PRECISION + 2)
+#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_POSSIBLE_PRECISION + 2)
/*
maximum size of packet length
*/