mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Merging #2770
This commit is contained in:
parent
ac73431451
commit
b8cbedee27
@ -1570,6 +1570,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/** formatDateTime(time, 'pattern')
|
||||
* Performs formatting of time, according to provided pattern
|
||||
*/
|
||||
@ -1582,8 +1583,6 @@ private:
|
||||
FormattingOperation(const char * source, size_t copy_source, size_t copy_length)
|
||||
: source(source), source_position_to_copy(copy_source), source_length_to_copy(copy_length) {}
|
||||
|
||||
FormattingOperation(const char * source) : source(source) {}
|
||||
|
||||
void (*operation)(char *&, UInt32, const DateLUTImpl &) = nullptr;
|
||||
|
||||
private:
|
||||
@ -1698,9 +1697,11 @@ private:
|
||||
static void format_I(char *& target, UInt32 source, const DateLUTImpl & timezone)
|
||||
{
|
||||
auto x = ToHourImpl::execute(source, timezone);
|
||||
writeNumber2(target, x > 12 ? x - 12 : x);
|
||||
writeNumber2(target, x == 0 ? 12 : (x > 12 ? x - 12 : x));
|
||||
}
|
||||
|
||||
/// TODO format_l
|
||||
|
||||
static void format_j(char *& target, UInt32 source, const DateLUTImpl & timezone)
|
||||
{
|
||||
writeNumberWidth(target, ToDayOfYearImpl::execute(source, timezone), 3);
|
||||
|
@ -1,3 +1,5 @@
|
||||
SET send_logs_level = 'none';
|
||||
|
||||
SELECT formatDateTime(); -- { serverError 42 }
|
||||
SELECT formatDateTime('not a datetime', 'IGNORED'); -- { serverError 43 }
|
||||
SELECT formatDateTime(now(), now()); -- { serverError 43 }
|
||||
|
Loading…
Reference in New Issue
Block a user