summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 427146e11dc..e782e90b874 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -7287,14 +7287,16 @@ int stored_field_cmp_to_item(THD *thd, Field *field, Item *item)
enum_field_types field_type= field->type();
- if (field_type == MYSQL_TYPE_DATE || field_type == MYSQL_TYPE_DATETIME)
+ if (field_type == MYSQL_TYPE_DATE || field_type == MYSQL_TYPE_DATETIME ||
+ field_type == MYSQL_TYPE_TIMESTAMP)
{
enum_mysql_timestamp_type type= MYSQL_TIMESTAMP_ERROR;
if (field_type == MYSQL_TYPE_DATE)
type= MYSQL_TIMESTAMP_DATE;
- if (field_type == MYSQL_TYPE_DATETIME)
+ if (field_type == MYSQL_TYPE_DATETIME ||
+ field_type == MYSQL_TYPE_TIMESTAMP)
type= MYSQL_TIMESTAMP_DATETIME;
const char *field_name= field->field_name;
@@ -7850,9 +7852,12 @@ bool Item_cache_row::null_inside()
void Item_cache_row::bring_value()
{
+ if (!example)
+ return;
+ example->bring_value();
+ null_value= example->null_value;
for (uint i= 0; i < item_count; i++)
values[i]->bring_value();
- return;
}