| 362 | CAST_FLOAT_TO_STRING(DoubleVal, DoubleToBuffer, kDoubleToBufferSize); |
| 363 | |
| 364 | StringVal CastFunctions::CastToStringVal(FunctionContext* ctx, const TimestampVal& val) { |
| 365 | DCHECK(ctx != nullptr); |
| 366 | if (val.is_null) return StringVal::null(); |
| 367 | TimestampValue tv = TimestampValue::FromTimestampVal(val); |
| 368 | const DateTimeFormatContext* format_ctx = |
| 369 | reinterpret_cast<const DateTimeFormatContext*>( |
| 370 | ctx->GetFunctionState(FunctionContext::FRAGMENT_LOCAL)); |
| 371 | StringVal sv = |
| 372 | (format_ctx == nullptr) ? tv.ToStringVal(ctx) : tv.ToStringVal(ctx, *format_ctx); |
| 373 | AnyValUtil::TruncateIfNecessary(ctx->GetReturnType(), &sv); |
| 374 | return sv; |
| 375 | } |
| 376 | |
| 377 | StringVal CastFunctions::CastToStringVal(FunctionContext* ctx, const DateVal& val) { |
| 378 | DCHECK(ctx != nullptr); |
nothing calls this directly
no test coverage detected