summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 8813324262c..b20a6892ce2 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -123,7 +123,17 @@ public:
delete [] comparators;
comparators= 0;
}
-
+ /*
+ Set correct cmp_context if items would be compared as INTs.
+ */
+ inline void set_cmp_context_for_datetime()
+ {
+ DBUG_ASSERT(func == &Arg_comparator::compare_datetime);
+ if ((*a)->result_as_longlong())
+ (*a)->cmp_context= INT_RESULT;
+ if ((*b)->result_as_longlong())
+ (*b)->cmp_context= INT_RESULT;
+ }
friend class Item_func;
};