pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://tidbcloud.com/free-trial
https://pingcap.com
Apache License 2.0
36.27k stars 5.72k forks source link

Dashboard slow query page formatting SQL text with "hexadecimal literals" is incorrect #52974

Closed harry1129 closed 5 days ago

harry1129 commented 2 weeks ago

Bug Report

Dashboard slow query page formatting SQL text with "hexadecimal literals" is incorrect

1. Minimal reproduce step (Required)

  1. Execute sql

    select HEX('TiDB'),X'54694442',0x54694442,sleep(1);
  2. Query Dashboard slow query page.

2. What did you expect to see? (Required)

Dashboard slow query page There's an extra space

SELECT
  HEX('TiDB'),
  X '54694442',
  0x54694442,
  sleep(1);

3. What did you see instead (Required)

SELECT
  HEX('TiDB'),
  X'54694442',
  0x54694442,
  sleep(1);

4. What is your TiDB version? (Required)

Release Version: v8.0.0
Edition: Community
Git Commit Hash: 8ba1fa452b1ccdbfb85879ea94b9254aabba2916
Git Branch: HEAD
UTC Build Time: 2024-03-28 14:22:34
GoVersion: go1.21.6
Race Enabled: false
Check Table Before Drop: false
Store: tikv
Defined2014 commented 5 days ago

dup with https://github.com/pingcap/tidb/issues/52973