Commit 1a463305 authored by Sergei Golubchik's avatar Sergei Golubchik

implement Item_singlerow_subselect::get_date() to avoid

unnecessary date->string->date conversion
parent beec2a2b
......@@ -1178,6 +1178,24 @@ bool Item_singlerow_subselect::val_bool()
}
bool Item_singlerow_subselect::get_date(MYSQL_TIME *ltime,uint fuzzydate)
{
DBUG_ASSERT(fixed == 1);
if (forced_const)
return value->get_date(ltime, fuzzydate);
if (!exec() && !value->null_value)
{
null_value= FALSE;
return value->get_date(ltime, fuzzydate);
}
else
{
reset();
return 0;
}
}
Item_exists_subselect::Item_exists_subselect(st_select_lex *select_lex):
Item_subselect()
{
......
......@@ -275,6 +275,7 @@ class Item_singlerow_subselect :public Item_subselect
String *val_str (String *);
my_decimal *val_decimal(my_decimal *);
bool val_bool();
bool get_date(MYSQL_TIME *ltime,uint fuzzydate);
enum Item_result result_type() const;
enum_field_types field_type() const;
void fix_length_and_dec();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment