summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-01-30 15:32:48 +0200
committerunknown <monty@hundin.mysql.fi>2002-01-30 15:32:48 +0200
commit22ab243303fc3b6f66e1951e0d9e3dd06754927d (patch)
tree0e248240e34cdf714bf85ad1ab61836e1725d64a /sql/item_func.cc
parent5b968bb8ee49008e8adfba898472b20b0cf0524f (diff)
downloadmariadb-git-22ab243303fc3b6f66e1951e0d9e3dd06754927d.tar.gz
Added --sql-mode=NO_UNSIGNED_SUBTRACTION
Docs/manual.texi: More information about UNSIGNED BIGINT arithmetic sql/slave.cc: Make binary logs 4G safe sql/slave.h: Make binary logs 4G safe sql/sql_rename.cc: cleanup
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 209fbea1674..5dcc638235f 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -280,6 +280,21 @@ longlong Item_func_plus::val_int()
return (longlong) Item_func_plus::val();
}
+
+/*
+ The following function is here to allow the user to force
+ subtraction of UNSIGNED BIGINT to return negative values.
+*/
+
+void Item_func_minus::fix_length_and_dec()
+{
+ Item_num_op::fix_length_and_dec();
+ if (unsigned_flag &&
+ (current_thd->sql_mode & MODE_NO_UNSIGNED_SUBTRACTION))
+ unsigned_flag=0;
+}
+
+
double Item_func_minus::val()
{
double value=args[0]->val() - args[1]->val();