summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorbar@mysql.com <>2006-03-28 17:07:26 +0500
committerbar@mysql.com <>2006-03-28 17:07:26 +0500
commit29b8e0973209be5077dc3cbce66e7b2d43d98033 (patch)
treecb6386e1dc7095e7231e33e66f1b6cfb993dd3ea /sql/field.cc
parent37a6167d6db4eb216649741f7a522bb21c95867e (diff)
parent3e284e22a16d872b02a390e4f44d40cf535558b5 (diff)
downloadmariadb-git-29b8e0973209be5077dc3cbce66e7b2d43d98033.tar.gz
Merge mysql.com:/usr/home/bar/mysql-4.1.b15098
into mysql.com:/usr/home/bar/mysql-5.0 Bug#15098
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/field.cc b/sql/field.cc
index eab62cd1958..6cd5147648f 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -4240,6 +4240,11 @@ longlong Field_double::val_int(void)
else
#endif
doubleget(j,ptr);
+ /* Check whether we fit into longlong range */
+ if (j <= (double) LONGLONG_MIN)
+ return (longlong) LONGLONG_MIN;
+ if (j >= (double) (ulonglong) LONGLONG_MAX)
+ return (longlong) LONGLONG_MAX;
return (longlong) rint(j);
}