summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorunknown <harrison@bud.lordblink.com>2003-10-15 02:11:03 -0400
committerunknown <harrison@bud.lordblink.com>2003-10-15 02:11:03 -0400
commitacb47c93be78fbc59ca75fc1195444e7d8dc3568 (patch)
tree61ece9d1249d602850409cb88d9ac7e67a14362f /sql/item_sum.cc
parenta14c1e411cb763688a0673b326cdd09c589fecf0 (diff)
downloadmariadb-git-acb47c93be78fbc59ca75fc1195444e7d8dc3568.tar.gz
Add in bit_xor function (approved by Sergei)
sql/item_sum.cc: Add in bit_xor class functions. sql/item_sum.h: Add bit_xor class. sql/lex.h: Add in bit_xor symbol. sql/sql_yacc.yy: Add in bit_xor function BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 6a213962c6a..672126a2664 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -625,6 +625,20 @@ bool Item_sum_or::add()
return 0;
}
+Item *Item_sum_xor::copy_or_same(THD* thd)
+{
+ return new (&thd->mem_root) Item_sum_xor(thd, *this);
+}
+
+
+bool Item_sum_xor::add()
+{
+ ulonglong value= (ulonglong) args[0]->val_int();
+ if (!args[0]->null_value)
+ bits^=value;
+ return 0;
+}
+
Item *Item_sum_and::copy_or_same(THD* thd)
{
return new (&thd->mem_root) Item_sum_and(thd, *this);
@@ -912,6 +926,15 @@ void Item_sum_or::update_field()
int8store(res,nr);
}
+void Item_sum_xor::update_field()
+{
+ ulonglong nr;
+ char *res=result_field->ptr;
+
+ nr=uint8korr(res);
+ nr^= (ulonglong) args[0]->val_int();
+ int8store(res,nr);
+}
void Item_sum_and::update_field()
{