ClickHouse/tests
Azat Khuzhin 62a29420bd Fix signed integer overflow for nth_value() window function
CI report [1]:

    ../src/Processors/Transforms/WindowTransform.cpp:1699:54: runtime error: signed integer overflow: -9223372036854775808 - 1 cannot be represented in type 'long' Received signal -3 Received signal Unknown signal (-3)

In query:

    SELECT
        number,
        nth_value(number, 2147483648) OVER w,
        anyOrNull(number) OVER (ORDER BY -2147483648 - intDiv(number, 1024) DESC NULLS FIRST, number DESC ROWS BETWEEN 65535 FOLLOWING AND UNBOUNDED FOLLOWING),
        nth_value(number, 65537) OVER w AS firstValue,
        nth_value(number, -9223372036854775808) OVER w AS secondValue,
        nth_value(number, 1048576) OVER w AS thirdValue
    FROM numbers(1)
    WINDOW w AS (ORDER BY number DESC)
    ORDER BY number DESC

  [1]: https://clickhouse-test-reports.s3.yandex.net/28532/7623af5513e12aa8dfa1bee963caffe00185c31a/fuzzer_ubsan/report.html#fail1
2021-09-10 21:02:04 +03:00
..
ci
config Merge branch 'master' into governance/session_log 2021-09-07 10:12:54 +03:00
external_models/catboost
fuzz
instructions
integration Merge pull request #28656 from ClickHouse/move_docker_images_to_separate_repo 2021-09-10 10:24:21 +03:00
jepsen.clickhouse-keeper Fix clickhouse keeper jepsen tests 2021-08-25 19:15:56 +03:00
perf_drafts
performance Merge branch 'master' into async-reads 2021-08-31 02:52:58 +03:00
queries Fix signed integer overflow for nth_value() window function 2021-09-10 21:02:04 +03:00
testflows Renames for testflows 2021-09-08 13:06:03 +03:00
users.d
.gitignore
clickhouse-client.xml
clickhouse-test Fix error code of clickhouse-test if server is dead. 2021-09-09 15:31:29 +03:00
client-test.xml
CMakeLists.txt
decimals_dictionary.xml
executable_pool_dictionary.xml
ints_dictionary.xml
msan_suppressions.txt
server-test.xml
stress
strings_dictionary.xml
tsan_suppressions.txt
ubsan_suppressions.txt suppress boost geometry UBSan 2021-03-12 12:39:40 +03:00
users.xml