summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-10-12 13:27:49 -0700
committerunknown <jimw@mysql.com>2005-10-12 13:27:49 -0700
commit86038b4fcebccc415f6ed94b03ad0f4bfebc7b98 (patch)
tree4c6a5ef7eb7fcaf505f80279ef9adef99af675e1 /sql/item.h
parent7131a6563b39d42c53dbdc33cfe098f0ff3631e5 (diff)
parenta094d013d6281c9beb0c143097229d9ed9209c61 (diff)
downloadmariadb-git-86038b4fcebccc415f6ed94b03ad0f4bfebc7b98.tar.gz
Merge mysql.com:/home/jimw/my/mysql-4.1-13344
into mysql.com:/home/jimw/my/mysql-4.1-clean mysql-test/r/cast.result: Auto merged mysql-test/t/cast.test: Auto merged sql/item.h: Auto merged
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h
index b1aed733101..1d01ce0d3f3 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -703,6 +703,14 @@ public:
longlong val_int()
{
DBUG_ASSERT(fixed == 1);
+ if (value <= (double) LONGLONG_MIN)
+ {
+ return LONGLONG_MIN;
+ }
+ else if (value >= (double) (ulonglong) LONGLONG_MAX)
+ {
+ return LONGLONG_MAX;
+ }
return (longlong) (value+(value > 0 ? 0.5 : -0.5));
}
String *val_str(String*);