mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
Merge pull request #37775 from liuneng1994/fix_date32_to_string
fix toString error on DatatypeDate32
This commit is contained in:
commit
b34782dc6a
@ -705,7 +705,7 @@ template <>
|
||||
struct FormatImpl<DataTypeDate32>
|
||||
{
|
||||
template <typename ReturnType = void>
|
||||
static ReturnType execute(const DataTypeDate::FieldType x, WriteBuffer & wb, const DataTypeDate32 *, const DateLUTImpl *)
|
||||
static ReturnType execute(const DataTypeDate32::FieldType x, WriteBuffer & wb, const DataTypeDate32 *, const DateLUTImpl *)
|
||||
{
|
||||
writeDateText(ExtendedDayNum(x), wb);
|
||||
return ReturnType(true);
|
||||
|
@ -283,3 +283,9 @@
|
||||
1925-01-01 \N
|
||||
1925-01-01
|
||||
\N
|
||||
1925-01-01
|
||||
1969-12-31
|
||||
1970-01-01
|
||||
2149-06-06
|
||||
2149-06-07
|
||||
2283-11-11
|
||||
|
@ -118,4 +118,15 @@ select toDate32OrZero('1924-01-01'), toDate32OrNull('1924-01-01');
|
||||
select toDate32OrZero(''), toDate32OrNull('');
|
||||
select (select toDate32OrZero(''));
|
||||
select (select toDate32OrNull(''));
|
||||
SELECT toString(T.d) dateStr
|
||||
FROM
|
||||
(
|
||||
SELECT '1925-01-01'::Date32 d
|
||||
UNION ALL SELECT '1969-12-31'::Date32
|
||||
UNION ALL SELECT '1970-01-01'::Date32
|
||||
UNION ALL SELECT '2149-06-06'::Date32
|
||||
UNION ALL SELECT '2149-06-07'::Date32
|
||||
UNION ALL SELECT '2283-11-11'::Date32
|
||||
) AS T
|
||||
ORDER BY T.d
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user