diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2013-11-21 13:09:08 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2013-11-21 13:09:08 +0400 |
commit | c7355b19828c37d8efb9f1d4b5010544aa110bd4 (patch) | |
tree | b74e960c3447f7c3c876c1262e5703c7dcf75b4f /sql/item_cmpfunc.cc | |
parent | 160236f880e92d2872d95ce72aab144f08456bcc (diff) | |
parent | 2394fa67d4908f62ef14f3ca90269fb32806d193 (diff) | |
download | mariadb-git-c7355b19828c37d8efb9f1d4b5010544aa110bd4.tar.gz |
Merge 5.3->5.5
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 7 |
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 { |