Wrong Original_sql display for bindings
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
```
TiDB root@127.0.0.1:test> create table t(a int);
Query OK, 0 rows affected
Time: 0.081s
TiDB root@127.0.0.1:test> create binding for select ifnull(t.a-1,-1) from t using select ifnull(t.a-1,-1) from t;
Query OK, 0 rows affected
Time: 0.002s
TiDB root@127.0.0.1:test> show bindings\G
***************************[ 1. row ]***************************
Original_sql | select `ifnull` ( `t` . `a` - ... ) from `test` . `t`
Bind_sql | SELECT ifnull(`t`.`a` - 1, -1) FROM `test`.`t`
Default_db | test
Status | enabled
Create_time | 2024-10-12 16:38:40.401000
Update_time | 2024-10-12 16:38:40.401000
Charset | utf8
Collation | utf8_general_ci
Source | manual
Sql_digest | a4fad74ad91a40fd1c2625d942e4d5275cc484206aac1b233a58b5926774e34e
Plan_digest |
1 row in set
```
It's better to display Orignal_sql as:
```
`ifnull` ( `t` . `a` - ?, ?) from `test` . `t`
```
Contributor guide
Assessment
This issue has not been assessed yet.