diff options
author | Alexander Barkov <bar@mariadb.com> | 2019-12-19 14:03:54 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-12-19 14:03:54 +0400 |
commit | 1f1e3ce8a18ab548f9641ea10295372abbd147ad (patch) | |
tree | 4988f087b0688195015141f24aa4f6a0d571504f /sql/item.h | |
parent | a5a433e256d29f00b6b51babcf0aac49e95c7e82 (diff) | |
download | mariadb-git-1f1e3ce8a18ab548f9641ea10295372abbd147ad.tar.gz |
MDEV-21319 COUNT(*) returns 1, actual SELECT returns no result in 10.3.21, but 1 result in 10.1.41
Item_ref::val_(datetime|time)_packed() erroneously called
(*ref)->val_(datetime|time)_packed().
- Fixing to call (*ref)->val_(datetime|time)_packed_result().
- Backporting Item::val_(datetime|time)_packed_result() from 10.3.
- Fixing Item_field::get_date_result() to handle null_value in the same
way how Item_field::get_date() does.
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h index fb11064f122..bea09620ef8 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1302,6 +1302,13 @@ public: uint fuzzydate= TIME_FUZZY_DATES | TIME_INVALID_DATES | TIME_TIME_ONLY; return get_date(<ime, fuzzydate) ? 0 : pack_time(<ime); } + longlong val_datetime_packed_result(); + longlong val_time_packed_result() + { + MYSQL_TIME ltime; + uint fuzzydate= TIME_TIME_ONLY | TIME_INVALID_DATES | TIME_FUZZY_DATES; + return get_date_result(<ime, fuzzydate) ? 0 : pack_time(<ime); + } // Get a temporal value in packed DATE/DATETIME or TIME format longlong val_temporal_packed(enum_field_types f_type) { |