summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2013-11-21 13:09:08 +0400
committerAlexander Barkov <bar@mnogosearch.org>2013-11-21 13:09:08 +0400
commitc7355b19828c37d8efb9f1d4b5010544aa110bd4 (patch)
treeb74e960c3447f7c3c876c1262e5703c7dcf75b4f /sql/item_cmpfunc.cc
parent160236f880e92d2872d95ce72aab144f08456bcc (diff)
parent2394fa67d4908f62ef14f3ca90269fb32806d193 (diff)
downloadmariadb-git-c7355b19828c37d8efb9f1d4b5010544aa110bd4.tar.gz
Merge 5.3->5.5
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 22049ac26b4..7a07299bf2c 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -888,10 +888,13 @@ get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
enum_field_types f_type= item->cmp_type() == TIME_RESULT ?
item->field_type() : warn_item->field_type();
- if (item->result_type() == INT_RESULT && item->cmp_type() == TIME_RESULT)
+ if (item->result_type() == INT_RESULT &&
+ item->cmp_type() == TIME_RESULT &&
+ item->type() == Item::CACHE_ITEM)
{
/* it's our Item_cache_temporal, as created below */
- value= item->val_int();
+ DBUG_ASSERT(is_temporal_type(((Item_cache *) item)->field_type()));
+ value= ((Item_cache_temporal*) item)->val_temporal_packed();
}
else
{