Azat Khuzhin 2021-03-09 09:09:28 +03:00
parent efdd04c958
commit cc87bcfb63
3 changed files with 3 additions and 1 deletions

View File

@ -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];
} }

View File

@ -1,4 +1,5 @@
OK OK
UNSUPPORTED_METHOD UNSUPPORTED_METHOD

View File

@ -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);