summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <holyfoot/hf@mysql.com/deer.(none)>2006-10-30 09:52:50 +0400
committerunknown <holyfoot/hf@mysql.com/deer.(none)>2006-10-30 09:52:50 +0400
commitf00e6bd75d24e311016cd72449ed678c0172f6e6 (patch)
tree86315d20c86fe768ca64b21051234bd0285454d0 /strings
parentab133655360a284567b74be79765031493823479 (diff)
downloadmariadb-git-f00e6bd75d24e311016cd72449ed678c0172f6e6.tar.gz
Bug #8663 (cant use bigint as input to CAST)
decimal->ulong conversion fixed to assign max possible ULONG if decimal is bigger Item_func_unsigned now handles DECIMAL parameter separately as we can't rely on decimal::val_int result here. mysql-test/r/type_newdecimal.result: result fixed mysql-test/t/type_newdecimal.test: testcase sql/item_func.cc: DECIMAL_RESULT should be handled separately here as it's always signed. strings/decimal.c: here we assign max possible ULONG if the decimal value is bigger
Diffstat (limited to 'strings')
-rw-r--r--strings/decimal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index 5a0bc0968b6..e0b06685521 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1036,7 +1036,7 @@ int decimal2ulonglong(decimal_t *from, ulonglong *to)
x=x*DIG_BASE + *buf++;
if (unlikely(y > ((ulonglong) ULONGLONG_MAX/DIG_BASE) || x < y))
{
- *to=y;
+ *to=ULONGLONG_MAX;
return E_DEC_OVERFLOW;
}
}