ClickHouse/tests/queries/0_stateless/02366_kql_func_datetime.reference
Yong Wang 795c1a98dc
Fix segmentation fault in KQL parser when the input query exceeds the max_query_size (#59626)
* Fix_kql_issue_found_by_wingfuzz

This commit fix the issues:
 https://github.com/ClickHouse/ClickHouse/issues/59036
 https://github.com/ClickHouse/ClickHouse/issues/59037

both issues are same reason, the input query exceed the max_query_size,
so the condition isEnd() of token is not meet and cause the assertion failure

* fix_kql_issue_found_by_wingfuzz: use isValid instead of TokenType::EndOfStream

* fix_kql_issue_found_by_wingfuzz: make functional test result consist

* fix_kql_issue_found_by_wingfuzz: update test case for makeseries

* fix_kql_issue_found_by_wingfuzz: disable makeseries

* fix_kql_issue_found_by_wingfuzz:
 use isvalid() function to replace isEnd() function of TokenIterator to check the end of stream

* fix_kql_issue_found_by_wingfuzz: add test case for max_query_size

* fix_kql_issue_found_by_wingfuzz: fix AST structure

* fix_kql_issue_found_by_wingfuzz: make sure the max query size test is in the dialect of kusto

* fix_kql_issue_found_by_wingfuzz : restore max query size after test

* fix_kql_issue_found_by_wingfuzz : fix typo

---------

Co-authored-by: János Benjamin Antal <benjamin.antal@clickhouse.com>
2024-02-26 13:31:47 +01:00

77 lines
1.8 KiB
Plaintext

-- dayofmonth()
31
-- dayofweek()
4.00:00:00
-- dayofyear()
365
-- getmonth()
10
-- getyear()
2015
-- hoursofday()
23
-- startofday()
2017-01-01 00:00:00.000000000
2016-12-31 00:00:00.000000000
2017-01-02 00:00:00.000000000
-- endofday()
2017-01-01 23:59:59.999999000
2016-12-31 23:59:59.999999000
2017-01-02 23:59:59.999999000
-- endofmonth()
2017-01-31 23:59:59.999999000
2016-12-31 23:59:59.999999000
2017-02-28 23:59:59.999999000
2022-09-30 23:59:59.999999000
-- startofweek()
2017-01-01 00:00:00.000000000
2016-12-25 00:00:00.000000000
2017-01-08 00:00:00.000000000
-- endofweek()
2017-01-07 23:59:59.999999000
2016-12-31 23:59:59.999999000
2017-01-14 23:59:59.999999000
-- startofyear()
2017-01-01 00:00:00.000000000
2016-01-01 00:00:00.000000000
2018-01-01 00:00:00.000000000
-- endofyear()
2017-12-31 23:59:59.999999000
2016-12-31 23:59:59.999999000
2018-12-31 23:59:59.999999000
-- unixtime_seconds_todatetime()
2019-01-01 00:00:00.000000000
1970-01-02 00:00:00.000000000
1969-12-31 00:00:00.000000000
-- unixtime_microseconds_todatetime
2019-01-01 00:00:00.000000
-- unixtime_milliseconds_todatetime()
2019-01-01 00:00:00.000
-- unixtime_nanoseconds_todatetime()
2019-01-01 00:00:00.000000000
-- weekofyear()
52
-- monthofyear()
12
-- weekofyear()
52
-- now()
1
-- make_datetime()
1
2017-10-01 12:10:00.0000000
2017-10-01 12:11:00.0000000
-- format_datetime
15-12-14 02:03:04.1234500
17-01-29 [09:00:05] 2017-01-29 [09:00:05] 17-01-29 [09:00:05 AM]
-- format_timespan()
02:03:04.1234500
29.09:00:05:12
-- ago()
-- datetime_diff()
17 2 13 4 29 2 5 10
-- datetime_part()
2017 4 10 44 30 303 01 02 03
-- datetime_add()
2018-01-01 00:00:00.0000000 2017-04-01 00:00:00.0000000 2017-02-01 00:00:00.0000000 2017-01-08 00:00:00.0000000 2017-01-02 00:00:00.0000000 2017-01-01 01:00:00.0000000 2017-01-01 00:01:00.0000000 2017-01-01 00:00:01.0000000