summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorpeter@mysql.com <>2002-07-30 19:52:51 +0400
committerpeter@mysql.com <>2002-07-30 19:52:51 +0400
commita1443a7e2c3c8c759c7adde6bd4a4d75598d3aeb (patch)
treefe72501ec09057af7c752b1d1c1c9d29ff06abc0 /sql/field.cc
parent28142456bfda00383e78ba4bacb5769e85c1fde6 (diff)
downloadmariadb-git-a1443a7e2c3c8c759c7adde6bd4a4d75598d3aeb.tar.gz
Allow storing "+456" then decimal declared unsigned
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/field.cc b/sql/field.cc
index eb3dc7948d4..42ddcc3b9d2 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -431,8 +431,9 @@ void Field_decimal::store(const char *from,uint len)
{
sign_char= *from++;
/*
- Unsigned can't have any flag. So we'll just drop "+"
- and will overflow on "-"
+ We allow "+" for unsigned decimal unless defined different
+ Both options allowed as one may wish not to have "+" for unsigned numbers
+ because of data processing issues
*/
if (unsigned_flag)
{
@@ -441,8 +442,14 @@ void Field_decimal::store(const char *from,uint len)
Field_decimal::overflow(1);
return;
}
+ /*
+ Defining this will not store "+" for unsigned decimal type even if
+ it is passed in numeric string. This will make some tests to fail
+ */
+#ifdef DONT_ALLOW_UNSIGNED_PLUS
else
sign_char=0;
+#endif
}
}