DESCRIBE TRANSACTION

描述 事务,包括开始时间和状态(正在运行、已提交、已回滚)。

DESCRIBE 可以缩写为 DESC。

另请参阅:

CURRENT_TRANSACTIONLAST_TRANSACTIONBEGINCOMMITROLLBACKSHOW TRANSACTIONS

语法

{ DESC | DESCRIBE } TRANSACTION <transaction_id>
Copy

参数

transaction_id

指定要描述的事务的标识符。

transaction_id 必须是字面量而非会话变量。

使用说明

  • To post-process the output of this command, you can use the pipe operator (->>) or the RESULT_SCAN function. Both constructs treat the output as a result set that you can query.

    For example, you can use the pipe operator or RESULT_SCAN function to select specific columns from the SHOW command output or filter the rows.

    When you refer to the output columns, use double-quoted identifiers for the column names. For example, to select the output column type, specify SELECT "type".

    You must use double-quoted identifiers because the output column names for SHOW commands are in lowercase. The double quotes ensure that the column names in the SELECT list or WHERE clause match the column names in the SHOW command output that was scanned.

输出

命令的输出包括以下列,它们描述了对象的属性和元数据:

描述

id

事务的唯一标识符。

user

运行事务的用户的用户 ID。

session name

执行事务的用户会话的会话 ID。

started_on

创建事务的日期和时间。

state

事务的完成状态,例如:已提交、已回滚或仍在运行。

ended_on

事务完成的日期和时间。

示例

DESC TRANSACTION 1651535571261000000;
Copy
语言: 中文