diff options
author | Michael Widenius <monty@askmonty.org> | 2010-11-23 23:39:59 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2010-11-23 23:39:59 +0200 |
commit | b52020221e8b4e58d1bc6dd5a5a6f065a6a3a083 (patch) | |
tree | 6068b9d90b4127b1c3608e29913fa82bf1a1f20e /sql/item.cc | |
parent | 7840965db9460e2117c163f3db83aaa247c65203 (diff) | |
parent | 498ee6bd19eabc85dcbd9abebc9cf6aeb79d1985 (diff) | |
download | mariadb-git-b52020221e8b4e58d1bc6dd5a5a6f065a6a3a083.tar.gz |
Merge with MySQL 5.1.52
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/item.cc b/sql/item.cc index 1c1137fa75c..08246ea14c3 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -7004,14 +7004,14 @@ 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) + else type= MYSQL_TIMESTAMP_DATETIME; const char *field_name= field->field_name; @@ -7438,9 +7438,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; } |