From 6f4bc11a04a5a21a44f182496e0703a8fa5d12f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E6=9C=A8=E5=A4=95120?= Date: Wed, 27 Oct 2021 10:00:59 +0800 Subject: [PATCH] Create errors.md --- docs/zh/operations/system-tables/errors.md | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 docs/zh/operations/system-tables/errors.md diff --git a/docs/zh/operations/system-tables/errors.md b/docs/zh/operations/system-tables/errors.md new file mode 100644 index 00000000000..4d7baafb865 --- /dev/null +++ b/docs/zh/operations/system-tables/errors.md @@ -0,0 +1,35 @@ +# system.errors {#system_tables-errors} + +包含错误代码和它们被触发的次数. + +列信息: + +- `name` ([String](../../sql-reference/data-types/string.md)) — 错误名称 (`errorCodeToName`). +- `code` ([Int32](../../sql-reference/data-types/int-uint.md)) — 错误码. +- `value` ([UInt64](../../sql-reference/data-types/int-uint.md)) — 发生此错误的次数. +- `last_error_time` ([DateTime](../../sql-reference/data-types/datetime.md)) — 上一次错误发生的时间. +- `last_error_message` ([String](../../sql-reference/data-types/string.md)) — 最后一个错误的消息. +- `last_error_trace` ([Array(UInt64)](../../sql-reference/data-types/array.md)) — 一个[堆栈跟踪](https://en.wikipedia.org/wiki/Stack_trace), 它表示存储被调用方法的物理地址列表. +- `remote` ([UInt8](../../sql-reference/data-types/int-uint.md)) — 远程异常(即在一个分布式查询期间接收的). + +**示例** + +``` sql +SELECT name, code, value +FROM system.errors +WHERE value > 0 +ORDER BY code ASC +LIMIT 1 + +┌─name─────────────┬─code─┬─value─┐ +│ CANNOT_OPEN_FILE │ 76 │ 1 │ +└──────────────────┴──────┴───────┘ +``` + +``` sql +WITH arrayMap(x -> demangle(addressToSymbol(x)), last_error_trace) AS all +SELECT name, arrayStringConcat(all, '\n') AS res +FROM system.errors +LIMIT 1 +SETTINGS allow_introspection_functions=1\G +```