summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2004-09-07 15:42:19 +0500
committerunknown <bar@mysql.com>2004-09-07 15:42:19 +0500
commit95f42e1da29deb3fb2843c5066ea8692e7bdca08 (patch)
tree256da1b65d60ac047776d8ed3c5bd1d23a364457 /sql/item_timefunc.cc
parent7e7dfcccd64472c9d46b319e997181d0354b668c (diff)
downloadmariadb-git-95f42e1da29deb3fb2843c5066ea8692e7bdca08.tar.gz
Bug #5228 ORDER BY CAST(enumcol) sorts incorrectly under certain conditions
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 5d9a6dd9490..8f09fe82c1b 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2059,6 +2059,24 @@ bool Item_extract::eq(const Item *item, bool binary_cmp) const
}
+bool Item_char_typecast::eq(const Item *item, bool binary_cmp) const
+{
+ if (this == item)
+ return 1;
+ if (item->type() != FUNC_ITEM ||
+ func_name() != ((Item_func*)item)->func_name())
+ return 0;
+
+ Item_char_typecast *cast= (Item_char_typecast*)item;
+ if (cast_length != cast->cast_length ||
+ cast_cs != cast->cast_cs)
+ return 0;
+
+ if (!args[0]->eq(cast->args[0], binary_cmp))
+ return 0;
+ return 1;
+}
+
void Item_typecast::print(String *str)
{
str->append("cast(", 5);