Skip to content

Commit

Permalink
TSO: fix pre-v7.4 (#15604)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiancai authored Dec 7, 2023
1 parent 5ff35a1 commit 2749151
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions tso.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ SELECT @ts;

注意由于 TSO 时间戳是按事务分配的,所以需要从包含 `BEGIN; ...; ROLLBACK` 的事务中获取时间戳。

从上例中得到的 TSO 时间戳是一个十进制数。你可以使用以下 SQL 函数来解析时间戳:

- [`TIDB_PARSE_TSO()`](/functions-and-operators/tidb-functions.md#tidb_parse_tso)
- [`TIDB_PARSE_TSO_LOGICAL()`](/functions-and-operators/tidb-functions.md)
从上例中得到的 TSO 时间戳是一个十进制数。你可以使用 SQL 函数 [`TIDB_PARSE_TSO()`](/functions-and-operators/tidb-functions.md#tidb_parse_tso) 来解析它:

```sql
SELECT TIDB_PARSE_TSO(443852055297916932);
Expand All @@ -41,16 +38,6 @@ SELECT TIDB_PARSE_TSO(443852055297916932);
1 row in set (0.00 sec)
```

```sql
SELECT TIDB_PARSE_TSO_LOGICAL(443852055297916932);
+--------------------------------------------+
| TIDB_PARSE_TSO_LOGICAL(443852055297916932) |
+--------------------------------------------+
| 4 |
+--------------------------------------------+
1 row in set (0.00 sec)
```

下面示例展示了 TSO 时间戳的二进制细节:

```shell
Expand Down

0 comments on commit 2749151

Please sign in to comment.