JasonLaw
V2EX  ›  数据库

如何获取 performance_schema.data_locks 字段“lock data”的真实数据?

  •  
  •   JasonLaw · Jul 3, 2020 · 1381 views
    This topic created in 2167 days ago, the information mentioned may be changed or developed.

    MySQL :: MySQL 8.0 Reference Manual :: 15.15.2.1 Using InnoDB Transaction and Locking Information中,里面展示了一个data_locks表的示例内容。

    | lock id  | lock trx id | lock mode | lock type | lock schema | lock table | lock index | lock data |
    | -------- | ----------- | --------- | --------- | ----------- | ---------- | ---------- | --------- |
    | A3:1:3:2 | A3          | X         | RECORD    | test        | t          | PRIMARY    | 0x0200    |
    | A4:1:3:2 | A4          | X         | RECORD    | test        | t          | PRIMARY    | 0x0200    |
    | A5:1:3:2 | A5          | X         | RECORD    | test        | t          | PRIMARY    | 0x0200    |
    

    请问怎么将0x0200转换为人类可理解的内容呢?

    2 replies    2020-12-14 17:28:35 +08:00
    JasonLaw
        1
    JasonLaw  
    OP
       Jul 3, 2020
    具体原因我也不太清楚,我猜测数据是 float 类型之类的,因为自己尝试过,float 类型的时候,`lock data`就会是这种格式的数据,但是如果数据是 int 类型的话,`lock data`会是人类可读的(比如说 8 )。
    y7E6IG8spV7TU8n7
        2
    y7E6IG8spV7TU8n7  
       Dec 14, 2020
    借楼问下 lock_mode 里的 X 号是表示什么
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3398 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 12:07 · PVG 20:07 · LAX 05:07 · JFK 08:07
    ♥ Do have faith in what you're doing.