summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2002-03-27 01:56:10 +0200
committermonty@hundin.mysql.fi <>2002-03-27 01:56:10 +0200
commit727e507bca7fe9342f543340f9d7ea7a02e9708e (patch)
tree6998f99b1790b678ac1558e748e2a8c992bbfa22 /sql/item.cc
parentce541b292a20114adc5d5bb10142a441246e0675 (diff)
parent3a571c7c135b9e9707e09ace4058d00ed6935fd1 (diff)
downloadmariadb-git-727e507bca7fe9342f543340f9d7ea7a02e9708e.tar.gz
merge with 3.23.50
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc23
1 files changed, 20 insertions, 3 deletions
diff --git a/sql/item.cc b/sql/item.cc
index c081fd9dd5f..dac10eafafb 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -59,12 +59,28 @@ void Item::set_name(char *str,uint length)
}
}
-bool Item::eq(const Item *item) const // Only doing this on conds
+/*
+ This function is only called when comparing items in the WHERE clause
+*/
+
+bool Item::eq(const Item *item, bool binary_cmp) const
{
return type() == item->type() && name && item->name &&
!my_strcasecmp(name,item->name);
}
+bool Item_string::eq(const Item *item, bool binary_cmp) const
+{
+ if (type() == item->type())
+ {
+ if (binary_cmp)
+ return !stringcmp(&str_value, &item->str_value);
+ return !sortcmp(&str_value, &item->str_value);
+ }
+ return 0;
+}
+
+
/*
Get the value of the function as a TIME structure.
As a extra convenience the time structure is reset on error!
@@ -203,7 +219,7 @@ longlong Item_field::val_int_result()
return result_field->val_int();
}
-bool Item_field::eq(const Item *item) const
+bool Item_field::eq(const Item *item, bool binary_cmp) const
{
return item->type() == FIELD_ITEM && ((Item_field*) item)->field == field;
}
@@ -262,7 +278,8 @@ void Item_string::print(String *str)
str->append('\'');
}
-bool Item_null::eq(const Item *item) const { return item->type() == type(); }
+bool Item_null::eq(const Item *item, bool binary_cmp) const
+{ return item->type() == type(); }
double Item_null::val() { null_value=1; return 0.0; }
longlong Item_null::val_int() { null_value=1; return 0; }
/* ARGSUSED */