| 975 | } |
| 976 | |
| 977 | bool vers_select_conds_t::init_from_sysvar(THD *thd) |
| 978 | { |
| 979 | vers_asof_timestamp_t &in= thd->variables.vers_asof_timestamp; |
| 980 | type= (vers_system_time_t) in.type; |
| 981 | delete_history= false; |
| 982 | start.unit= VERS_TIMESTAMP; |
| 983 | if (type != SYSTEM_TIME_UNSPECIFIED && type != SYSTEM_TIME_ALL) |
| 984 | { |
| 985 | DBUG_ASSERT(type == SYSTEM_TIME_AS_OF); |
| 986 | Datetime dt(in.unix_time, in.second_part, thd->variables.time_zone); |
| 987 | |
| 988 | start.item= new (thd->mem_root) |
| 989 | Item_datetime_literal(thd, &dt, TIME_SECOND_PART_DIGITS); |
| 990 | if (!start.item) |
| 991 | return true; |
| 992 | } |
| 993 | else |
| 994 | start.item= NULL; |
| 995 | end.empty(); |
| 996 | return false; |
| 997 | } |
| 998 | |
| 999 | void vers_select_conds_t::print(String *str, enum_query_type query_type) const |
| 1000 | { |