| 182 | } |
| 183 | |
| 184 | BigIntVal TimestampFunctions::UnixFromString(FunctionContext* context, |
| 185 | const StringVal& sv) { |
| 186 | if (sv.is_null) return BigIntVal::null(); |
| 187 | const TimestampValue& tv = TimestampValue::ParseSimpleDateFormat( |
| 188 | reinterpret_cast<const char *>(sv.ptr), sv.len); |
| 189 | const Timezone* tz = context->impl()->state()->time_zone_for_unix_time_conversions(); |
| 190 | time_t result; |
| 191 | return (tv.ToUnixTime(tz, &result)) ? BigIntVal(result) : BigIntVal::null(); |
| 192 | } |
| 193 | |
| 194 | IntVal TimestampFunctions::Year(FunctionContext* context, const TimestampVal& ts_val) { |
| 195 | if (ts_val.is_null) return IntVal::null(); |
nothing calls this directly
no test coverage detected