diff options
author | peter@mysql.com <> | 2002-07-30 19:52:51 +0400 |
---|---|---|
committer | peter@mysql.com <> | 2002-07-30 19:52:51 +0400 |
commit | a1443a7e2c3c8c759c7adde6bd4a4d75598d3aeb (patch) | |
tree | fe72501ec09057af7c752b1d1c1c9d29ff06abc0 /sql/field.cc | |
parent | 28142456bfda00383e78ba4bacb5769e85c1fde6 (diff) | |
download | mariadb-git-a1443a7e2c3c8c759c7adde6bd4a4d75598d3aeb.tar.gz |
Allow storing "+456" then decimal declared unsigned
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 11 |
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 } } |