diff options
author | Mattias Jonsson <mattias.jonsson@oracle.com> | 2011-06-13 11:57:47 +0200 |
---|---|---|
committer | Mattias Jonsson <mattias.jonsson@oracle.com> | 2011-06-13 11:57:47 +0200 |
commit | 10e3313366ff9b2050c4e8674381cb069cc1b770 (patch) | |
tree | e9f7dcaea07cffd1d7bace5e923414f1430c3d19 /sql/item_timefunc.cc | |
parent | f2f22614fa20e1e033153ad81f44e659bc37c435 (diff) | |
parent | 11ad61f8c46e21deb2609ff73346fb4254be742f (diff) | |
download | mariadb-git-10e3313366ff9b2050c4e8674381cb069cc1b770.tar.gz |
merge
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index b31a388bea4..c075edea5ff 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1388,6 +1388,26 @@ longlong Item_func_unix_timestamp::val_int() return (longlong) TIME_to_timestamp(current_thd, <ime, ¬_used); } +enum_monotonicity_info Item_func_unix_timestamp::get_monotonicity_info() const +{ + if (args[0]->type() == Item::FIELD_ITEM && + (args[0]->field_type() == MYSQL_TYPE_TIMESTAMP)) + return MONOTONIC_INCREASING; + return NON_MONOTONIC; +} + + +longlong Item_func_unix_timestamp::val_int_endpoint(bool left_endp, bool *incl_endp) +{ + DBUG_ASSERT(fixed == 1); + DBUG_ASSERT(arg_count == 1 && + args[0]->type() == Item::FIELD_ITEM && + args[0]->field_type() == MYSQL_TYPE_TIMESTAMP); + Field *field=((Item_field*) args[0])->field; + /* Leave the incl_endp intact */ + return ((Field_timestamp*) field)->get_timestamp(&null_value); +} + longlong Item_func_time_to_sec::val_int() { |