mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-24 08:50:40 +00:00
feat: adds date_format function (#3167)
* feat: adds date_format function * fix: compile error * chore: use system timezone for FunctionContext and EvalContext * test: as_formatted_string * test: sqlness test * chore: rename function
This commit is contained in:
@@ -194,10 +194,10 @@ impl<'a, W: AsyncWrite + Unpin> MysqlResultWriter<'a, W> {
|
||||
Value::Date(v) => row_writer.write_col(v.to_chrono_date())?,
|
||||
// convert datetime and timestamp to timezone of current connection
|
||||
Value::DateTime(v) => row_writer.write_col(
|
||||
v.to_chrono_datetime_with_timezone(Some(query_context.timezone())),
|
||||
v.to_chrono_datetime_with_timezone(Some(&query_context.timezone())),
|
||||
)?,
|
||||
Value::Timestamp(v) => row_writer.write_col(
|
||||
v.to_chrono_datetime_with_timezone(Some(query_context.timezone())),
|
||||
v.to_chrono_datetime_with_timezone(Some(&query_context.timezone())),
|
||||
)?,
|
||||
Value::Interval(v) => row_writer.write_col(v.to_iso8601_string())?,
|
||||
Value::Duration(v) => row_writer.write_col(v.to_std_duration())?,
|
||||
@@ -210,7 +210,7 @@ impl<'a, W: AsyncWrite + Unpin> MysqlResultWriter<'a, W> {
|
||||
})
|
||||
}
|
||||
Value::Time(v) => row_writer
|
||||
.write_col(v.to_timezone_aware_string(Some(query_context.timezone())))?,
|
||||
.write_col(v.to_timezone_aware_string(Some(&query_context.timezone())))?,
|
||||
Value::Decimal128(v) => row_writer.write_col(v.to_string())?,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user