summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-12-08 19:39:23 +0400
committerAlexander Barkov <bar@mariadb.com>2018-12-10 19:25:12 +0400
commit34eb98387f8f46a80fb053081dbe20d415f23b39 (patch)
tree674bfd44acc89e741c26d788e614aa95a69c9936 /sql/item_subselect.cc
parent5b3db87134bb0af2f04027c42971e560fbbf04ab (diff)
downloadmariadb-git-34eb98387f8f46a80fb053081dbe20d415f23b39.tar.gz
MDEV-13995 MAX(timestamp) returns a wrong result near DST change
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 4a1ed59d7df..9c0fd057d0f 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1352,6 +1352,24 @@ String *Item_singlerow_subselect::val_str(String *str)
}
+bool Item_singlerow_subselect::val_native(THD *thd, Native *to)
+{
+ DBUG_ASSERT(fixed == 1);
+ if (forced_const)
+ return value->val_native(thd, to);
+ if (!exec() && !value->null_value)
+ {
+ null_value= false;
+ return value->val_native(thd, to);
+ }
+ else
+ {
+ reset();
+ return true;
+ }
+}
+
+
my_decimal *Item_singlerow_subselect::val_decimal(my_decimal *decimal_value)
{
DBUG_ASSERT(fixed == 1);