You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy original content instead of formatted content when clicking the "Copy" button
Fix the incorrect format behavior for sql-formatter-plus-plus lib
For step 1, some reasons (personal opinion):
It seems most people report the formatted SQL is incorrect because they copy and paste to run it in the SQL client, found it doesn't work, else they can't notice the incorrectness. So I think people (especially the DBAs) care the correctness more than style.
Formatting the SQL belongs view layer staff, it is just for easy reading, but when copying and pasting to SQL client, the style is not that important.
We can't confirm the sql-formatter-plus-plus lib won't format some others incorrectly, we need to fix them case by case.
Copying the formatted content makes locate the problem more complex a bit. If people report the formatted SQL doesn't work, we need to find out whether it happened in the TiDB layer or dashboard layer.
According to my OnCall experience formatting SQL is very frequently used, even for copied content, since an unformatted SQL is usually not readable, for example, too long, or all in one line, which makes people hard to know what is it and what's inside (is it a join? does it contain sub queries? etc) .
How about introducing "Copy Original" and "Copy Formatted"? This may be good for all cases.
Bug Report
1. Minimal reproduce step (Required)
Linked issue.
The digester produces an invalid SQL for the following statement:
This statement is generated by the tidb-dashboard.
I have another digester bug in pingcap/tidb#14241 - it is annoying when the syntax generated back is invalid.
2. What did you expect to see? (Required)
3. What did you see instead (Required)
There is a space between the two @ symbols:
4. Affected version (Required)
5. Root Cause Analysis
The text was updated successfully, but these errors were encountered: