ClickHouse/tests/queries/0_stateless/01544_errorCodeToName.sql
Azat Khuzhin 3fb8d08dd4 Add errorCodeToName() function
This patch adds errorCode() function that will return macro name by the
exception code, useful for analyzing query_log and similar.

Later some descriptions can be added.

v2: replace hana::map/fusion::vector with external script
v3:
- use binary cmake dir for .sh
- use jump table over suboptimal std::unordered_map (with very poor hash
  function for int -- std::hash)
- cleanup errorCodeToName (drop extra templates and headers)
- rename errorCode -> errorCodeToName
- fix arcadia build (by not providing those helpers there)
- fix build on CI, by using CMAKE_CXX_COMPILER for parsing the file
2020-10-29 10:55:00 +03:00

4 lines
92 B
SQL

SELECT errorCodeToName(toUInt32(-1));
SELECT errorCodeToName(0);
SELECT errorCodeToName(1);