mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix errorCodeToName() for signed integers
- https://clickhouse-test-reports.s3.yandex.net/21529/2ce2772d35eb3d81628f4d294d5799e9f05333fd/functional_stateless_tests_(address).html#fail1 - https://clickhouse-test-reports.s3.yandex.net/21529/2ce2772d35eb3d81628f4d294d5799e9f05333fd/functional_stateless_tests_(ubsan).html#fail1 - https://clickhouse-test-reports.s3.yandex.net/21529/2ce2772d35eb3d81628f4d294d5799e9f05333fd/stress_test_(address).html#fail1
This commit is contained in:
parent
efdd04c958
commit
cc87bcfb63
@ -579,7 +579,7 @@ namespace ErrorCodes
|
|||||||
|
|
||||||
std::string_view getName(ErrorCode error_code)
|
std::string_view getName(ErrorCode error_code)
|
||||||
{
|
{
|
||||||
if (error_code >= END)
|
if (error_code < 0 || error_code >= END)
|
||||||
return std::string_view();
|
return std::string_view();
|
||||||
return error_codes_names.names[error_code];
|
return error_codes_names.names[error_code];
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
OK
|
OK
|
||||||
UNSUPPORTED_METHOD
|
UNSUPPORTED_METHOD
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
SELECT errorCodeToName(toUInt32(-1));
|
SELECT errorCodeToName(toUInt32(-1));
|
||||||
|
SELECT errorCodeToName(-1);
|
||||||
SELECT errorCodeToName(600); /* gap in error codes */
|
SELECT errorCodeToName(600); /* gap in error codes */
|
||||||
SELECT errorCodeToName(0);
|
SELECT errorCodeToName(0);
|
||||||
SELECT errorCodeToName(1);
|
SELECT errorCodeToName(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user